示例#1
0
 public ReceiptInformation(PatientVisit visit, ObservableCollection <Medicine> medList,
                           ObservableCollection <Service> serviceList, double totalPayment)
 {
     this.visit        = visit;
     this.medList      = medList;
     this.serviceList  = serviceList;
     this.totalPayment = totalPayment;
 }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            thisVisit = (PatientVisit)e.Parameter;

            changeComponentVisibility();

            getDetails();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            thisVisit = (PatientVisit)e.Parameter;

            getVisitDetails(thisVisit);
            getVisitMeds(thisVisit);
            getVisitServices(thisVisit);
            getDocumentsList(thisVisit);
            getPhotosList(thisVisit);

            checkIfAssessmentExists();
        }
示例#4
0
        // CREATE VISIT
        private PatientVisit createPatientVisit(Appointment appointment, string incomeId)
        {
            string nextPatientVisitId = IDManager.getNextPatientVisitId();

            string       patientId = appointment.patientId;
            string       date      = appointment.date;
            string       time      = appointment.time;
            string       type      = appointment.type;
            PatientVisit visit     = new PatientVisit(nextPatientVisitId, patientId, date, time, TxtNotes.Text, incomeId,
                                                      TxtAfterOpening.Text, TxtActionsTaken.Text, TxtBeforeClosing.Text, type);

            return(visit);
        }
示例#5
0
        private bool visitExists(string patientId, string date, string time)
        {
            bool exists = false;

            MySqlConnectionStringBuilder builder = DBConnection.Connect();

            MySqlConnection conn = new MySqlConnection(builder.ToString());
            String          qry  = $"SELECT DISTINCT patient_visits.*, patient_appointments.PatientID FROM patient_visits " +
                                   $"JOIN patient_appointments ON patient_visits.PatientID = patient_appointments.PatientID " +
                                   $"WHERE patient_visits.PatientID = '{patientId}' AND Date = '{date}' AND time = '{time}';";

            //LblNoteText.Text = qry;

            MySqlCommand cmd = new MySqlCommand(qry, conn);

            conn.Open();

            MySqlDataReader reader = cmd.ExecuteReader();

            int counter = 0;

            while (reader.Read())
            {
                string id            = reader["PatientVisitID"].ToString();
                string pId           = reader["PatientID"].ToString();
                string notes         = reader["Notes"].ToString();
                string visitDate     = reader["Date"].ToString();
                string visitTime     = reader["Time"].ToString();
                string incomeId      = reader["IncomeID"].ToString();
                string afterOpening  = reader["AfterOpening"].ToString();
                string actions       = reader["ActionsPerformed"].ToString();
                string beforeClosing = reader["BeforeClosing"].ToString();
                string type          = reader["Type"].ToString();

                PatientVisit visit = new PatientVisit(id, pId, visitDate, visitTime, notes,
                                                      incomeId, afterOpening, actions, beforeClosing, type);

                BtnViewVisit.Tag = visit;

                counter++;
            }

            conn.Close();

            if (counter >= 1)
            {
                exists = true;
            }

            return(exists);
        }
示例#6
0
        // INSERT VISIT INTO DB

        private void addPatientVisit(PatientVisit visit)
        {
            MySqlConnectionStringBuilder builder = DBConnection.Connect();

            MySqlConnection conn = new MySqlConnection(builder.ToString());

            String qry = "INSERT INTO patient_visits VALUES('" + visit.id + "','" + visit.patientId + "','" +
                         visit.notes + "','" + visit.date + "','" + visit.time + "','" + visit.incomeId + "','" +
                         visit.afterOpening + "','" + visit.actionsTaken + "','" + visit.beforeClosing + "', '" + visit.type + "');";

            MySqlCommand cmd = new MySqlCommand(qry, conn);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
        }
