Beispiel #1
0
        public LabResults GetLabResult(long LabPanelNum)
        {
            LabResults lr = new LabResults();                    // a variable made from the above declared  inner class LabResults

            lr.mLabResultmList = LabResultms.GetLabResultms(patm.CustomerNum, LabPanelNum);
            return(lr);
        }
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Test Date", 80);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("LOINC", 75);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Test Performed", 130);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("ResultVal", 60);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Units", 45);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Range", 55);
            gridMain.ListGridColumns.Add(col);
            listResults = LabResults.GetForPanel(PanelCur.LabPanelNum);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < listResults.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(listResults[i].DateTimeTest.ToShortDateString());
                row.Cells.Add(listResults[i].TestID);
                row.Cells.Add(listResults[i].TestName);
                row.Cells.Add(listResults[i].ObsValue);
                row.Cells.Add(listResults[i].ObsUnits);
                row.Cells.Add(listResults[i].ObsRange);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #3
0
        private static bool LabresultComparison(AutomationCondition autoCond, long patNum)
        {
            List <LabResult> listResults = LabResults.GetAllForPatient(patNum);

            switch (autoCond.Comparison)
            {
            case AutoCondComparison.Equals:
                for (int i = 0; i < listResults.Count; i++)
                {
                    if (listResults[i].TestName == autoCond.CompareString)
                    {
                        return(true);
                    }
                }
                break;

            case AutoCondComparison.Contains:
                for (int i = 0; i < listResults.Count; i++)
                {
                    if (listResults[i].TestName.ToLower().Contains(autoCond.CompareString.ToLower()))
                    {
                        return(true);
                    }
                }
                break;
            }
            return(false);
        }
Beispiel #4
0
        ///<summary>Creates the Message object and fills it with data.  All panels will be for the same patient.</summary>
        public void Initialize(List <LabPanel> panels)
        {
            if (panels.Count == 0)
            {
                throw new ApplicationException("Must be at least one lab panel.");
            }
            //LabPanel panel=panelList[0];
            //List<LabResult> labresultList=LabResults.GetForPanel(panel.LabPanelNum);
            //if(labresultList.Count!=1) {
            //	throw new ApplicationException("Lab panel must have exactly one lab result.");
            //}
            //LabResult labresult=labresultList[0];
            Patient pat = Patients.GetPat(panels[0].PatNum);

            msg = new MessageHL7(MessageType.ORU);
            MSH();
            PID(pat);
            for (int p = 0; p < panels.Count; p++)
            {
                List <LabResult> results = LabResults.GetForPanel(panels[p].LabPanelNum);
                OBR(panels[p], results[0].DateTimeTest);
                for (int r = 0; r < results.Count; r++)
                {
                    OBX(results[r], r);
                }
            }
        }
Beispiel #5
0
        ///<summary>The values returned are sent to the webserver.</summary>
        public static List <LabResultm> GetMultLabResultms(List <long> labResultNums)
        {
            List <LabResult>  LabResultList  = LabResults.GetMultLabResults(labResultNums);
            List <LabResultm> LabResultmList = ConvertListToM(LabResultList);

            return(LabResultmList);
        }
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("Date Time", 135);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Service", 200);
            gridMain.Columns.Add(col);
            listPanels = LabPanels.GetPanelsForOrder(MedOrderCur.MedicalOrderNum);          //for a new lab order, this will naturally return no results
            List <LabResult> listResults;

            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listPanels.Count; i++)
            {
                row         = new ODGridRow();
                listResults = LabResults.GetForPanel(listPanels[i].LabPanelNum);
                if (listResults.Count == 0)
                {
                    row.Cells.Add(" ");                    //to avoid a very short row
                }
                else
                {
                    row.Cells.Add(listResults[0].DateTimeTest.ToString());
                }
                row.Cells.Add(listPanels[i].ServiceName);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #7
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("Date Time", 135);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Service", 200);
            gridMain.Columns.Add(col);
            listLP = LabPanels.Refresh(PatCur.PatNum);
            List <LabResult> listResults;

            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listLP.Count; i++)
            {
                row         = new ODGridRow();
                listResults = LabResults.GetForPanel(listLP[i].LabPanelNum);
                if (listResults.Count == 0)
                {
                    row.Cells.Add(" ");                    //to avoid a very short row
                }
                else
                {
                    row.Cells.Add(listResults[0].DateTimeTest.ToString());
                }
                row.Cells.Add(listLP[i].ServiceName);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #8
0
 private void butOk_Click(object sender, EventArgs e)
 {
     if (textDateTimeTest.Text == "")
     {
         MessageBox.Show("Please input a valid date.");
         return;
     }
     try {
         LabCur.DateTimeTest = DateTime.Parse(textDateTimeTest.Text);
     }
     catch {
         MessageBox.Show("Please input a valid date.");
         return;
     }
     LabCur.TestID       = textTestID.Text;
     LabCur.TestName     = textTestName.Text;
     LabCur.ObsValue     = textObsValue.Text;
     LabCur.ObsUnits     = textObsUnits.Text;
     LabCur.ObsRange     = textObsRange.Text;
     LabCur.AbnormalFlag = (LabAbnormalFlag)comboAbnormalFlag.SelectedIndex;
     if (IsNew)
     {
         LabResults.Insert(LabCur);
     }
     else
     {
         LabResults.Update(LabCur);
     }
     DialogResult = DialogResult.OK;
 }
Beispiel #9
0
        static void LabResults()
        {
            LabResults myLab = new LabResults();

            myLab.Method1();
            myLab.Method2();
            myLab.Method3();
        }
Beispiel #10
0
        static void LabResults()
        {
            LabResults myLab2 = new LabResults();

            //myLab2.Problem1();
            //myLab2.Problem2();
            //myLab2.Problem3();
            //myLab2.Problem4();
            myLab2.Problem5();
            //myLab2.Problem6();
        }
        public async Task <ActionResult> Edit(int clientId, LabResults labResults)
        {
            if (ModelState.IsValid)
            {
                db.Entry(labResults).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { clientId = clientId }));
            }
            return(View(labResults));
        }
