public MeasurementForm(Treatment treatment, SmileFile file, MainWindow m)
        {
            InitializeComponent();
            app = System.Windows.Application.Current as App;
            Mantooth = new List<MeasurementTeeth>();
            Autotooth = new List<MeasurementTeeth>();
            DB = DentalSmileDBFactory.GetInstance();
            this.mw = m;
            
            
            //TODO: DB.User = app.user.UserId;

            measurement = new Measurement();
            string treatment_id = treatment.Id;
            if (treatment_id == null)
            {
                treatment_id = treatment.RefId;
            }
            measurement.Treatment = treatment_id;
            measurement.Patient = treatment.Patient.Id;
            measurement.Pfile = file.Id;

            string measurement_id = checkPreviousData(file.Id) ;
            if(measurement_id !=null)
            { LoadMeasurementGrid(measurement_id); }

        }
Ejemplo n.º 2
0
 public void Cure(IPatient patient, Diagnosis diagnosis, Treatment appoitment)
 {
     if (patient.PatientBill.IsPayed)
     {
         // magic
     }
 }
 public Treatment GenerateTreatment(Client client, Counselor counselor)
 {
     var treatment = new Treatment();
     treatment.StartDate = DateTime.Now;
     treatment.Client = client;
     treatment.Counselor = counselor;
     treatment.Steps = GenerateSteps();
     return treatment;
 }
        public List<Prescription> NewPrescriptions(Treatment treatment)
        {
            List<Prescription> newPrescriptions=aCenterGateway.GetPrescription(treatment);
            foreach (Prescription prescription in newPrescriptions)
            {
                prescription.MedicineName = aCenterGateway.MedicineName(prescription.MedicineID);
                prescription.DiseaseName = aCenterGateway.DiseaseName(prescription.DiseaseID);

            }
            return newPrescriptions;
        }
        public string GetTreatment(int number, Treatment newTreatment)
        {
            string html = "<div>";
            html += "<h3>Treatment " + number + " </h3>";
            html += "<p>Center Name: " + newTreatment.centerName + " </p>";
            html += "<p>Doctor Name: " + newTreatment.newDoctor.Name + " </p>";
            html += "<p>Treatment Date: " + newTreatment.TreatmentDate + " </p>";
            html += "<p>Observation: " + newTreatment.Observation + " </p>";

            string prescription = GetPrescritption(newTreatment, number);
            html += prescription + "</div>";
            return html;
        }
Ejemplo n.º 6
0
 public ActionResult UpdateTreatment(Treatment model, int id)
 {
     try
     {
         using (DB50Entities db = new DB50Entities())
         {
             db.Treatments.Find(id).TreatmentName = model.TreatmentName;
             db.Treatments.Find(id).Detail        = model.Detail;
             db.SaveChanges();
         }
         return(View("~/Views/Disease/AddDisease.cshtml"));
     }
     catch
     {
         return(View());
     }
 }
Ejemplo n.º 7
0
        // GET: Treatments/Details/5
        public ActionResult Details(int?id)
        {
            string username = User.Identity.Name;
            string userid   = ((ClaimsPrincipal)User).Claims?.Where(c => c.Type == ClaimTypes.GroupSid).FirstOrDefault()?.Value ?? "";

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Treatment treatment = db.Treatment.Find(id);

            if (treatment == null)
            {
                return(HttpNotFound());
            }
            return(View(treatment));
        }
Ejemplo n.º 8
0
        public IList <Treatment> GetAll()
        {
            var treatmentEntities = treatmentRepository.GetList();
            var treatments        = new List <Treatment>();

            if (treatmentEntities.Any())
            {
                foreach (var treatmentEntity in treatmentEntities)
                {
                    var treatment = new Treatment();
                    treatmentMapper.MapFromEntity(treatmentEntity, treatment);
                    treatments.Add(treatment);
                }
            }

            return(treatments);
        }
Ejemplo n.º 9
0
        public async Task <int> CreateTreatmentAsync(
            string ownerId,
            string creatorId,
            DateTime dateOfTreatment,
            string name,
            string note,
            string disease,
            string medication,
            InputAs inputAs,
            double quantity,
            Dose dose,
            List <int> beehiveIds)
        {
            var treatment = new Treatment
            {
                CreatorId       = creatorId,
                OwnerId         = ownerId,
                DateOfTreatment = dateOfTreatment,
                Name            = name,
                Note            = note,
                Disease         = disease,
                Medication      = medication,
                InputAs         = inputAs,
                Quantity        = quantity,
                Dose            = dose,
            };

            await this.treatmentRepository.AddAsync(treatment);

            await this.treatmentRepository.SaveChangesAsync();

            foreach (var id in beehiveIds)
            {
                var treatedBeehive = new TreatedBeehive
                {
                    BeehiveId   = id,
                    TreatmentId = treatment.Id,
                };

                await this.treatedBeehivesRepository.AddAsync(treatedBeehive);

                await this.treatedBeehivesRepository.SaveChangesAsync();
            }

            return(treatment.Id);
        }
        public void AddTreatmentInViewState(Treatment aTreatment)
        {
            if (ViewState["Treatment"] == null)
            {
                List <Treatment> aList = new List <Treatment>();
                aList.Add(aTreatment);

                ViewState["Treatment"] = aList;
            }
            else
            {
                List <Treatment> aList = new List <Treatment>();
                aList = (List <Treatment>)ViewState["Treatment"];
                aList.Add(aTreatment);
                ViewState["Treatment"] = aList;
            }
        }
        // GET: Treatments/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Treatment treatment = db.Treatments.Find(id);

            if (treatment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ownerId     = new SelectList(db.Owners, "ownerId", "ownerSurname", treatment.ownerId);
            ViewBag.petId       = new SelectList(db.Pets, "petId", "petName", treatment.petId);
            ViewBag.procedureId = new SelectList(db.Procedures, "procedureId", "procedureDescription", treatment.procedureId);
            return(View(treatment));
        }
