FDA_Report_Data Class
Class stores all the important data from a FDA Ingest Report
Namespace: SobekCM.Tools.FDAAssembly: SobekCM_Tools (in SobekCM_Tools.dll) Version: 4.10.0.0 (4.10.0)
Syntax
C# |
---|
public class FDA_Report_Data |
Examples
Example #1 - Simple code to read a FDA report, save it to the database, and write it to another location
| Copy |
---|
public void Read_And_Save_Report(string Source, string Destination)
{
FDA_Report_Data reportData = FDA_Report_Reader.Read(Source);
if (reportData.Report_Type != FDA_Report_Type.INVALID)
{
if ( reportData.Save_To_Database())
{
File.Delete( Source );
FDA_Report_Writer.Write( reportData, Destination );
}
}
} |
Example #2 - Below is the actual implemenation used by the FDA_Report_Processor.Process method of the FDA_Report_Processor class:
| Copy |
---|
public void Process()
{
string[] xml_files;
if (recurse)
{
xml_files = get_reports_recursively(source_directory);
}
else
{
xml_files = Directory.GetFiles(source_directory, "*.xml");
}
int count = 0;
bool database_successful = true;
bool rewrite_successful = true;
foreach (string thisXML in xml_files)
{
if ((thisXML.IndexOf(".brief.xml") < 0) || (include_brief))
{
FDA_Report_Data data = UF.FDA.Core.FDA_Report_Reader.Read(thisXML);
if (data.Report_Type != FDA_Report_Type.INVALID)
{
OnNewProgress(++count, 2 * (xml_files.Length + 2));
database_successful = true;
rewrite_successful = true;
if (((write_brief_always) || ((write_brief_on_warning) && (data.Warnings > 0)))
&& ((data.Report_Type == FDA_Report_Type.INGEST) || (data.Report_Type == FDA_Report_Type.DISSEMINATION)))
{
if (!FDA_Report_Writer.Write(data, data.FileName.Replace(".xml", ".brief.xml")))
{
rewrite_successful = false;
}
}
if (save_to_db)
{
if (!data.Save_To_Database())
{
database_successful = false;
}
}
if ((data.Report_Type != FDA_Report_Type.ERROR) && (delete) && (database_successful) && (rewrite_successful))
{
try
{
File.Delete(data.FileName);
}
catch
{
System.Windows.Forms.MessageBox.Show("Unable to delete '" + data.FileName + "'");
}
}
results_form.Add_To_ResultTable(data.Package, data.IEID, data.Report_Type_String, data.Date.ToShortDateString(), data.Warnings, data.Files.Count, data.Message_Note);
results_form.Add_Complete_Report_Object(data);
}
}
OnNewProgress(++count, 2 * (xml_files.Length + 2));
}
if (xml_files.Length == 0)
{
System.Windows.Forms.MessageBox.Show("No valid FDA reports found! ", "No Reports", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
return;
}
OnNewProgress(xml_files.Length + 2, xml_files.Length + 2);
} |
Inheritance Hierarchy
Constructors
| Name | Description |
---|
| FDA_Report_Data | Constructor creates a new instance of the FDA_Report_Data class |
Methods
Properties
| Name | Description |
---|
| Account | Gets the account information submitted with this package |
| Date | Gets the date this report was created |
| FileName | Gets or sets the name of the file read for this report |
| Files | Gets the collection of files associated with this IEID |
| IEID | Gets the IEID (Intellectual Entity ID) for this FDA report |
| Message_Note | Gets the message or note returned with the report |
| Package | Gets the submitted package name for this IEID |
| Project | Gets the project information submitted with this package |
| Report_Type | Gets or sets the type of report which generated this data |
| Report_Type_String | Gets the report type as a string |
| Warnings | Gets or sets the number of warnings in this package |
See Also