public SDTM_New_Variable_Form(SDTM_Domain domain, SDTM_Domain_Form parent)
        {
            InitializeComponent();
            Domain = domain;
            Parent = parent;
            //Populate listbox with unused domains
            using (StreamReader file = File.OpenText("SDTM_Variable_Template.statds"))
            {
                JsonSerializer serializer = new JsonSerializer();
                dt = (DataTable)serializer.Deserialize(file, typeof(DataTable));
                var rows = from row in dt.AsEnumerable()
                           where row.Field<string>("Domain_Prefix") == domain.Domain_Name
                           select row;
                dt = rows.CopyToDataTable();
            }
            foreach (SDTM_Variable variable in domain.Domain_Variables)
            {
                varsInStudy.Add(variable.Variable_Name);
            }
            List<string> allSDTMvariables = dt.AsEnumerable().Select(x => x["Variable_Name"].ToString()).ToList();

            IEnumerable<string> notAlreadyInDomain = allSDTMvariables.Except(varsInStudy).Distinct();
            foreach (string s in notAlreadyInDomain)
            {
                lst_Variables.Items.Add(s);
            }
            //end populate listboxs
            lst_Variables.SetSelected(0, true);
        }
 public SDTM_Variable_Form(SDTM_Domain domain, string variable_name)
 {
     InitializeComponent();
     Domain = domain;
     Variable = domain.Domain_Variables.Find(x => x.Variable_Name == variable_name);
     PopulateVarInfo();
     HideAll();
     PopulateStudyDatasets();
     PopualteStudyLibnames();
     PopulateFormatList();
 }
示例#3
0
 public SDTM_Domain_Form(SDTM_Domain domain)
 {
     InitializeComponent();
     this.Name = domain.Domain_Name;
     txt_DomainName.Text = domain.Domain_Name;
     txt_DomainDescription.Text = domain.Domain_Description;
     txt_DomainClass.Text = domain.Domain_Class;
     txt_DomainStructure.Text = domain.Domain_Structure;
     Domain = domain;
     PopulateVariableList();
 }
 public Custom_Dataset_Creator(SDTM_Domain domain)
 {
     InitializeComponent();
     Domain = domain;
     rowCounter = 0;
     colCounter = 0;
     setupLibnamesAndDatasetLists();
     /*Button joinButton = new Button();
     joinButton.Text = "Join New Datasource";
     tableLayoutPanel1.Controls.Add(joinButton, 0, rowCounter);
     rowCounter++;
     tableLayoutPanel1.Controls.Add(new Label { Text = "Source 1: " }, 0, rowCounter);
     tableLayoutPanel1.Controls.Add(makeLibnameComboBox(rowCounter.ToString()), 1, rowCounter);
     tableLayoutPanel1.Controls.Add(makeDatasetComboBox(rowCounter.ToString()), 2, rowCounter);
     rowCounter++;
      */
     makeJoinColumn();
 }
 private void button1_Click(object sender, EventArgs e)
 {
     bool pass = true;
     //perform validation that all fields are populated before saving dataset
     if (listBox1.SelectedItem.ToString() == "Custom Domain" && (comboBox1.Text.Length != 2 ||
         !(comboBox1.Text.StartsWith("X") || comboBox1.Text.StartsWith("Y") || comboBox1.Text.StartsWith("Z"))))
     {
         pass = false;
         MessageBox.Show("Custom Domains must have 2 letter domain name starting with X Y or Z");
     }
     else if (comboBox2.Text == "")
     {
         pass = false;
         MessageBox.Show("Dataset Observation Class MUST be provided");
     }
     else if (textBox1.Text.Length > 40)
     {
         pass = false;
         MessageBox.Show("Dataset Description must be less than 40 characters");
     }
     else if (richTextBox1.Text == "")
     {
         pass = false;
         MessageBox.Show("Dataset Structure must be defined");
     }
     //Save dataset to study if it passed.
     if (pass == true)
     {
         SDTM_Domain thisDomain = new SDTM_Domain();
         thisDomain.Domain_Name = comboBox1.Text;
         thisDomain.Domain_Description = textBox1.Text;
         thisDomain.Domain_Class = comboBox2.Text;
         thisDomain.Domain_Structure = richTextBox1.Text;
         Instance.study.workingSDTM.All_Domains.Add(thisDomain);
         Parent.Reload_Domains();
         this.Close();
     }
 }