Ejemplo n.º 12
0
        public int Update(Treatment model)
        {
            string query = @"UPDATE [TREATMENT]
                             SET [CREATED_DATE] = @date,
                                 [DESCRIPTION] = @description,
                                 [PRICE] = @price,
                                 [PAID] = @paid
                             WHERE [ID] = @id";

            OleDbParameter pDATE        = new OleDbParameter("@date", model.DATE);
            OleDbParameter pDESCRIPTION = new OleDbParameter("@description", model.DESCRIPTION);
            OleDbParameter pPRICE       = new OleDbParameter("@price", model.PRICE);
            OleDbParameter pPAID        = new OleDbParameter("@paid", model.PAID);
            OleDbParameter pID          = new OleDbParameter("@id", model.ID);

            return(_dbService.ExecuteNonQuery(query, pDATE, pDESCRIPTION, pPRICE, pPAID, pID));
        }
Ejemplo n.º 13
0
        public async Task <ActionResult <TreatmentViewModel> > PutTreatment(int id, Treatment treatment)
        {
            if (id != treatment.TreatmentId)
            {
                System.Console.WriteLine("Hello from Error");
                return(BadRequest());
            }

            _context.Entry(treatment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TreatmentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            var treatmentType = await _context.TreatmentTypes.FindAsync(treatment.TreatmentTypeId);

            var t = await _context.Treatments.FindAsync(id);


            var result = new TreatmentViewModel()
            {
                TreatmentId        = t.TreatmentId,
                UserId             = t.UserId,
                TreatmentCost      = t.TreatmentCost,
                CreatedAt          = t.CreatedAt,
                TreatmentImageUrl  = t.TreatmentImageUrl,
                TreatmentImageName = t.TreatmentImageName,
                PatientId          = t.PatientId,
                TreatmentName      = treatmentType.Name,
                TreatmentTypeId    = t.TreatmentTypeId
            };

            return(result);
        }
        // GET: Treatments/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Treatment treatment = db._Treatment.Find(id);

            if (treatment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PatientID         = new SelectList(db._Patient, "PatientID", "FName", treatment.PatientID);
            ViewBag.TreatmentStatusID = new SelectList(db._Treatmentstatus, "TreatmentStatusID", "Status", treatment.TreatmentStatusID);
            ViewBag.WhatsDoneID       = new SelectList(db._WhatsDone, "WhatsDoneID", "Description", treatment.WhatsDoneID);
            return(View(treatment));
        }
Ejemplo n.º 15
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Treatment = await _context.Treatment
                        .Include(t => t.Animal)
                        .Include(t => t.Medicament).FirstOrDefaultAsync(m => m.ID == id);

            if (Treatment == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 16
0
        public int GetDistrictIdByCenterId(int centerId)
        {
            string query = "SELECT district_id FROM tbl_center WHERE id = '" + centerId + "'";

            ASqlConnection.Open();
            ASqlCommand    = new SqlCommand(query, ASqlConnection);
            ASqlDataReader = ASqlCommand.ExecuteReader();
            Treatment aTreatment = new Treatment();

            while (ASqlDataReader.Read())
            {
                aTreatment.DistrictId = (int)ASqlDataReader["district_id"];
            }
            ASqlDataReader.Close();
            ASqlConnection.Close();
            return(aTreatment.DistrictId);
        }
Ejemplo n.º 17
0
        // GET: LabProducts/Create
        public async Task <ActionResult> Create(int id)
        {
            Treatment treatment = await db.Treatments.FindAsync(id);

            // Patient patient = await db.Patients.FindAsync(treatment.PatientID);
            LabProduct           labproduct           = new LabProduct();
            LabproductsViewModel labproductsviewModel = new LabproductsViewModel();

            labproductsviewModel.Labproducts = labproduct;

            labproductsviewModel.Labproducts.TreatmentID = treatment.TreatmentID;
            //labproductsviewModel.Patients = patient;
            labproductsviewModel.Treatments = treatment;


            return(View(labproductsviewModel));
        }
        public void PostTreatment()
        {
            // Arrange
            TreatmentController controller = new TreatmentController();

            Treatment TreatmentObj = new Treatment
            {
                TreatmentName = "Third",
            };
            var actResult = controller.Post(TreatmentObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <Treatment>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID > 0);
        }
Ejemplo n.º 19
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Treatment = await _context.Treatment.FindAsync(id);

            if (Treatment != null)
            {
                _context.Treatment.Remove(Treatment);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// <para>
        /// Validate that the GUIDs in the <see cref="Treatment"/> instance that refer to the
        /// energized and finger image sets match the GUIDs in the corresponding <see cref="ImageSetBlob"/>
        /// instances that containing the image sets.
        /// An exception will be thrown if the GUIDs do not match as expected.
        /// If they match, the method simply returns.
        /// </para><para>
        /// The finger image set is optional.
        /// If there is no finger image set, both the input <code>ImageSetBlob</code> for the finger
        /// image set and the corresponding GUID in the <code>Treatment</code> must be null.
        /// </para>
        /// </summary>
        /// <param name="treatment">a <see cref="Treatment"/> instance that contains all the properties
        ///		that define the treatment</param>
        /// <param name="energizedImageSet">an <see cref="ImageSetBlob"/> that contains the images of the
        ///		energized image set and the GUID that identifies the set</param>
        /// <param name="fingerImageSet">an <see cref="ImageSetBlob"/> that contains the images of the
        ///		finger image set and the GUID that identifies the set</param>
        /// <exception cref="InvalidArgumentException">if either of the sets of GUIDs do not match as
        ///		required</exception>
        private static void ValidateGuids(Treatment treatment, ImageSetBlob energizedImageSet, ImageSetBlob fingerImageSet)
        {
            if (treatment.EnergizedImageSetGuid != energizedImageSet.Guid)
            {
                throw new InvalidArgumentException("Two GUIDs for the energized image set do not match");
            }

            if (fingerImageSet == null && treatment.FingerImageSetGuid == null)
            {
                return;
            }

            if (fingerImageSet == null || treatment.FingerImageSetGuid != fingerImageSet.Guid)
            {
                throw new InvalidArgumentException("Two GUIDs for the finger image set do not match");
            }
        }
Ejemplo n.º 21
0
        protected void showButton_Click(object sender, EventArgs e)
        {
            Patient aPatient = new Patient();

            aPatient.VoterId = nationalIdTextBox.Text;
            GetPatientInformation(aPatient.VoterId);
            aPatient.Id           = patientManager.GetPatientId(aPatient);
            aPatient.ServiceTimes = patientManager.GetServiceTimes(aPatient);
            if (aPatient.ServiceTimes < 1)
            {
                megLabel.Text     = "Didn't take any treatment!";
                pdfButton.Visible = false;
            }
            else
            {
                int count = 0;
                List <Treatment> ObservationList = treatmentManager.GetObservationList(aPatient);
                foreach (var observation in ObservationList)
                {
                    count++;
                    string           centerName     = centerManager.GetCenterName(observation.CenterId);
                    string           Date           = observation.Date;
                    string           DoctorName     = doctorManager.GetDoctorName(observation.DoctorId);
                    string           Observation    = observation.Observation;
                    List <Treatment> treatmentList  = treatmentManager.GetTreatmentList(observation.ObservationId);
                    List <Treatment> aTreatmentList = new List <Treatment>();
                    foreach (var treatment in treatmentList)
                    {
                        string    diseaseName  = diseaseManager.GetDiseaseName(treatment.DiseaseId);
                        string    medicineName = medicineManager.GetMedicineName(treatment.MedicineId);
                        Treatment aTreatment   = new Treatment();
                        aTreatment.NameOfDisease  = diseaseName;
                        aTreatment.NameOfMedicine = medicineName;
                        aTreatment.Dose           = treatment.Dose;
                        aTreatment.TakenTime      = treatment.TakenTime;
                        aTreatment.Quantity       = treatment.Quantity;
                        aTreatment.Note           = treatment.Note;

                        aTreatmentList.Add(aTreatment);
                    }
                    ShowAllTreatment(centerName, Date, DoctorName, Observation, count, aTreatmentList);
                }
                pdfButton.Visible = true;
            }
        }
Ejemplo n.º 22
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (Identifier != null)
            {
                result.AddRange(Identifier.Validate());
            }
            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (Source != null)
            {
                Source.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (AccessionIdentifier != null)
            {
                AccessionIdentifier.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (ReceivedTimeElement != null)
            {
                result.AddRange(ReceivedTimeElement.Validate());
            }
            if (Collection != null)
            {
                result.AddRange(Collection.Validate());
            }
            if (Treatment != null)
            {
                Treatment.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Container != null)
            {
                Container.ForEach(elem => result.AddRange(elem.Validate()));
            }

            return(result);
        }
Ejemplo n.º 23
0
        private void FillItemList(Item item, Prescription prescription, Treatment treatment, int amount = -1)
        {
            SaleItemForm saleItemForm = new SaleItemForm(item, prescription, treatment, amount);

            if (saleItemForm.ShowDialog() == DialogResult.OK)
            {
                SaleLineItem saleLineItem = saleItemForm.saleLineItem;

                if (sale == null)
                {
                    sale = SaleFactory.Instance().CreateSale(customer, DateTime.Now);
                }

                sale.AddSaleLineItem(saleLineItem);
                LoadeItemList();
                EndButton.Enabled = true;
            }
        }
Ejemplo n.º 24
0
        public ActionResult Edit(int id, Treatment collection)
        {
            try
            {
                // TODO: Add update logic here
                collection.Id        = id;
                collection.Updated   = DateTime.Now;
                collection.UpdatedBy = User.Identity.Name;

                _context.Entry(collection).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
                return(RedirectToAction("Index", new { id = collection.PatientId }));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(Treatment t, State s)
        {
            t.OutgoingState = s;
            mapper.CreateTreatment(t);//            <-
            Step step = mapper.GetStep(t.StepId);

            TempData["SelectedStep"] = step;


            Process p = mapper.GetProcess(step.Process_Id);

            TempData["process"] = p;
            if (t.OutgoingState.Final)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(RedirectToAction("Create", p));
        }
Ejemplo n.º 26
0
        public static Treatment GetTreatment(int riskId)
        {
            Treatment treatment = new Treatment();

            try
            {
                treatment = TreatmentDAO.getInstance().GetTreatment(riskId);

                User user = UserDAO.getInstance().GetUserById(treatment.PERSON_IN_CHARGE);

                treatment.PERSON_IN_CHARGE_NAME = user.FULL_NAME;
            }
            catch (Exception ex)
            {
                treatment = new Treatment();
            }
            return(treatment);
        }
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            //make a treatment

            treatment = new Treatment();
            treatment.Id = db.getTreatmentNewId(App.patient.Id);//generated: patient+sequence
            treatment.Patient = App.patient;
            treatment.Dentist = App.user.Dentist;
            treatment.Phase = new Phase();// Smile.SCANNING;
            treatment.Room = "R212";//Setting Default Room
            treatment.TreatmentDate = DateTime.Now;
            treatment.TreatmentTime = DateTime.Now.ToString(Smile.TIME_FORMAT);

            if (db.InsertTreatment(treatment))
            {
                MessageBox.Show("Success inserted");
            }
        }
Ejemplo n.º 28
0
        private List <string> DecimalNumber(Treatment treatment)
        {
            Number integerNumber = new IntegerNumber("Decimal");
            Number decimalNumber = new DecimalNumber("Decimal");

            try
            {
                integerNumber.Translate(treatment);
                decimalNumber.Translate(treatment);
            }
            catch (InvalidNumber ex)
            {
                return(new List <string> {
                    "Error", ex.Message
                });
            }
            return(CheckDecimalNumber(integerNumber, decimalNumber));
        }
Ejemplo n.º 29
0
        public void AddNewTreatment(Treatment treatment)
        {
            //local
            //Keep count for Sychronization
            long number = sqlite.AddNewTreatment(treatment.Name, treatment.Price);

            DAOCount++;
            sqlite.UpdateCountRecordSQlite(DAOCount);

            //firease
            if (!IsWorkOffline)
            {
                FBCount++;
                firebaseDAO.UpdateCountRecordFB(FBCount);
                treatment.ID = (int)number;
                firebaseDAO.AddNewTreatment(treatment);
            }
        }
Ejemplo n.º 30
0
        public bool updateTreatmentList(IEnumerable <TreatmentPresntViewModel> treatmentList)
        {
            // enhance
            int count = 0;

            using (Entities.Entities ctx = new Entities.Entities())
            {
                foreach (var item in treatmentList)
                {
                    Treatment treatment = ctx.Treatments.Find(item.TeratmentID);
                    treatment.Description   = item.Description;
                    treatment.TeratmentCost = item.TeratmentCost;

                    count += ctx.SaveChanges();
                }
            }
            return(count > 0 ? true : false);
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Writes the allergic episode data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the allergic episode data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="ThingSerializationException">
        /// If <see cref="Name"/> has an <b>null</b> Text property.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfArgumentNull(writer, nameof(writer), Resources.WriteXmlNullWriter);
            Validator.ThrowSerializationIfNull(_name.Text, Resources.AllergyNameMandatory);

            // <allergic-episode>
            writer.WriteStartElement("allergic-episode");

            _when.WriteXml("when", writer);
            _name.WriteXml("name", writer);

            Reaction?.WriteXml("reaction", writer);

            Treatment?.WriteXml("treatment", writer);

            // </allergic-episode>
            writer.WriteEndElement();
        }
        public ActionResult Edit([Bind(Include = "TreatmentID,PatientID,CheckupDate,Symptoms,Diagnosis,Medicine,Doses,BeforeMeal,Advice")] Treatment treatment, FormCollection fc)
        {
            //if (ModelState.IsValid)
            //{
            treatment.Doses      = fc["Doses"];
            treatment.BeforeMeal = fc["RbBeforeMeal"];
            List <Patient> patient = db.Patients.ToList();
            var            result  = patient.Where(x => x.PatientID.Equals(treatment.PatientID)).Select(x => x.DoctorID);
            var            DocId   = result.ToList();

            db.Entry(treatment).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("ExistingPatientReport", "Patients", new { id = treatment.PatientID, Did = DocId[0], l = 1 }));
            //}

            //ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "FirstName", treatment.PatientID);
            //return View(treatment);
        }
Ejemplo n.º 33
0
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            //make a treatment

            treatment               = new Treatment();
            treatment.Id            = db.getTreatmentNewId(App.patient.Id);//generated: patient+sequence
            treatment.Patient       = App.patient;
            treatment.Dentist       = App.user.Dentist;
            treatment.Phase         = new Phase(); // Smile.SCANNING;
            treatment.Room          = "R212";      //Setting Default Room
            treatment.TreatmentDate = DateTime.Now;
            treatment.TreatmentTime = DateTime.Now.ToString(Smile.TIME_FORMAT);

            if (db.InsertTreatment(treatment))
            {
                MessageBox.Show("Success inserted");
            }
        }
        public void Delete(Treatment treatment)
        {
            Treatment result = context.Treatments.FirstOrDefault(e => e.Id == treatment.Id);

            if (result != null)
            {
                context.MedicalRecordEntries.Attach(treatment.MedicalRecordEntry);
                context.MedicalRecordEntries.Attach(result.MedicalRecordEntry);

                if (result.MedicalRecordEntry.Patient != null)
                {
                    context.Entry(result.MedicalRecordEntry.Patient).State = System.Data.Entity.EntityState.Detached;
                }

                context.Treatments.Remove(result);
                context.SaveChanges();
            }
        }
 public string GetPrescritption(Treatment newTreatment, int number)
 {
     string code = "<div><table cellspacing=\"0\" cellpadding=\"4\" style=\"color:#333333;width:802px;border-collapse:collapse;\"><tbody><tr style=\"color:White;background-color:#5D7B9D;font-weight:bold;\"><th >Disease</th><th >Medicine</th><th>Dose</th><th>Before/After Meal</th><th>Quantity</th><th>Note</th></tr>";
     List<Prescription> newPrescriptions = aCenterManager.NewPrescriptions(newTreatment);
     foreach (Prescription prescription in newPrescriptions)
     {
         code += "<tr>";
         code += "<td> " + prescription.DiseaseName + " </td>";
         code += "<td> " + prescription.MedicineName + " </td>";
         code += "<td> " + prescription.Dose + " </td>";
         code += "<td> " + prescription.mealTime + " </td>";
         code += "<td> " + prescription.Quantity + " </td>";
         code += "<td> " + prescription.Note + " </td>";
         code += "</tr>";
     }
     code += "</tbody></table></div>";
     return code;
 }
Ejemplo n.º 36
0
        private List <string> FractionalNumber(Treatment treatment)
        {
            Number integerNumber = new IntegerNumber("Fractional");
            Number fractional    = new Fractional("Fractional");

            try
            {
                integerNumber.Translate(treatment);
                fractional.Translate(treatment);
            }
            catch (InvalidNumber ex)
            {
                return(new List <string> {
                    "Error", ex.Message
                });
            }
            return(CheckNegativeNumber(integerNumber, fractional));
        }
Ejemplo n.º 37
0
        public ActionResult PatientReportSummary(int?id, int?l)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            Treatment tt = db.Treatments.Find(id);

            if (tt == null)
            {
                return(HttpNotFound());
            }
            else
            {
                ViewBag.layout = l;
                return(View(GetPatientList(id)));
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (phaseCombo.SelectedValue != null)
            {
                Treatment d = new Treatment();
                d.Phase = phases.ElementAt(phaseCombo.SelectedIndex);
                d.Patient = App.patient;
                d.Dentist = App.user.Dentist;
                d.Room = roomTextBox.Text.ToLower();
                d.TreatmentDate = DateTime.Now;
                d.TreatmentTime = DateTime.Now.ToString(Smile.TIME_FORMAT);

                if (db.InsertTreatment(d))
                {
                    if(!txtResumeMedic.Text.Equals(string.Empty) || !txtRemarks.Text.Equals(string.Empty)){
                        db.insertTreatmentNotes(d, txtResumeMedic.Text, null, txtRemarks.Text);
                    }
                    MessageBox.Show("Success inserted");
                    clear();
                }
            }
        }
        public void showPrescription()
        {
            if (!result)
            {
                GetJSONdata();
            }
            Treatment aTreatment = new Treatment();
            aTreatment.VoterID = voterIdTextBox.Text;

            List<Treatment> treatment = aCenterManager.GetTreatmentList(aTreatment.VoterID);
            ViewState["Treatment"] = treatment;
            int count = 1;
            foreach (Treatment aNewTreatment in treatment)
            {
                mainHtml += GetTreatment(count, aNewTreatment);
                count++;

            }
            Content.InnerHtml = mainHtml;
        }
        protected void BtnCompleted_Click(object sender, EventArgs e)
        {
            try
            {
                const ConsentType consentType = ConsentType.Endoscopy;

                //validation
                var lblError = DeclarationSignatures.LblError;

                lblError.Text = string.Empty;

                var doctorsAndProcedures = DoctorsAndProcedures1.GetDoctorsAndProcedures().ToArray();

                if (doctorsAndProcedures.Length == 0)
                    lblError.Text += "<br /> Please select physicians and procedures.";

                DeclarationSignatures.ValidateForm();

                if (string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign1.ToString()]) ||
                   string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign2.ToString()]) ||
                   string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign3.ToString()]) ||
                   string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign4.ToString()]) ||
                   string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign5.ToString()]))
                {
                    lblError.Text += "Please input signatures.";
                }

                if (!string.IsNullOrEmpty(lblError.Text))
                    return;

                string patientId;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    if (string.IsNullOrEmpty(HdnPatientId.Value))
                    {
                        Response.Redirect("/PatientConsent.aspx");
                        return;
                    }
                    patientId = HdnPatientId.Value;
                    Session["PatientID"] = patientId;
                }

                string location;
                try
                {
                    location = Session["Location"].ToString();
                }
                catch (Exception)
                {
                    if (string.IsNullOrEmpty(HdnPatientId.Value))
                    {
                        Response.Redirect("/PatientConsent.aspx");
                        return;
                    }
                    location = HdnLocation.Value;
                    Session["Location"] = location;
                }

                string ip = Request.ServerVariables["REMOTE_ADDR"];
                string device;
                if (Request.Browser.IsMobileDevice)
                    device = Request.Browser.Browser + " " + Request.Browser.Version;
                else
                    device = Request.Browser.Browser + " " + Request.Browser.Version;

                var signatureses = new List<Signatures>();

                if (Request.Form[SignatureType.DoctorSign1.ToString()] != null)
                {
                    var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign1.ToString()]);
                    signatureses.Add(new Signatures
                    {
                        _name = string.Empty,
                        _signatureContent = Encoding.ASCII.GetString(bytes),
                        _signatureType = SignatureType.DoctorSign1
                    });
                }

                if (Request.Form[SignatureType.DoctorSign2.ToString()] != null)
                {
                    var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign2.ToString()]);
                    signatureses.Add(new Signatures
                    {
                        _name = string.Empty,
                        _signatureContent = Encoding.ASCII.GetString(bytes),
                        _signatureType = SignatureType.DoctorSign2
                    });
                }

                if (Request.Form[SignatureType.DoctorSign3.ToString()] != null)
                {
                    var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign3.ToString()]);
                    signatureses.Add(new Signatures
                    {
                        _name = string.Empty,
                        _signatureContent = Encoding.ASCII.GetString(bytes),
                        _signatureType = SignatureType.DoctorSign3
                    });
                }

                if (Request.Form[SignatureType.DoctorSign4.ToString()] != null)
                {
                    var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign4.ToString()]);
                    signatureses.Add(new Signatures
                    {
                        _name = string.Empty,
                        _signatureContent = Encoding.ASCII.GetString(bytes),
                        _signatureType = SignatureType.DoctorSign4
                    });
                }

                if (Request.Form[SignatureType.DoctorSign5.ToString()] != null)
                {
                    var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign5.ToString()]);
                    signatureses.Add(new Signatures
                    {
                        _name = string.Empty,
                        _signatureContent = Encoding.ASCII.GetString(bytes),
                        _signatureType = SignatureType.DoctorSign5
                    });
                }

                signatureses.AddRange(DeclarationSignatures.GetSignatures());

                string empID = string.Empty;
                if (Session["EmpID"] != null)
                    empID = Session["EmpID"].ToString();

                var treatment = new Treatment
                {
                    _patientId = patientId,
                    _consentType = consentType,
                    _signatureses = signatureses.ToArray(),
                    _isPatientUnableSign = DeclarationSignatures.ChkPatientisUnableToSign.Checked,
                    _unableToSignReason = DeclarationSignatures.TxtPatientNotSignedBecause.Text,
                    _translatedBy = DeclarationSignatures.TxtTranslatedBy.Text,
                    _trackingInformation = new TrackingInformation
                    {
                        _device = device,
                        _iP = ip
                    },
                    _doctorAndPrcedures = doctorsAndProcedures,
                    _empID = empID
                };

                if (treatment._doctorAndPrcedures.GetUpperBound(0) < 0)
                {
                    lblError.Text += "Please input procedures.";
                    return;
                }

                var formHandlerServiceClient = Utilities.GetConsentFormSvcClient();
                formHandlerServiceClient.AddTreatment(treatment);
                Utilities.GeneratePdfAndUploadToSharePointSite(formHandlerServiceClient, consentType, patientId, Request, Session["Location"].ToString());
                try
                {
                    Response.Redirect(Utilities.GetNextFormUrl(consentType, Session));
                }
                catch (Exception)
                {
                    Response.Redirect("/PatientConsent.aspx");
                }
            }
            catch (Exception ex)
            {
                var client = Utilities.GetConsentFormSvcClient();
                client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(),
                                 ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Ejemplo n.º 41
0
        //INTEGRATION
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, Treatment treatment, SmileFile file, bool duplicate, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            //FileExportCommand = new DelegateCommand(FileExport);
            FileExportCommand = new DelegateCommand(ConfirmDirectFileExport);            
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            

            
            ApplicationTitle = "Dental Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            this.window = window;
            RootVisual = window.vmodel;
            
            handleManipulationData(treatment, file, duplicate);
            
            //JawVisual = new JawVisual3D(Patient);
            //RootVisual.Children.Add(JawVisual);
        }
 private void insertTreatment(int p)
 {
     Treatment t = new Treatment();
     t.Phase = Smile.GetPhase(p);
     t.Patient = App.patient;
     t.Room = Smile.Room;
     t.Dentist = App.user.Dentist;
     DB.InsertTreatment(t);
 }
