Disclosure of Invention
Aiming at the problem that the medical record has a middle folding part like a book, if the size of a printing page is set to be the unfolded size of the medical record, a printing program can print a character in the center of the medical record easily, so that part of the character cannot be printed clearly, and if the size of the printing page is set to be the folded half size of the medical record, abnormal paper output of a printer and multiple paper feeding are required, the application provides a method, a device and a storage medium for overprinting the medical record.
In a first aspect, the present application provides a method for overprinting medical records, comprising the steps of:
s1, manufacturing a template maker;
The step S1 specifically comprises the following steps:
S11, constructing basic elements on Canvas of an HTML5 Canvas, wherein the basic elements comprise tables, characters and data elements, and the characters and the data elements are positioned in cells of the tables;
s12, setting printable attributes for each basic element;
S13, logically dividing the canvas into a plurality of pages;
S14, setting key attributes for each data element, wherein the key attributes comprise field identification, segment names, field types and display formats;
s2, making a medical record template by using the template maker, typesetting the outline position of the medical record by using the table, marking the basic information of the occupied patient by using the data element, and marking the position of the prescription by using the data element;
s3, obtaining medical record data, and filling main table type data in the medical record data into corresponding data element positions in the medical record template according to field identifiers set by data elements in the medical record template;
s4, acquiring prescription data, generating a prescription form according to the data format rule of the template maker by the prescription data, and then inserting the prescription form into a position appointed by the medical record template according to the prescription occupation position marked in the medical record template to generate medical record data;
S5, converting the medical record data into medical record data pictures by pages by utilizing an HTMLcanvas element/toDataURL interface of the HTML5 Canvas, wherein the size of each medical record data picture is the size of the folded medical record;
s6, judging the type of the medical record, if the medical record is of the A4 type or the single-page color printing type, directly sending the medical record data picture to a printer to finish printing the medical record, if the medical record is of the book type, continuously judging the number of pages of the medical record data picture, if the medical record data picture is of the single-page color printing type, executing S7, otherwise executing S8;
S7, transmitting the single medical record data picture to a printer by utilizing WindowsAPI to finish printing of a medical record book;
s8, merging adjacent odd-page pictures and even-page pictures in the medical record data pictures into a picture by using an HTML5 Canvas interface to form spliced medical record pictures;
And S9, transmitting the spliced medical record pictures to a printer by utilizing WindowsAPI so as to carry out medical record overprinting.
By adopting the technical scheme, the HTML5 Canvas is firstly utilized to manufacture a template maker, then the template maker is utilized to manufacture a medical record template, then medical record data and prescription data are acquired and filled into the medical record template to generate the medical record data, the medical record data are converted into medical record data pictures according to pages by utilizing an HTMLcanvas element/toDataURL of an interface of the HTML5 Canvas, then the types of the medical record are judged, the adjacent odd page pictures and even page pictures in the medical record data pictures are combined into one picture by utilizing the HTML5 Canvas interface to form a spliced medical record picture, the spliced medical record picture is transmitted to a printer to be subjected to medical record overprinting, and the printing of the medical record in two halves according to a writing line of the medical record is realized, so that characters in the medical record can be clearly printed, the problem of abnormal paper spitting of the printer is solved, and the printing efficiency, the aesthetic degree and the practical effect of the printer are improved.
Preferably, the step S9 specifically includes:
If the number of pages of the medical record data pictures is even, the spliced medical record pictures only comprise double-page spliced pictures, and at the moment, the double-page spliced pictures are directly sent to a printer by WindowsAPI to carry out medical record overprinting;
If the number of the medical record data pictures is an odd number, the spliced medical record pictures comprise double-page spliced pictures and tail-page pictures, at the moment, the double-page spliced pictures are sent to a printer by utilizing WindowsAPI, and then the tail-page pictures are sent to the printer to carry out medical record overprinting. Thereby adapting even pages of medical record data pictures and odd pages of medical record data pictures.
Preferably, the step S3 specifically includes obtaining medical record data, placing main table data of the medical record data into a Map, wherein the Map contains field identifiers and field values, then finding data elements with the same field identifiers in the medical record template, and setting the field values of the data elements as the field values in the Map. Therefore, the effect of filling the main table type data in the medical record data into the corresponding data element positions in the medical record template according to the field identifiers set by the data elements in the medical record template is achieved.
Preferably, in the step S4, the step of generating a prescription form according to the data format rule of the template maker specifically includes directly assigning a first piece of data of the prescription data to a data line of the medical record template, then inserting an assigned line below the data line, assigning values to the assigned line by using a second piece of data of the prescription data, and assigning the remaining prescription data to the medical record template by using the same method. Thereby inserting all prescription data into the locations specified by the medical record template.
Preferably, in the step S6, the medical record data picture is sent to a printer by WindowsAPI CreateDC, CDC, STARTPAGE, CIMAGE, draow and CDC, enddoc to finish printing the medical record.
Preferably, in the step S7, the single medical record data picture is sent to a printer for medical record overprinting by WindowsAPI CreateDC, CDC STARTPAGE, CIMAGE, draw and CDC EndDoc.
Preferably, in the step S8, the HTML5 Canvas interface includes document, create element, htmlcanvas element, getcontext, and Canvas drawimage.
In a second aspect, the present application further provides a device for overprinting a medical record, which is characterized in that the device includes:
the medical record template making module is configured to make a medical record template;
the medical record data filling module is configured to acquire medical record data and prescription data and fill the medical record data and the prescription data into the medical record template to generate medical record data;
A medical record data picture generation module configured to generate medical record data pictures from the medical record data;
The medical record picture splicing module is configured to combine adjacent odd-page pictures and even-page pictures in the medical record data pictures into one picture to form a spliced medical record picture;
And the printing module is configured to send the medical record data picture or the spliced medical record picture to a printer for overprinting the medical record.
In a third aspect, the present application also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the computing method as described in the first aspect.
In summary, the application at least comprises the following beneficial technical effects:
1. Realizing a template maker which comprises basic elements such as forms, characters, data elements and the like and can be paged;
2. Combining adjacent odd-page pictures and even-page pictures in the medical record data pictures into one picture by utilizing an HTML5 Canvas interface to form spliced medical record pictures, and sending the spliced medical record pictures to a printer to carry out medical record overprinting by utilizing WindowsAPI;
3. the method not only enables the words in the medical record to be printed clearly, but also solves the problem of abnormal paper spitting of the printer, and improves the printing efficiency, the aesthetic degree and the practical effect of the medical record.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 shows a flow chart of a method based on medical record overprinting, and fig. 2 is a schematic diagram of a specific embodiment of the method based on medical record overprinting according to the application, and referring to fig. 1 and 2 in combination, the method specifically comprises the following steps:
s1, manufacturing a template maker;
in a specific embodiment, the template maker may insert basic elements such as tables, text, data elements (a type of data placeholder), and the like. The basic elements in the template support stream typesetting, and any element content and position change can influence typesetting positions of surrounding elements.
In a specific embodiment, the step S1 specifically includes the following steps:
S11, constructing basic elements on Canvas of an HTML5 Canvas, wherein the basic elements comprise tables, characters and data elements, and the characters and the data elements are positioned in cells of the tables;
The template maker is implemented using HTML5 Canvas as the technology base, which provides a Canvas and method of drawing basic text and graphics. The template maker builds basic elements such as a table, characters, data elements and the like on the basis, each basic element is recorded in sequence, the document is internally provided with the table, the table is internally provided with the table row, the table row is internally provided with the cell, the text or the data element in the cell is internally provided with the cell, and when each element changes, the content is drawn, and the streaming typesetting is realized by sequentially drawing the content.
S12, setting printable attributes for each basic element;
Each basic element has a printable attribute, and when the printing interface is executed to generate a picture, an element with printable attribute of false does not call the drawing interface of the HTML5 Canvas and does not draw. But drawing is performed during display, so that preview is convenient.
S13, logically dividing the canvas into a plurality of pages;
the template maker supports paging, the canvas area is logically divided into a plurality of pages according to the set page size and margin, when the canvas area is displayed or printed and drawn, the positions of all elements on the template are calculated, the positions are compared with the page size and margin, and the part exceeding one page is drawn into the next page, so that automatic paging processing is realized.
S14, setting key attributes for each data element, wherein the key attributes comprise field identification, segment names, field types and display formats;
The fields function as follows:
And the field identifier is used for filling the value into the corresponding data element after the back-end data is acquired. Corresponding to the English name of the field in the database table.
Field name-for displaying the field to be filled.
Field type-field type for identifying the field type to be filled, facilitating special handling of numbers and time types, e.g., reserved decimal, time format, etc.
The display format identifies a format for recording the display, such as a reserved fraction, a time format, etc.
S2, the template maker is utilized to make a medical record template, wherein the table is used for typesetting the outline position of the medical record, the data element is used for marking the basic information of the occupied patient, and the data element is used for marking the position of the prescription, and the template is a schematic diagram of the manufactured medical record template as shown in FIG. 3.
S3, obtaining medical record data, and filling main table type data in the medical record data into corresponding data element positions in the medical record template according to field identifiers set by data elements in the medical record template;
In a specific embodiment, the step S3 specifically includes obtaining medical record data, placing main table class data of the medical record data into a Map, wherein the Map contains field identifications and field values, then finding data elements with the same field identifications in the medical record template, and setting the field values of the data elements as the field values in the Map.
When the printing program is executed, patient data, prescription data and the like in the system are extracted, and data of main table type data (only one data record, such as patient information data including patient name and age) is automatically filled into corresponding data element positions in the template according to field identifiers set by data elements in the template. The automatic filling process is as follows, only one piece of data is obtained after the main table data is obtained, the data is put into a Map, the key of the Map is a data element field identifier, and Value is a Value of a changed field, for example, the name key is a candidate_name, vlaue is a three-page. The data element with the field mark of the partial_name is found in the template data model, and the setter value is Zhang Sany.
S4, acquiring prescription data, generating a prescription form according to the data format rule of the template maker by the prescription data, and then inserting the prescription form into a position appointed by the medical record template according to the prescription occupation position marked in the medical record template to generate medical record data;
In a specific embodiment, as shown in fig. 4, in step S4, the generating a prescription form according to the data format rule of the template maker specifically includes directly assigning a first piece of data of the prescription data to a data line of the medical record template, inserting an assigned line below the data line, assigning the assigned line with a second piece of data of the prescription data, and assigning the remaining prescription data to the medical record template in the same manner. The completed medical record data is shown in fig. 5.
S5, converting the medical record data into medical record data pictures according to pages by utilizing an HTMLcanvas element/toDataURL interface of the HTML5 Canvas, wherein the size of each medical record data picture is the folded size of the medical record, and converting a plurality of pages of the medical record data into a plurality of pictures.
S6, judging the type of the medical record, if the medical record is of the A4 type or the single-page color printing type, directly sending the medical record data picture to a printer to finish printing the medical record, if the medical record is of the book type, continuously judging the number of pages of the medical record data picture, if the medical record data picture is of the single-page color printing type, executing S7, otherwise executing S8;
In a specific embodiment, in the step S6, the medical record data picture is sent to a printer by WindowsAPI CreateDC, CDC STARTPAGE, CIMAGE, draow and CDC Enddoc to complete printing of the medical record. As shown in FIG. 6, the medical record is of the A4 type or the single-page color printing type, and as shown in FIG. 7, the medical record is of the book type.
S7, transmitting the single medical record data picture to a printer by utilizing WindowsAPI to finish printing of a medical record book;
In a specific embodiment, in the step S7, a single picture of the medical record data is sent to a printer for medical record overprinting by WindowsAPI CreateDC, CDC STARTPAGE, CIMAGE, draow, CDC Enddoc.
S8, merging adjacent odd-page pictures and even-page pictures in the medical record data pictures into a picture by using an HTML5 Canvas interface to form spliced medical record pictures;
In a specific embodiment, in the step S8, the HTML5 Canvas interface includes document, create element, htmlcanvas element, getcontext, and Canvas drawimage.
And S9, transmitting the spliced medical record pictures to a printer by utilizing WindowsAPI so as to carry out medical record overprinting.
In a specific embodiment, the S9 specifically includes:
If the number of pages of the medical record data pictures is even, the spliced medical record pictures only comprise double-page spliced pictures, and at the moment, the double-page spliced pictures are directly sent to a printer by WindowsAPI to carry out medical record overprinting;
If the number of the medical record data pictures is an odd number, the spliced medical record pictures comprise double-page spliced pictures and tail-page pictures, at the moment, the double-page spliced pictures are sent to a printer by utilizing WindowsAPI, and then the tail-page pictures are sent to the printer to carry out medical record overprinting.
Referring to fig. 8, if the number of medical record pictures is greater than 1, the even-multiple pictures and the odd-multiple pictures are synthesized into one picture according to data by using the HTML5 Canvas technology, and the size is just the size of the medical record after the medical record is unfolded. If 5 pictures are available, the 1 st picture and the 2 nd picture are spliced together, the 3 rd picture and the 4 th picture are spliced together, and the size of the spliced pictures is just equal to the size of the medical record book after being unfolded. The spliced pictures are sequentially used for sending picture data to a printer by WindowsAPI CreateDC, CDC, STARTPAGE, CIMAGE, draow and CDC, enddoc. If the last picture is left, such as the 5 th picture in the example, the last picture is used for sending picture data to a printer by WindowsAPI CreateDC, CDC, STARTPAGE, CIMAGE, draow and Enddoc to finish the printing of the medical record. As shown in fig. 9 and 10, fig. 9 is a schematic diagram in the printing of the medical record, and fig. 10 is an effect diagram after the printing of the medical record.
With further reference to fig. 11, as an implementation of the method described above, the present application provides an embodiment of an apparatus for overprinting medical records, where the system embodiment corresponds to the method embodiment shown in fig. 1, and the system is particularly applicable to various electronic devices.
Referring to fig. 11, an apparatus for overprinting medical records includes:
a medical record template making module 101 configured to make a medical record template;
A medical record data filling module 102 configured to obtain medical record data and prescription data, and fill the medical record data and prescription data into the medical record template to generate medical record data;
a medical record data picture generation module 103 configured to generate a medical record data picture from the medical record data;
a spliced medical record picture module 104, configured to combine adjacent odd page pictures and even page pictures in the medical record data pictures into a picture, so as to form a spliced medical record picture;
And the printing module 105 is configured to send the medical record data picture or the spliced medical record picture to a printer for medical record overprinting.
Referring now to FIG. 12, a schematic diagram of a computer system 200 suitable for use in implementing an electronic device of an embodiment of the present application is shown. The electronic device shown in fig. 12 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the application.
As shown in fig. 12, the computer system 200 includes a Central Processing Unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data required for the operation of the system 200 are also stored. The CPU 201, ROM 202, and RAM 203 are connected to each other through a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
Connected to the I/O interface 205 are an input section 206 including a keyboard, a mouse, and the like, an output section 207 including a Liquid Crystal Display (LCD) and the like and a speaker and the like, a storage section 208 including a hard disk and the like, and a communication section 209 including a network interface card such as a LAN card, a modem, and the like. The communication section 209 performs communication processing via a network such as the internet. The drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 210 as needed, so that a computer program read out therefrom is installed into the storage section 208 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 209, and/or installed from the removable medium 211. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 201.
As another aspect, the present application also provides a computer-readable storage medium that may be included in the electronic device described in the above embodiment, or may exist alone without being incorporated into the electronic device. The computer-readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the method as shown in fig. 1.
The computer readable storage medium according to the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
While the application has been described with reference to specific embodiments, the scope of the application is not limited thereto, and any changes or substitutions can be easily made by those skilled in the art within the scope of the application disclosed herein, and are intended to be covered by the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
In the description of the present application, it should be understood that the directions or positional relationships indicated by the terms "upper", "lower", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of description and simplification of the description, and do not indicate or imply that the apparatus or element in question must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present application. The word 'comprising' does not exclude the presence of elements or steps not listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims shall not be construed as limiting the scope.