Beispiel #12
0
        public static void LabTest()

        {
            LabResults LR = new LabResults();

            LR.Voltage    = 50;
            LR.Current    = 10;
            LR.Resistance = 10.5;

            LR.CercuiteCalc();
        }
Beispiel #13
0
        static void LabResult()
        {
            LabResults lr = new LabResults();

            lr.Question1();
            lr.Question2();
            lr.Question3();
            lr.Question4();
            lr.Question5();
            // lr.Question6();
            lr.Question7();
        }
Beispiel #14
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (MessageBox.Show("Delete?", "Delete?", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     LabResults.Delete(LabCur.LabResultNum);
     DialogResult = DialogResult.OK;
 }
Beispiel #15
0
        /*public async Task<List<FollowUpList>>TryFollowupAsync()
         * {
         *  var lab = FollowUpAsync();
         *  var pat = GetPatientsAsync();
         *
         *  return await from s in lab // outer sequence
         *               join st in pat //inner sequence
         *               on s.OPDNumber equals st.OPDNumber // key selector
         *               select new FollowUpList
         *               { // result selector
         *                   FirstName = st.FirstName,
         *                   MalariaResults = s.MalariaResults
         *               };
         *  //List<FollowUpList> FollowUpLists = new List<FollowUpList>();
         *  //var q = await _database.QueryAsync<LabResults>(@"SELECT * FROM LabResults LR INNER JOIN Patients P ON LR.OPDNumber = P.OPDNumber WHERE LR.MalariaResults = 'Postive'");
         *  //return (List<FollowUpList>)q.Select(x => new FollowUpList { FirstName = x.Patients.FirstName, MalariaResults = x.MalariaResults, TestDate = x.TestDate });
         * }*/

        public async Task <bool> SubmitResultsAsync(LabResults Labresult)
        {
            //var Submit = await _database.InsertAsync(Labresult);
            if (Labresult.OPDNumber != 0)
            {
                await _database.InsertAsync(Labresult);

                return(true);
            }
            else
            {
                return(false);
            }
        }
        // GET: LaboratorioResultados/Edit/5
        public async Task <ActionResult> Edit(int?id, int clientId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LabResults labResults = await db.LabResults.FindAsync(id);

            ViewBag.clientId = clientId;
            if (labResults == null)
            {
                return(HttpNotFound());
            }
            return(View(labResults));
        }
        public async Task <ActionResult> Create(int clientId, LabResults labResults)
        {
            if (ModelState.IsValid)
            {
                fichas_medicas fm = db.fichas_medicas.Where(m => m.cliente_id == clientId).Include(m => m.laboratorio).OrderByDescending(m => m.created_at).FirstOrDefault();
                fm.laboratorio.Add(labResults);
                fm.updated_at = Utilities.CurrentDate.getNow();

                db.Entry(fm).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { clientId = clientId }));
            }

            return(View(labResults));
        }