Ejemplo n.º 43
0
        //INTEGRATION with Dashboard
        public MainWindow(Treatment treatment, SmileFile file, bool duplicate)
        {
            InitializeComponent();

            //app = Application.Current as App;

            if (App.patient == null)
            {
                MessageBox.Show("Select Patient First!");
                //show PatientForm
                this.Close();
                return;
            }
            if (file == null)
            {
                MessageBox.Show("Select Raw File !");
                //show File List
                this.Close();
                return;
            }

            vm = new MainViewModel(new FileDialogService(), view1, treatment, file, duplicate, this);
            DataContext = vm;

            loadTeethNumberToChart();

            Loaded += new RoutedEventHandler(OnLoaded);
            _propertyGrid.PropertyValueChanged += new Xceed.Wpf.Toolkit.PropertyGrid.PropertyValueChangedEventHandler(_propertyGrid_PropertyValueChanged);

            mForm = new Forms.MeasurementForm(treatment,file, this);
            navigateButton("integration");
        }
Ejemplo n.º 44
0
//        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, ModelVisual3D rootModel)
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            FileExportCommand = new DelegateCommand(FileExport);
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            


            ApplicationTitle = "Dental.Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            DB = DentalSmileDBFactory.GetInstance();
            Treatment = new Treatment();
            SmileFile = new SmileFile();
            Patient = new Patient();
            JawVisual = new JawVisual3D(Patient);
            RootVisual = window.vmodel;
            app = Application.Current as App;

            RootVisual.Children.Add(JawVisual);
            this.window = window;

        }
