示例#1
0
        public GeneticTestingRowExpandable(GeneticTestingView geneticTestingView, GeneticTest geneticTest)
        {
            this.geneticTestingView = geneticTestingView;
            this.geneticTest        = geneticTest;
            InitializeComponent();

            string dateFormat = Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern;

            if (dateFormat == "M/d/yyyy")
            {
                dateFormat = "MM/dd/yyyy";
            }
            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = dateFormat;

            if (!geneticTestingView.canModify)
            {
                dateTimePicker1.Enabled   = false;
                testMonthComboBox.Enabled = false;
                testYearComboBox.Enabled  = false;
                //statusComboBox.Enabled = false;
                deleteButton.Visible    = false;
                addResultButton.Visible = false;
            }

            if (this.geneticTest.GeneticTestResults.Count > 0)
            {
                this.addResultButton.Enabled = true;
                this.addResultButton.Visible = true;
            }

            if (this.geneticTest.IsASOTest && this.geneticTest.GeneticTestResults.Count < 1)
            {
                this.addResultButton.Visible = true;
                this.addResultButton.Enabled = true;
            }
            else if (this.geneticTest.IsASOTest && this.geneticTest.GeneticTestResults.Count > 0)
            {
                this.addResultButton.Visible = false;
                this.addResultButton.Enabled = false;
            }

            //if (geneticTest.panelID > 0)
            if (geneticTest.GeneticTestResults.Count > 0)
            {
                this.panelComboBox.Enabled = false;
            }

            this.geneticTest.AddHandlersWithLoad(GeneticTestChanged, null, GeneticTestPersisted);

            FillControls();

            if (geneticTest.panelID > 0 && geneticTest.GeneticTestResults.Count == 0)
            {
                addResultRows();
                addResultButton.Enabled = true;
            }
        }
示例#2
0
        /**************************************************************************************************/
        private void ProcessGeneticTest(GeneticTest gt)
        {
            string label = "";

            lock (FamilialVariants)
            {
                FamilialVariants = this.proband.FHx.ReloadFamilialVariants();

                label = this.proband.FHx.BuildFamilialVariantsLabel();
            }
            pedigreeTitleBlock1.SetVariantLabel(label);
        }
示例#3
0
        /**************************************************************************************************/
        private void AddGeneticTest_Click(object sender, EventArgs e)
        {
            GeneticTest geneticTest = new GeneticTest(pmh);

            geneticTest.status = "Pending";
            HraModelChangedEventArgs args = new HraModelChangedEventArgs(null);

            args.Persist = false;
            pmh.GeneticTests.AddToList(geneticTest, args);

            noLabel.Visible = false;
        }
示例#4
0
        /**************************************************************************************************/

        private void GeneticTestListChanged(HraListChangedEventArgs e)
        {
            if (e.hraOperand != null)
            {
                GeneticTest geneticTest = (GeneticTest)e.hraOperand;

                switch (e.hraListChangeType)
                {
                case HraListChangedEventArgs.HraListChangeType.ADD:

                    GeneticTestingRowExpandable newRow = new GeneticTestingRowExpandable(this, geneticTest);
                    flowLayoutPanel1.Controls.Add(newRow);

                    //setup grouping
                    int    selectedGroupID = 1;
                    String groupName       = testGroupComboBox.Text;
                    if (!String.IsNullOrEmpty(groupName))
                    {
                        selectedGroupID = this.testList
                                          .Where(t => ((GeneticTestObject)t).groupingName.Equals(groupName))
                                          .Select(t => ((GeneticTestObject)t).groupingID)
                                          .Distinct()
                                          .SingleOrDefault();
                    }
                    newRow.setGroupID(selectedGroupID);
                    break;

                case HraListChangedEventArgs.HraListChangeType.DELETE:
                    Control doomed = null;
                    foreach (Control c in flowLayoutPanel1.Controls)
                    {
                        GeneticTestingRowExpandable targetRow = (GeneticTestingRowExpandable)c;
                        if (targetRow.GetGeneticTest() == geneticTest)
                        {
                            doomed = c;
                        }
                    }
                    if (doomed != null)
                    {
                        flowLayoutPanel1.Controls.Remove(doomed);
                    }

                    if (pmh.GeneticTests.Count == 0)
                    {
                        noLabel.Visible = true;
                    }

                    break;
                }
            }
        }
示例#5
0
 private void buttonStartGeneticAnalyzeWeight_Click(object sender, EventArgs e)
 {
     try
     {
         int    time                = Int32.Parse(textBoxTimeGeneticTest.Text);
         int    populationSize      = Int32.Parse(textBoxPopulationSizeGeneticTest.Text);
         int    matingPoolSize      = Int32.Parse(textBoxMatingPoolSizeGeneticTest.Text);
         int    tournamentSize      = Int32.Parse(textBoxTournamentSizeGeneticTest.Text);
         int    mutationProbability = Int32.Parse(textBoxMutationProbabilityGeneticTest.Text);
         int    mutationType        = RadioButtonInvertGeneticTest.Checked == true ? 0 : 1;
         string path                = textBoxOutputPathGeneticTest.Text;
         GeneticTest.RunParameterTest(cities, time, populationSize, matingPoolSize,
                                      tournamentSize, mutationProbability, mutationType, path);
     }
     catch
     {
         MessageBox.Show("Błędne dane!");
         return;
     }
 }
