private void butOk_Click(object sender, EventArgs e)
 {
     if (textSpecimenSourceCode.Text != "" && textSpecimenLocation.Text == "")
     {
         MessageBox.Show("If specimen code is entered, then specimen location must be entered.");
         return;
     }
     if (textSpecimenSourceCode.Text == "" && textSpecimenLocation.Text != "")
     {
         MessageBox.Show("If specimen location is entered, then specimen code must be entered.");
         return;
     }
     PanelCur.ServiceId         = textServiceID.Text;
     PanelCur.ServiceName       = textServiceName.Text;
     PanelCur.LabNameAddress    = textLabName.Text;
     PanelCur.SpecimenCondition = textSpecimenCondition.Text;
     if (textSpecimenSourceCode.Text == "")
     {
         PanelCur.SpecimenSource = "";
     }
     else
     {
         PanelCur.SpecimenSource = textSpecimenSourceCode.Text + "&" + textSpecimenLocation.Text + "&HL70070";
     }
     if (IsNew)
     {
         LabPanels.Insert(PanelCur);
     }
     else
     {
         LabPanels.Update(PanelCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemple #2
0
        ///<summary>The values returned are sent to the webserver.</summary>
        public static List <LabPanelm> GetMultLabPanelms(List <long> labPanelNums)
        {
            List <LabPanel>  LabPanelList  = LabPanels.GetMultLabPanels(labPanelNums);
            List <LabPanelm> LabPanelmList = ConvertListToM(LabPanelList);

            return(LabPanelmList);
        }
Exemple #3
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();
        }
        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();
        }
        private void butRemove_Click(object sender, EventArgs e)
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                MessageBox.Show("Please select a lab panel first.");
                return;
            }
            LabPanel panel = listPanels[gridMain.GetSelectedIndex()];

            panel.MedicalOrderNum = 0;
            LabPanels.Update(panel);
            FillGrid();
        }
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (MessageBox.Show("Delete?", "", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     LabPanels.Delete(PanelCur.LabPanelNum);
     LabResults.DeleteForPanel(PanelCur.LabPanelNum);
     DialogResult = DialogResult.OK;
 }
        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?
        }
        private void butAttach_Click(object sender, EventArgs e)
        {
            if (IsNew)
            {
                MessageBox.Show("Cannot attach lab panels to a brand new order.  Please save order first.");
                return;
            }
            FormEhrLabPanels formL = new FormEhrLabPanels();
            Patient          pat   = Patients.GetPat(MedOrderCur.PatNum);

            formL.PatCur          = pat;
            formL.IsSelectionMode = true;
            formL.ShowDialog();
            if (formL.DialogResult != DialogResult.OK)
            {
                return;
            }
            LabPanel panel = LabPanels.GetOne(formL.SelectedLabPanelNum);

            panel.MedicalOrderNum = MedOrderCur.MedicalOrderNum;
            LabPanels.Update(panel);
            FillGrid();
        }
Exemple #9
0
 ///<summary>The values returned are sent to the webserver.</summary>
 public static List <long> GetChangedSinceLabPanelNums(DateTime changedSince, List <long> eligibleForUploadPatNumList)
 {
     return(LabPanels.GetChangedSinceLabPanelNums(changedSince, eligibleForUploadPatNumList));
 }
Exemple #10
0
        private void butGiveAccess_Click(object sender, EventArgs e)
        {
            string interval = PrefC.GetStringSilent(PrefName.MobileSyncIntervalMinutes);

            if (interval == "" || interval == "0")         //not a paid customer or chooses not to synch
            {
                MessageBox.Show("Synch must be setup first from the Tools menu, Mobile and Patient Portal Synch.  Interval must not be blank or zero.");
                return;
            }
            //we won't check PrefName.MobileSyncWorkstationName because we are forcing the synch
            if (System.Environment.MachineName.ToUpper() != PrefC.GetStringSilent(PrefName.MobileSyncWorkstationName).ToUpper())
            {
                //Since GetStringSilent returns "" before OD is connected to db, this gracefully loops out
                if (!MsgBox.Show(this, MsgBoxButtons.OKCancel,
                                 "Warning.  Workstation is not entered in the Tools menu, Mobile and Patient Portal Synch.  No automatic synch is taking place.  Continue anyway?"))
                {
                    return;
                }
            }
            if (PrefC.GetDate(PrefName.MobileExcludeApptsBeforeDate).Year < 1880)
            {
                MessageBox.Show("Full Synch must be run first first from the Tools menu, Mobile and Patient Portal Synch.");
                return;
            }
            if (butGiveAccess.Text == "Provide Online Access")           //When form open opens with a blank password
            {
                Cursor = Cursors.WaitCursor;
                //1. Fill password.
                textOnlinePassword.Text = GenerateRandomPassword(8, 10);             //won't save until OK or Print
                //2. Fill link.
                textOnlineLink.Text = GetPatientPortalLink();
                //3. Reset timestamps for this patient to trigger all their objects to upload with the next synch
                LabPanels.ResetTimeStamps(PatCur.PatNum);
                Diseases.ResetTimeStamps(PatCur.PatNum);
                Allergies.ResetTimeStamps(PatCur.PatNum);
                MedicationPats.ResetTimeStamps(PatCur.PatNum);
                Statements.ResetTimeStamps(PatCur.PatNum);
                Documents.ResetTimeStamps(PatCur.PatNum);
                //4. Make the password editable in case they want to change it.
                textOnlinePassword.ReadOnly = false;
                //5. Save password to db
                PatCur.OnlinePassword = textOnlinePassword.Text;
                Patients.Update(PatCur, PatOld);
                PatOld.OnlinePassword = textOnlinePassword.Text;              //so that subsequent Updates will work.
                //6. Force a synch
                FormMobile.SynchFromMain(true);
                //7. Insert EhrMeasureEvent
                EhrMeasureEvent newMeasureEvent = new EhrMeasureEvent();
                newMeasureEvent.DateTEvent = DateTime.Now;
                newMeasureEvent.EventType  = EhrMeasureEventType.OnlineAccessProvided;
                newMeasureEvent.PatNum     = PatCur.PatNum;
                newMeasureEvent.MoreInfo   = "";
                EhrMeasureEvents.Insert(newMeasureEvent);
                //8. Rename button
                butGiveAccess.Text = "Remove Online Access";
                Cursor             = Cursors.Default;
            }
            else              //remove access
            {
                Cursor = Cursors.WaitCursor;
                //1. Clear password
                textOnlinePassword.Text = "";
                //2. Make in uneditable
                textOnlinePassword.ReadOnly = true;
                //3. Save password to db
                PatCur.OnlinePassword = textOnlinePassword.Text;
                Patients.Update(PatCur, PatOld);
                PatOld.OnlinePassword = textOnlinePassword.Text;
                //5. Force a synch
                FormMobile.SynchFromMain(true);
                //no event to insert
                //6. Rename button
                butGiveAccess.Text = "Provide Online Access";
                Cursor             = Cursors.Default;
            }
        }