Ejemplo n.º 45
0
        internal bool insertTreatmentNotes(Treatment treatment, string resume, SmileFile file, string description)
        {
            if (this.OpenConnection() == true)
            {
                string tableName = "treatment_notes";
                string columns = "(treatment, notes, pfile, description, created, createdBy)";
                string values = "";
                values = "('" + treatment.Id + "','" + resume + "','" + (file == null ? null : file.Id) + "','" + description + "','" + DateTime.Now.ToString(Smile.LONG_DATE_FORMAT) + "','" + User + "')";
                string query = "INSERT INTO " + tableName + " " + columns + " values " + values + " ;";

                IDbCommand cmd = getSqlCommand(query, connection);
                cmd.ExecuteNonQuery();

                this.CloseConnection();

                return true;
            }
            return false;
        }
        public bool TreatmentGivenSave(Treatment treatmentDetails, List<Prescription> treatmentList)
        {
            aCenterGateway.TreatmentGivenSave(treatmentDetails);
            int treatmentID = aCenterGateway.GetTreatmentID(treatmentDetails);

            foreach (Prescription aTreatment in treatmentList)
            {

                aCenterGateway.SavePrescription(aTreatment, treatmentID);

                int medicineQuantity = aCenterGateway.GetQuantity(aTreatment.MedicineID, treatmentDetails.CenterID);
                medicineQuantity = (medicineQuantity - aTreatment.Quantity);
                aCenterGateway.UpdateQuantity(aTreatment.MedicineID, treatmentDetails.CenterID,
                    medicineQuantity);
            }
            return true;
        }
