Disclosure of Invention
The invention aims to create a novel automatic report generation framework, define a corresponding data structure, be quickly applied to result content presentation of each analysis project, unify output styles, improve automation degree and improve efficiency.
The invention provides an automatic report generation method, which comprises the following steps:
a) defining a reporting model data structure comprising: report information structure and report body structure:
the report information structure comprises initial input information of the report, is used for rendering to the starting position of the webpage report and is used for displaying report content;
the report body structure enables recursive loading;
b) an automated method of reporting inclusion of a body structure, comprising:
the add _ section method is used for automatically adding the sub-body structure, reading the corresponding description information from the configured yaml file according to the name, and automatically rendering the description information into a web page structure or a word structure;
the add _ fig/add _ plot method is used for dynamically increasing the picture results generated in the report, wherein when the corresponding results in the report are matched, universal matching is carried out by using a star number; meanwhile, when a netpage structure of the pictures needs to be generated, the picture sequence and chapters are automatically recorded; the click browsing of the pictures can be realized; when a webpage report structure is generated, the picture elements comprise thumbnails embedded in the webpage and links which point to actual files in a specific report folder for report query;
the add _ table method is used for dynamically adding table files in the webpage report, and the table files can be used for intelligently reading the table files generated by the report; meanwhile, click sequencing of each column in a webpage report can be realized, when the number of rows of a table file is more than 20, a quick search module can be added, and logic is designed for a rolling bar when the content of cells in the table is more;
add _ comment method for adding extra fields between report pictures and tables;
a write _ to method for saving the main result as a web page structure and a word structure;
automatically unfolding the help information when accessing the website page for the first time, and accessing the automatically folded help information again;
the help text display of all areas in the webpage is set to be hovering a mouse to display corresponding text help information;
c) actual production usage logic
Configuring corresponding production documents according to corresponding products, combining scripts, and automatically generating a netpage report according to document contents and logic and display contents set by the method; the relevant interactive content is automatically generated in the report.
Wherein the initial input information comprises a project name, a customer name, a unit and a sample type.
Wherein the body structure contains the following key fields:
the name is used for determining a corresponding chapter;
the description is used for confirming corresponding chapter description information, wherein the description can support input markdown format and is used for more flexible webpage frame presentation;
help _ text is used to display help information;
iv _ results for storing the automatically added report sub-body structures in order;
FAQ is used for automatically storing FAQ information of corresponding chapters and is used for collecting, sorting and displaying the FAQ information in a specific area of a report;
and the reference is used for automatically storing the reference information in the chapter description, and automatically generating reference in a specific area of the report when the report is finally generated and realizing the function of click jump.
Based on the method, the invention also provides an automatic report generation system, which comprises the following modules:
a definition module for defining a reporting model data structure, comprising: a report information structure and a report body structure;
an automation module for reporting automation of the subject structure;
the logic module is used for configuring a corresponding production document according to a corresponding product, combining a script and combining the set logic and display content of the method according to the content of the document to automatically generate a netpage report; the relevant interactive content is automatically generated in the report.
The automatic report generation method and the automatic report generation system realize highly uniform report output and strengthen the style uniformity. And automatically generating a word report while generating the webpage report, and automatically inserting a link into the word report to automatically generate a document directory. The generated webpage report is only stored as a single file, all data are stored in the file and presented uniformly, and display errors are avoided. The webpage report is full of various interactive operation contents, and the result can be conveniently checked by a client.
Detailed Description
The invention is further described in detail with reference to the following specific examples and the accompanying drawings. The procedures, conditions, experimental methods and the like for carrying out the present invention are general knowledge and common general knowledge in the art except for the contents specifically mentioned below, and the present invention is not particularly limited.
The automatic report generation method provided by the invention comprises the following steps:
b) definitional report model data structure and related method
c) A report information structure, which contains the initial input information of the report, such as project name, customer name, unit, sample type, and the like, and is finally used for rendering to the starting position of the webpage report for displaying the report content;
d) and the report comprises a key main body structure, and the main body structure can realize recursive loading.
The body structure contains several key fields:
the name is used for determining a corresponding chapter;
the description is used for confirming corresponding chapter description information, wherein the description can support input markdown format and is used for more flexible webpage frame presentation;
help _ text is used to display help information;
iv _resultsis used to store the automatically added report sub-body structures in order,
FAQ is used for automatically storing FAQ information of corresponding chapters and is used for collecting, sorting and displaying the FAQ information in a specific area of a report;
and the reference is used for automatically storing the reference information in the chapter description, and automatically generating reference in a specific area of the report when the report is finally generated and realizing the function of click jump.
The subject structure includes an automated method:
the add _ section method is used for automatically adding a sub-body structure, reading corresponding description information from a configured yaml file according to the name, and automatically rendering the description information into a web page structure or a word structure;
the add _ fig/add _ plot method is used for dynamically increasing picture results generated in the report, wherein when corresponding results in the report are matched, universal matching can be performed by using a # number; meanwhile, when a netpage structure of pictures is generated, the picture sequence and chapters are automatically recorded. The click browsing of the pictures can be realized. When generating a web page report structure, the picture elements contain thumbnails embedded in the web page and links to the actual files in the specific report folder for the report query.
And the add _ table method is used for dynamically adding table files in the webpage report, and the table files can be used for intelligently reading the table files generated by the report. Meanwhile, click sequencing of each column in a webpage report can be realized, when the number of rows of the table file is more than 20, a quick search module can be added, and logic is designed for a scroll bar when the content of cells in the table is more.
Add _ comment method is used to add additional fields between report pictures and tables.
The write _ to method is used to save the subject results as a web page structure and a word structure.
Actual production usage logic
According to the corresponding product, the corresponding production document is configured, and in combination with the script, the netpage report can be automatically generated according to the document content in combination with the logic and display content set by the method. The relevant interactive content is automatically generated in the report.
The invention provides an automatic report generation system, which comprises the following modules:
a definition module for defining a reporting model data structure, comprising: a report information structure and a report body structure;
an automation module for reporting automation of the subject structure;
the logic module is used for configuring a corresponding production document according to a corresponding product, combining a script and combining the set logic and display content of the method according to the content of the document to automatically generate a netpage report; the relevant interactive content is automatically generated in the report.
Example 1
The webpage report of the conventional project of the Ouyi biological Agilent chip (corresponding to FIG. 1).
1. Preparation work
a) Preprocessing document information;
b) extracting and corresponding the document information of the analysis module, such as name correspondence, description information correspondence, help information correspondence, picture information processing, table information processing and annotation information processing;
2. analytical procedure
a) After the analysis process 1 is finished, extracting data of the preprocessing information to generate an analysis process document 1;
b) after the analysis process 2 is finished, extracting data of the preprocessed information to generate an analysis process document 2;
c) by analogy, after each analysis process is finished, generating a document of the corresponding process;
3. report generation
a) Automatically integrating each process document obtained based on the analysis process into a finished webpage report;
b) and converting the report into a corresponding document report based on the webpage.
4. The embodiment is mainly used for generating the document and integrating and combining the existing flow for use.
Example 2
A web page report of the euryoyi organism whole transcriptome project (corresponding to fig. 2).
1. Preparation work
a) Preprocessing document information;
b) extracting and corresponding the document information of the analysis module, such as name correspondence, description information correspondence, help information correspondence, picture information processing, table information processing and annotation information processing;
2. analytical procedure
a) The analysis process automatically generates corresponding results according to preset scripts respectively;
3. document generation
a) Automatically extracting document information in preparation work according to a document result generated in the analysis process, and generating each document module;
4. report generation
a) Automatically integrating each process document obtained based on the analysis process into a finished webpage report;
b) and converting the report into a corresponding document report based on the webpage.
5. The method is mainly used for combining the existing analysis process with the document generated by the automatic report.
Example 3
Automated web reporting of the ouyi biocontrol project (corresponding to fig. 3).
1. Preparation (none)
2. Analysis process and document generation
a) The document content can be flexibly integrated with each quality control step in the analysis process;
b) after the analysis is finished, generating a document module in each step;
3. report generation
a) Automatically integrating each process document obtained based on the analysis process into a finished webpage report;
b) and converting the report into a corresponding document report based on the webpage.
4. The embodiment is mainly used for generating and using personalized or customized module analysis documents.
The protection of the present invention is not limited to the above embodiments. Variations and advantages that may occur to those skilled in the art may be incorporated into the invention without departing from the spirit and scope of the inventive concept, and the scope of the appended claims is intended to be protected.