예제 #1
0
 private void FormEhrLabeImageEdit_Load(object sender, EventArgs e)
 {
     Height = System.Windows.Forms.Screen.GetWorkingArea(this).Height;
     this.SetDesktopLocation(DesktopLocation.X, 0);
     checkWaitingForImages.Checked = EhrLabImages.IsWaitingForImages(_ehrLabNum);
     _listPatientDocuments         = new List <Document>(Documents.GetAllWithPat(_patNum));
     _patFolder    = ImageStore.GetPatientFolder(Patients.GetPat(_patNum), ImageStore.GetPreferredAtoZpath());      //This is where the pat folder gets created if it does not yet exist.
     _listAttached = EhrLabImages.Refresh(_ehrLabNum);
     FillGrid();
 }
예제 #2
0
        private void FillGrid()
        {
            int curSelection = gridMain.GetSelectedIndex();

            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Attached"), 60, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Date"), 80, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Category"), 80, HorizontalAlignment.Center));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableLabImage", "Desc"), 180, HorizontalAlignment.Left));
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listPatientDocuments.Count; i++)
            {
                if (_listPatientDocuments[i].DocNum <= 0)                //Invalid doc num indicates 'Waiting for images'. This flag is set in the Load event.
                {
                    continue;
                }
                //Test if this is a valid image.
                Bitmap bmp = ImageStore.OpenImage(_listPatientDocuments[i], _patFolder);
                if (bmp == null)
                {
                    continue;
                }
                bmp.Dispose();
                bmp = null;
                bool isAttached = EhrLabImages.GetDocNumExistsInList(_ehrLabNum, _listPatientDocuments[i].DocNum, _listAttached);
                row = new GridRow();
                row.Cells.Add(isAttached?"X":"");
                row.Cells.Add(_listPatientDocuments[i].DateCreated.ToString());
                row.Cells.Add(Defs.GetName(DefCat.ImageCats, _listPatientDocuments[i].DocCategory));
                row.Cells.Add(_listPatientDocuments[i].Description);
                row.Tag = _listPatientDocuments[i];
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
            if (curSelection >= 0)
            {
                gridMain.SetSelected(curSelection, true);
            }
        }
예제 #3
0
        private void butOK_Click(object sender, EventArgs e)
        {
            //Uncheck the waiting check box if any images are attached. User only has the option of setting the 'Waiting' flag if there are no images attached.
            List <long> docNums = new List <long>();

            for (int i = 0; i < _listAttached.Count; i++)
            {
                if (!docNums.Contains(_listAttached[i].DocNum))
                {
                    docNums.Add(_listAttached[i].DocNum);
                }
            }
            if (checkWaitingForImages.Checked && docNums.Count > 0)
            {
                MsgBox.Show(this, "'Waiting for Images' is only allowed if there are no images currently attached. Detach all images or uncheck 'Waiting for Images'.");
                return;
            }
            EhrLabImages.InsertAllForLabNum(_ehrLabNum, checkWaitingForImages.Checked, docNums);
            DialogResult = DialogResult.OK;
        }