示例#6
0
        /*****************************************************/
        public override void BackgroundListLoad()
        {
            pc.Clear();
            pc.Add("unitnum", OwningPMH.RelativeOwningPMH.owningFHx.proband.unitnum);
            pc.Add("apptid", OwningPMH.RelativeOwningPMH.owningFHx.proband.apptid);
            pc.Add("relId", OwningPMH.RelativeOwningPMH.relativeID);

            LoadListArgs lla = new LoadListArgs("sp_3_LoadgeneticTest",
                                                pc,
                                                typeof(GeneticTest),
                                                constructor_args);

            DoListLoad(lla);

            foreach (HraObject ho in this)
            {
                GeneticTest gt = (GeneticTest)ho;
                gt.LoadResultsOnly();
            }
        }
示例#7
0
        void OrderRow_Finalized(object sender, OrdersView.FinalizedEventArgs e)
        {
            //Finalize has been clicked
            if (order.Order_finalized == 0)
            {
                order.Order_finalized = 1;
                Patient proband = SessionManager.Instance.GetActivePatient();
                HraModelChangedEventArgs args = new HraModelChangedEventArgs(this.owningView);

                int panelID = SessionManager.Instance.MetaData.GeneticTests.GetPanelIDFromName(order.Order_orderDesc);
                if (panelID > 0)  // a genetic test has been ordered
                {
                    //add the pending gen test to the model
                    PastMedicalHistory pmh = proband.PMH;


                    //GeneticTest geneticTest = (GeneticTest)(pmh.GeneticTests.SingleOrDefault(v => ((GeneticTest)v).panelID == panelID && ((GeneticTest)v).status == "Pending"
                    //    && ((GeneticTest)v).GeneticTest_testYear == (order.Order_orderDate.Year).ToString()
                    //    && ((GeneticTest)v).GeneticTest_testMonth == (order.Order_orderDate.Month).ToString()
                    //    && ((GeneticTest)v).GeneticTest_testDay == (order.Order_orderDate.Day).ToString()));
                    //if (geneticTest == null)
                    //{

                    //duplicate pending tests are allowed, so ignore commented check above
                    //also, no difference between all "Familial Known Genetic Test"s, regardless of group
                    GeneticTest geneticTest = new GeneticTest(pmh);
                    geneticTest.GeneticTest_status    = "Pending";
                    geneticTest.GeneticTest_panelID   = panelID;
                    geneticTest.GeneticTest_testYear  = (order.Order_orderDate.Year).ToString();
                    geneticTest.GeneticTest_testMonth = (order.Order_orderDate.Month).ToString();
                    geneticTest.GeneticTest_testDay   = (order.Order_orderDate.Day).ToString();

                    pmh.GeneticTests.AddToList(geneticTest, args);
                    //}
                    //else
                    //{
                    //    geneticTest.SignalModelChanged(args);
                    //}
                }

                else if (order.Order_orderDesc.Contains("mammo"))
                {
                    BreastImagingStudy bis = new BreastImagingStudy();
                    bis.unitnum     = proband.unitnum;
                    bis.type        = "MammographyHxView";
                    bis.date        = DateTime.Today;
                    bis.imagingType = "MammographyHxView";
                    bis.status      = "Ordered";
                    proband.breastImagingHx.AddToList(bis, args);
                }
                else if (order.Order_orderDesc.Contains("MRI"))
                {
                    BreastImagingStudy bis = new BreastImagingStudy();
                    bis.unitnum     = proband.unitnum;
                    bis.type        = "MRI";
                    bis.date        = DateTime.Today;
                    bis.imagingType = "MRI";
                    bis.status      = "Ordered";
                    bis.side        = "Bilateral";
                    proband.breastImagingHx.AddToList(bis, args);
                }
                else if (order.Order_orderDesc.Contains("Transvaginal Sonography"))
                {
                    TransvaginalImagingStudy tvs = new TransvaginalImagingStudy();
                    tvs.unitnum     = proband.unitnum;
                    tvs.type        = "TVS";
                    tvs.date        = DateTime.Today;
                    tvs.imagingType = "TVS";
                    tvs.status      = "Ordered";
                    proband.transvaginalImagingHx.AddToList(tvs, args);
                }
                else if (order.Order_orderDesc.Contains("CA-125"))
                {
                    LabResult lr = new LabResult();
                    lr.unitnum  = proband.unitnum;
                    lr.date     = DateTime.Today;
                    lr.TestDesc = "CA125";
                    lr.status   = "Ordered";
                    proband.labsHx.AddToList(lr, args);
                }
            }
        }