Beispiel #18
0
        static void LabResults()
        {
            LabResults lr1 = new LabResults();

            lr1.SampleConversion(ConvertEnum.mm);
            string _convervariable1 = lr1.SampleConversion(ConvertEnum.mm);
            string _convervariable2 = lr1.SampleConversion(ConvertEnum.cm);
            string _convervariable3 = lr1.SampleConversion(ConvertEnum.inch);
            string _convervariable4 = lr1.SampleConversion(ConvertEnum.m);
            string _convervariable5 = lr1.SampleConversion(ConvertEnum.y);

            Console.WriteLine(_convervariable1);
            Console.WriteLine(_convervariable2);
            Console.WriteLine(_convervariable3);
            Console.WriteLine(_convervariable4);
            Console.WriteLine(_convervariable5);
        }
        private void CreateLabPanel()
        {
            MedicalOrder order = listLabOrders[gridMain.GetSelectedIndex()];
            MessageHL7   msg   = new MessageHL7(textHL7Raw.Text);
            //SegmentHL7 segOBR=null;
            //SegmentHL7 segOBX=null;
            //int idxPanel=0;
            //int idxResult=0;
            LabPanel  panel  = null;
            LabResult result = null;

            //loop through all message segments.
            for (int i = 0; i < msg.Segments.Count; i++)
            {
                if (msg.Segments[i].Name == SegmentNameHL7.OBR)              //if this is the start of a new panel
                {
                    panel                   = new LabPanel();
                    panel.PatNum            = order.PatNum;
                    panel.MedicalOrderNum   = order.MedicalOrderNum;
                    panel.RawMessage        = textHL7Raw.Text;
                    panel.LabNameAddress    = msg.Segments[i].GetFieldFullText(20);
                    panel.SpecimenSource    = msg.Segments[i].GetFieldFullText(15);
                    panel.SpecimenCondition = msg.Segments[i].GetFieldFullText(13);
                    panel.ServiceId         = msg.Segments[i].GetFieldComponent(4, 0);
                    panel.ServiceName       = msg.Segments[i].GetFieldComponent(4, 1);
                    LabPanels.Insert(panel);
                }
                if (msg.Segments[i].Name == SegmentNameHL7.OBX)              //if this is a result within a panel
                {
                    result              = new LabResult();
                    result.LabPanelNum  = panel.LabPanelNum;
                    result.DateTimeTest = msg.Segments[i].GetDateTime(14);
                    result.TestID       = msg.Segments[i].GetFieldComponent(3, 0);
                    result.TestName     = msg.Segments[i].GetFieldComponent(3, 1);
                    result.ObsValue     = msg.Segments[i].GetFieldFullText(5);
                    result.ObsUnits     = msg.Segments[i].GetFieldFullText(6);
                    result.ObsRange     = msg.Segments[i].GetFieldFullText(7);
                    LabResults.Insert(result);
                }
                //any other kind of segment, continue.
            }
            //order.IsLabPending=false;
            //MedicalOrders.Update(order);
            //return true;//I guess it's always true?
        }
Beispiel #20
0
 ///<summary>The values returned are sent to the webserver.</summary>
 public static List <long> GetChangedSinceLabResultNums(DateTime changedSince)
 {
     return(LabResults.GetChangedSinceLabResultNums(changedSince));
 }
Beispiel #21
0
        public static void ElMeterconverter()
        {
            LabResults myelectricconv = new LabResults();

            myelectricconv.ElMeterconverter();
        }