示例#7
0
        // INSERT ASSESSMENT INTO DB

        private void insertVisitAssessment(PatientVisit pv)
        {
            MySqlConnectionStringBuilder builder = DBConnection.Connect();

            MySqlConnection conn = new MySqlConnection(builder.ToString());

            String qry = "";

            if (thisAssessment is BurnsVisit)
            {
                BurnsVisit v = thisAssessment as BurnsVisit;
                qry = $"INSERT INTO burns_visit VALUES('{v.VisitID}','{v.Purpose}','{v.Description}','{v.Manner}'," +
                      $"'{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," +
                      $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," +
                      $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," +
                      $"'{v.Site}','{v.Size}','{v.Depth}','{v.Exudate}','{v.Circumferential}','{v.PeripheralCirculation}'," +
                      $"'{pv.id}')";
            }
            else if (thisAssessment is ChronicUlcerVisit)
            {
                ChronicUlcerVisit v = thisAssessment as ChronicUlcerVisit;
                qry = $"INSERT INTO chronic_ulcer_visit VALUES('{v.VisitID}','{v.Purpose}','{v.DurationOfUlcer}','{v.Treatment}'," +
                      $"'{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," +
                      $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," +
                      $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," +
                      $"'{v.Site}','{v.Size}','{v.Depth}','{v.ExtentOfUndermining}','{v.WoundSurface}','{v.Exudate}','{v.PeriwoundTissue}'," +
                      $"'{pv.id}')";
            }
            else if (thisAssessment is DiabeticFootVisit)
            {
                DiabeticFootVisit v = thisAssessment as DiabeticFootVisit;
                qry = $"INSERT INTO diabetic_foot_visit VALUES('{v.VisitID}','{v.Purpose}','{v.DurationOfUlcer}','{v.Treatment}'," +
                      $"'{v.Claudication}','{v.PainAtRest}','{v.Hypesthesia}','{v.Hyperesthesia}','{v.Paraesthesia}','{v.Dysesthesia}'," +
                      $"'{v.RadicularPain}','{v.Anhydrosis}','{v.DiabetesMellitus}','{v.Hypertension}','{v.IHD}','{v.Asthma}','{v.Thyroid}','{v.CVA}','{v.DVT}'," +
                      $"'{v.Allergy}','{v.Smoking}','{v.Pallor}','{v.Jaundice}','{v.Clubbing}','{v.Pulses}','{v.Cardiovascular}'," +
                      $"'{v.Respiratory}','{v.Abdominal}','{v.Neurological}','{v.BP}','{v.Pulse}','{v.Temperature}','{v.RBS}'," +
                      $"'{v.Site}','{v.Size}','{v.Depth}','{v.ExtentOfUndermining}','{v.WoundSurface}','{v.Exudate}','{v.PeriwoundTissue}'," +
                      $"'{v.Callus}','{v.BrittleNail}','{v.HammerToe}','{v.Fissures}','{v.HairGrowth}'," +
                      $"'{v.CyanosisOfToes}','{v.PallorOfFoot}','{pv.id}')";;
            }

            MySqlCommand cmd = new MySqlCommand(qry, conn);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
        }
        // GET MAIN VISIT INFO
        private void getVisitDetails(PatientVisit visit)
        {
            MySqlConnectionStringBuilder builder = DBConnection.Connect();

            MySqlConnection conn = new MySqlConnection(builder.ToString());
            String          qry  = "SELECT patient_visits.*, patients.Name, patients.Surname FROM patient_visits " +
                                   "JOIN patients ON patient_visits.PatientID = patients.PatientID " +
                                   "WHERE patient_visits.PatientVisitID = '" + visit.id + "'; ";
            MySqlCommand cmd = new MySqlCommand(qry, conn);

            conn.Open();

            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                string id            = reader["PatientVisitID"].ToString();
                string pId           = reader["PatientID"].ToString();
                string notes         = reader["Notes"].ToString();
                string date          = reader["Date"].ToString();
                string time          = reader["Time"].ToString();
                string incomeId      = reader["IncomeID"].ToString();
                string afterOpening  = reader["AfterOpening"].ToString();
                string actions       = reader["ActionsPerformed"].ToString();
                string beforeClosing = reader["BeforeClosing"].ToString();
                string name          = reader["Name"].ToString();
                string surname       = reader["Surname"].ToString();
                string type          = reader["Type"].ToString();

                LblName.Text     = name + " " + surname;
                LblDateTime.Text = date + " " + time;
                LblDateTime.Text = DateTimeManager.DateToShort(date) + " | " + time;

                LblAfterOpeningText.Text  = afterOpening;
                LblActionsTakenText.Text  = actions;
                LblBeforeClosingText.Text = beforeClosing;
                LblNotesText.Text         = notes;
            }
        }
        // GET DOCS
        private async void getDocumentsList(PatientVisit visit)
        {
            StorageFolder patientFolder = (StorageFolder)await localFolder.TryGetItemAsync(visit.patientId);

            if (patientFolder != null)
            {
                StorageFolder visitFolder = (StorageFolder)await patientFolder.TryGetItemAsync(visit.id);

                if (visitFolder != null)
                {
                    StorageFolder docsFolder = (StorageFolder)await visitFolder.TryGetItemAsync("Documents");

                    if (docsFolder != null)
                    {
                        var files = await docsFolder.GetFilesAsync();

                        foreach (var item in files)
                        {
                            docsCollection.Add(new VisitDocumentInformation(item, item.Name));
                        }
                    }
                }
            }
        }
示例#10
0
        private void BtnViewVisit_Click(object sender, RoutedEventArgs e)
        {
            PatientVisit visit = (PatientVisit)BtnViewVisit.Tag;

            this.Frame.Navigate(typeof(ViewPatientVisit), visit);
        }
示例#11
0
        private void ListViewVisits_ItemClick(object sender, ItemClickEventArgs e)
        {
            PatientVisit visit = (PatientVisit)e.ClickedItem;

            Frame.Navigate(typeof(ViewPatientVisit), visit);
        }