Ejemplo n.º 47
0
 public Bill GiveBill(Treatment appoitment)
 {
     return new Bill();
 }
        protected void BtnCompleted_Click(object sender, EventArgs e)
        {
            try
            {
                //validation

                const ConsentType consentType = ConsentType.PICC;

                DeclarationSignatures.LblError.Text = string.Empty;

                DeclarationSignatures.ValidateForm();

                if (!string.IsNullOrEmpty(DeclarationSignatures.LblError.Text))
                    return;

                string patientId;
                try
                {
                    patientId = Session["PatientID"].ToString();
                }
                catch (Exception)
                {
                    if (string.IsNullOrEmpty(HdnPatientId.Value))
                    {
                        Response.Redirect("/PatientConsent.aspx");
                        return;
                    }
                    patientId = HdnPatientId.Value;
                    Session["PatientID"] = patientId;
                }

                string location;
                try
                {
                    location = Session["Location"].ToString();
                }
                catch (Exception)
                {
                    if (string.IsNullOrEmpty(HdnPatientId.Value))
                    {
                        Response.Redirect("/PatientConsent.aspx");
                        return;
                    }
                    location = HdnLocation.Value;
                    Session["Location"] = location;
                }

                string ip = Request.ServerVariables["REMOTE_ADDR"];
                string device;
                if (Request.Browser.IsMobileDevice)
                    device = Request.Browser.Browser + " " + Request.Browser.Version;
                else
                    device = Request.Browser.Browser + " " + Request.Browser.Version;

                var signatureses = new List<Signatures>();

                signatureses.AddRange(DeclarationSignatures.GetSignatures());

                string empID = string.Empty;
                if (Session["EmpID"] != null)
                    empID = Session["EmpID"].ToString();

                var treatment = new Treatment
                {
                    _patientId = patientId,
                    _consentType = consentType,
                    _signatureses = signatureses.ToArray(),
                    _isPatientUnableSign = DeclarationSignatures.ChkPatientisUnableToSign.Checked,
                    _unableToSignReason = DeclarationSignatures.TxtPatientNotSignedBecause.Text,
                    _translatedBy = DeclarationSignatures.TxtTranslatedBy.Text,
                    _trackingInformation = new TrackingInformation
                    {
                        _device = device,
                        _iP = ip
                    },
                    _empID = empID
                };

                var formHandlerServiceClient = Utilities.GetConsentFormSvcClient();
                formHandlerServiceClient.AddTreatment(treatment);
                Utilities.GeneratePdfAndUploadToSharePointSite(formHandlerServiceClient, consentType, patientId, Request, location);
                try
                {
                    Response.Redirect("/PatientConsent.aspx");
                }
                catch (Exception)
                {
                }
            }
            catch (Exception ex)
            {
                var client = Utilities.GetConsentFormSvcClient();
                client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(),
                                 ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Ejemplo n.º 49
0
        public bool insertTreatmentFiles(Treatment treatment, SmileFile file)
        {
            string tableName = "treatment_pfile";
            string columns = "(treatment, pfile)";
            string values = "('" + treatment.Id + "','" + file.Id+ "')";
            string query = "INSERT INTO " + tableName + " " + columns + " values " + values + " ;";

            if (this.OpenConnection() == true)
            {
                IDbCommand cmd = getSqlCommand(query, connection);
                cmd.ExecuteNonQuery();
                this.CloseConnection();

                return true;
            }
            return false;
        }
 public int TreatmentGivenSave(Treatment aTreatment)
 {
     string query = "insert into Treatment_tbl(CenterID,voterID,DoctorID,TreatmentDate,Observation) values('" + aTreatment.CenterID + "','" + aTreatment.VoterID + "','" + aTreatment.DoctorID + "','" + aTreatment.TreatmentDate + "','" + aTreatment.Observation + "')";
     aGateway.sqlConnection.Open();
     aGateway.command.CommandText = query;
     int rowAffected = aGateway.command.ExecuteNonQuery();
     aGateway.sqlConnection.Close();
     return rowAffected;
 }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            List<Prescription> treatmentList = (List<Prescription>)ViewState["TreatmentGiven"];
            Treatment newTreatment = new Treatment();
            newTreatment.VoterID = voterIdTextBox.Text;
            newTreatment.CenterID = newCenter.ID;
            newTreatment.DoctorID = int.Parse(doctorDropDownList.SelectedItem.Value);
            newTreatment.TreatmentDate = treatmentDate.SelectedDate.ToString("d");
            newTreatment.Observation = observationTextBox.Text;
            if (aCenterManager.TreatmentGivenSave(newTreatment, treatmentList))
            {

                labelNotification.Text = "save successfully";
                labelNotification.ForeColor = Color.Green;

            }
        }
Ejemplo n.º 52
0
        public void UpdateTreatment(Treatment t)
        {
            string tableName = "treatment";
            string setColumns = "phase =" + t.Phase.Id + ", dentist='" + t.Dentist.UserId + "', patient='" + t.Patient.Id + "', tdate='" + t.TreatmentDate.ToString(Smile.DATE_FORMAT) + "', ttime='" + t.TreatmentTime + "',room='" + t.Room + "',refid='" + t.RefId+ "', modified='" + DateTime.Now.ToString(Smile.LONG_DATE_FORMAT) + "', modifiedBy='" + User + "' ";
            string query = "UPDATE " + tableName + " SET " + setColumns + " WHERE id = '" + t.Id + "'";

            if (this.OpenConnection() == true)
            {
                IDbCommand cmd = getSqlCommand(query, connection);
                cmd.ExecuteNonQuery();
                this.CloseConnection();
            }
        }
Ejemplo n.º 53
0
        private Treatment toTreatment(IDataReader dataReader)
        {
            Treatment p = new Treatment();

            p.Id = GetStringSafe(dataReader, "id");
            p.Room = GetStringSafe(dataReader, "room");
            p.TreatmentDate = dataReader.GetDateTime(dataReader.GetOrdinal("tdate"));
            p.TreatmentTime = GetStringSafe(dataReader, "ttime");
            p.RefId = GetStringSafe(dataReader, "refid");

            p.Patient = findPatientById(GetStringSafe(dataReader, "patient"));
            p.Phase = findPhaseById(dataReader.GetInt32(dataReader.GetOrdinal("phase")));
            //p.Phase = Smile.GetPhase(dataReader.GetInt32("phase"));
            p.Dentist = findDentistByUserId(GetStringSafe(dataReader, "dentist"));

            p.Files = findSmileFilesByTreatmentId(p.Id);
            return p;
        }
        public List<Treatment> GetTreatmentList(string voterId)
        {
            aGateway.command.CommandText = "SELECT * FROM Treatment_tbl WHERE VoterID='" + voterId + "'";
            List<Treatment> treatmentList=new List<Treatment>();
            aGateway.sqlConnection.Open();
            SqlDataReader reader = aGateway.command.ExecuteReader();
            while (reader.Read())
            {
                Treatment newTreatment = new Treatment();
                newTreatment.ID = int.Parse(reader["ID"].ToString());
                newTreatment.CenterID = int.Parse(reader["CenterID"].ToString());
                newTreatment.DoctorID = int.Parse(reader["DoctorID"].ToString());
                newTreatment.Observation = reader["Observation"].ToString();
                newTreatment.TreatmentDate = reader["TreatmentDate"].ToString();
                treatmentList.Add(newTreatment);

            }

            reader.Close();
            aGateway.sqlConnection.Close();
            return treatmentList;
        }
Ejemplo n.º 55
0
        public bool InsertTreatment(Treatment t)
        {
            if (t.Id == null)
                t.Id = getTreatmentNewId(t.Patient.Id);
            string tableName = "treatment";
            string columns = "(id, phase, dentist, patient, tdate, ttime, room, refid, created,createdBy)";
            string values = "('" + t.Id + "'," + t.Phase.Id + ",'" + t.Dentist.UserId + "','" + t.Patient.Id + "','" + t.TreatmentDate.ToString(Smile.DATE_FORMAT) + "','" + t.TreatmentTime + "','" + t.Room + "','"  + t.RefId+ "','" + DateTime.Now.ToString(Smile.LONG_DATE_FORMAT) + "','" + User + "')";
            string query = "INSERT INTO " + tableName + " " + columns + " values " + values + " ;";

            if (this.OpenConnection() == true)
            {
                IDbCommand cmd = getSqlCommand(query, connection);
                cmd.ExecuteNonQuery();
                this.CloseConnection();
                return true;
            }
            return false;
        }
Ejemplo n.º 56
0
        internal bool Insert(Treatment entry)
        {
            // Create the query to send to the database
            string query = string.Format("INSERT INTO treatments VALUES('{0}', '{1}', {2}, {3});", entry.treatmentTitle, entry.treatmentDescription,  entry.dateEntered, entry.id);

            Console.WriteLine(query);

            // SendNonQuery returns a boolean, so we can check if it was successful
            return SendNonQuery(query);
        }
        public int GetTreatmentID(Treatment aTreatment)
        {
            aGateway.command.CommandText = "SELECT * FROM Treatment_tbl WHERE CenterID='"+aTreatment.CenterID+"' AND VoterID='"+aTreatment.VoterID+"' AND TreatmentDate='"+aTreatment.TreatmentDate+"'";
            aGateway.sqlConnection.Open();
            SqlDataReader reader = aGateway.command.ExecuteReader();
            int id=0;
            while (reader.Read())
            {
                id =int.Parse(reader["ID"].ToString());
                break;

            }
            reader.Close();
            ;
            aGateway.sqlConnection.Close();
            return id;
        }
        public List<Prescription> GetPrescription(Treatment treatment)
        {
            aGateway.command.CommandText = "SELECT * FROM Prescription_tbl WHERE TreatmentID='" + treatment.ID + "'";
            aGateway.sqlConnection.Open();
            SqlDataReader reader = aGateway.command.ExecuteReader();
            List<Prescription> newPrescriptions=new List<Prescription>();

            while (reader.Read())
            {
                Prescription aPrescription=new Prescription();

                aPrescription.MedicineID= int.Parse(reader["MedicineID"].ToString());
                aPrescription.DiseaseID = int.Parse(reader["DiseaseID"].ToString());
                aPrescription.Dose = reader["Dose"].ToString();
                aPrescription.Quantity = int.Parse(reader["Quantity"].ToString());
                aPrescription.mealTime = reader["MealTime"].ToString();
                aPrescription.Note = reader["Note"].ToString();
                newPrescriptions.Add(aPrescription);

            }
            reader.Close();
            aGateway.sqlConnection.Close();
            return newPrescriptions;
        }
Ejemplo n.º 59
0
        private void handleManipulationData(Treatment treatment, SmileFile file, bool duplicate)
        {
            DB = DentalSmileDBFactory.GetInstance();
            app = Application.Current as App;
            if (App.patient == null) App.patient = new Patient();
            Patient = App.patient;

            if (treatment == null)
            {
                Treatment = new Treatment();
            }
            else
            {
                Treatment = treatment;
                if (duplicate)
                {
                    Treatment.Id = null;
                }
                Treatment.RefId = treatment.Id;
            }
            //if (file != null) SmileFile = file;

            if (file.Type == Smile.MANIPULATION)
            {
                //Load Jaw
                LoadJawFile(file.GetFile);
            }
            else if (file.Type == Smile.SCANNING)
            {
                //Load Raw
                LoadRawFile(file.GetFile);
            }

            SmileFile = new SmileFile();
            SmileFile.RefId = file.Id;

            ViewZoomExtents();
        }