Beispiel #22
0
        // GET: FichasMedicas/Create
        public ActionResult Create(int clienteId)
        {
            clientes          cl    = db.clientes.Where(c => c.id_alt == clienteId).FirstOrDefault();
            DateTime          today = CurrentDate.getNow();
            programa_clientes prgCl = db.programa_clientes.Where(m => m.cliente_id == cl.id_alt && m.fecha_inicio <= today && m.fecha_fin >= today).FirstOrDefault();

            fichas_medicas fm = db.fichas_medicas.Where(m => m.cliente_id == cl.id_alt).Include(m => m.controles).Include(m => m.regimen_alimentacion).Include(m => m.cardio).Include(m => m.laboratorio).OrderByDescending(m => m.created_at).FirstOrDefault();

            ViewBag.currentCardioControl = null;
            if (fm != null && fm.cardio.Count > 0)
            {
                CardioInfo lastCardioInfoInserted = fm.cardio.OrderByDescending(m => m.fecha).First();

                TimeSpan dateDif = CurrentDate.getNow().Subtract(lastCardioInfoInserted.fecha);

                if (dateDif <= new TimeSpan(180, 0, 0, 0))
                {
                    ViewBag.currentCardioControl = lastCardioInfoInserted;
                }
            }

            ViewBag.currentLabControl = null;
            if (fm != null && fm.laboratorio.Count > 0)
            {
                LabResults lastLabInfoInserted = fm.laboratorio.OrderByDescending(m => m.fecha).First();

                TimeSpan dateDif = CurrentDate.getNow().Subtract(lastLabInfoInserted.fecha);

                if (dateDif <= new TimeSpan(180, 0, 0, 0))
                {
                    ViewBag.currentLabControl = lastLabInfoInserted;
                }
            }

            if (fm != null && fm.controles.Count > 0)
            {
                List <ControlesNutricionales> cn = fm.controles;
                List <string> cnRows             = new List <string>();
                foreach (ControlesNutricionales c in cn)
                {
                    string row = GetNutritionalControlString(c: c);
                    cnRows.Add(row);
                    controlsCount++;
                }
                controlsCount       = 0;
                ViewBag.controlsLst = cnRows;
            }

            if (fm != null && fm.regimen_alimentacion.Count > 0)
            {
                List <FeedingRegime> fr     = fm.regimen_alimentacion;
                List <string>        frList = new List <string>();
                foreach (FeedingRegime f in fr)
                {
                    string row = GetFoodRegimeString(f: f);
                    frList.Add(row);
                    foodRegimesCount++;
                }
                foodRegimesCount   = 0;
                ViewBag.regimenLst = frList;
            }

            ViewBag.clientId  = cl.id_alt;
            ViewBag.programId = prgCl.programa_id;

            return(View());
        }
Beispiel #23
0
        static void LabResults()
        {
            LabResults ce = new LabResults();

            ce.LabResultsExamples();
        }
        // #1. LabResults - Ohm's Law
        static void MyLabResults()
        {
            LabResults myTypes = new LabResults();

            myTypes.OhmsLaw();
        }
        private async void OnSubmitClicked(object obj)
        {
            ActivityRunning();
            var model = new LabResults
            {
                OPDNumber      = Opdnumber,
                MalariaResults = Malariaresults,
                TestDate       = DateTime.Today
            };


            if (Opdnumber != 0 & Malariaresults != null)
            {
                var check = await App.Database.CheckClientAsync(Opdnumber);

                if (check)
                {
                    var client = await App.Database.GetPatientAsync(Opdnumber);

                    var followupmodel = new FollowUpList
                    {
                        OPDNumber      = client.OPDNumber,
                        FirstName      = client.FirstName,
                        LastName       = client.LastName,
                        DateOfBirth    = client.DateOfBirth,
                        Village        = client.Village,
                        HouseNumber    = client.HouseNumber,
                        PhoneNumber    = client.PhoneNumber,
                        MalariaResults = Malariaresults,
                        TestDate       = DateTime.Today,
                        IsReviewed     = false
                    };



                    //var responce = await _apiServices.LoginAsync(Username, Password);
                    // Prefixing with `//` switches to a different navigation stack instead of pushing to the active one
                    var responce = await App.Database.SubmitResultsAsync(model);

                    var follows = await App.Database.SubmitFollowupAsync(followupmodel);


                    if (responce && follows)
                    {
                        // popupLoadingView.IsVisible = false;
                        ActivityStopped();
                        DisplaySaveSucessPrompt();
                        Clear();
                        //await Shell.Current.GoToAsync($"//{nameof(LabResultsPage)}");
                        //await Shell.Current.GoToAsync(nameof(LabResultsPage));
                    }
                    else
                    {
                        ActivityStopped();
                        DisplaySaveFailedPrompt();
                        Clear();
                        return;
                    }
                    //popupLoadingView.IsVisible = false;
                    //DisplayInvalidLoginPrompt();
                }
                else
                {
                    ActivityStopped();
                    Clear();
                    DisplayPatientNotRegisteredPrompt();
                    await Shell.Current.GoToAsync($"//{nameof(PatientsPage)}");

                    return;
                }
            }
            else
            {
                ActivityStopped();
                DisplayRequiredFieldsPrompt();
                return;
            }

            //await Shell.Current.GoToAsync($"//{nameof(PatientsListPage)}");
        }