Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a method for converting medical data in different formats, which improves the efficiency.
In order to achieve the purpose, the invention adopts the following technical scheme:
a medical data standard conversion method is used for converting medical data in different formats, and is characterized by comprising the following steps: acquiring medical data in a first format, wherein the medical data in the first format comprises nodes, relationships among the nodes, node attributes and attribute values of the node attributes; acquiring a set of second-format medical data templates, wherein the second-format medical data templates comprise nodes, relationships among the nodes and node attributes; acquiring a mapping relation between a set of first format medical data templates and a set of second format medical data templates; obtaining a second format data template corresponding to the first format medical data according to the mapping relation; and extracting the attribute value of the medical data in the first format according to the object, and assigning values to the corresponding medical data template in the second format to obtain the medical data in the second format.
As a further improvement of the present invention, the second-format medical data template further includes a node flag bit, and the step of obtaining the second-format data template corresponding to the first-format medical data according to the mapping relationship includes the following steps: setting the node marking bit in the second format medical data template as a default value; traversing nodes of the medical data in the first format, and changing the numerical value of the corresponding node marking bit of the medical data template in the second format according to the nodes of the medical data in the first format and the relationship among the nodes; and obtaining a corresponding medical data template in a second format.
As a further improvement of the present invention, the step of extracting the attribute value of the medical data in the first format according to the subject and assigning a value to the corresponding medical data template in the second format to obtain the medical data in the second format includes the following steps: acquiring attribute values of node attributes in the medical data in the first format; extracting attribute values of node attributes in the first-format medical database according to the object; and assigning the extracted attribute value to obtain the corresponding attribute of the second database template.
As a further improvement of the present invention, in the step of obtaining the second format medical data template corresponding to the first format medical data according to the mapping relationship, the method includes the steps of: traversing nodes of the first format medical data; and acquiring a corresponding second-format medical data template according to the mapping relation and the nodes of the first-format medical data.
As a further improvement of the present invention, in the step of obtaining the second format medical data template corresponding to the first format medical data according to the mapping relationship, the method includes the steps of: acquiring mapping between the serial number of the medical data template in the first format and the serial number of the medical data template in the second format; and obtaining the template number of the medical data in the second format according to the template number of the medical data in the first format, and generating a corresponding medical data template in the second format.
As a further improvement of the invention, the first format medical data is HL7V2 format data, and the second format medical data is HL7V3 format data.
As a further improvement of the invention, the object content is added manually.
The invention has the beneficial effects that: compared with the prior art, the method and the device can perform data conversion without completely reading and writing the information of the medical data in the first format, so that the conversion efficiency between the medical data in different formats is greatly improved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Detailed Description
The invention will be further described with reference to the accompanying drawings and the detailed description below:
referring to fig. 1, in a first embodiment, the medical data standard conversion method includes the following steps:
s110, acquiring medical data in a first format, wherein the medical data in the first format comprises nodes, relationships among the nodes, node attributes and attribute values of the node attributes.
Specifically, in the present embodiment, the HL7V2 format is described as a specific example of the first format medical data. An example of data in the format of HL7V2 is now given:
MSH|^~\&|NIS||HIS||20151214164326||RAS^O17|NIS_978125592798|P|2.4
PID 000157882601|0000377419| Li Whitmanian (infant 1) |20151204102400| M,
the message information of each line starts with an identifier represented by three capital English letters and represents a node, the messages are separated by symbols of |, &, \\ and the like, different attributes are represented among the separators, the values are the attribute values, and the nodes have certain relations. In the above data, if a part in which basic information on inpatients is mainly used, in the parsing process, basic information on patients is mainly obtained from a combination of prefix characters PID of the information and | symbols in the message, and attributes of the information on the patients are assigned, a patient visit number, patientNo, is defined as 00015788260, a patient visit card number, cardNo, is defined as 0000377419, a patient name, li huimin, a patient visit time, is defined as 20151204102400 (which can be converted into a standard time, 2015.12.410:24:00), and a patient gender, sex, is M (male).
And S130, acquiring a set of second-format medical data templates, wherein the second-format medical data templates comprise nodes, relations among the nodes and node attributes.
Specifically, in the present embodiment, the HL7V3 format is used as a specific example of medical data in the second format, and the HL7V3 format is a tree-like and hierarchical structure in the XML format, and is highly readable. Moreover, the node attribute of the data in the format is very comprehensive and is far more than that of the corresponding HL7V2 format. But different nodes, HL7V2 format data of the relationship between the nodes, which have one-to-one correspondence, may have HL7V3 format data templates, which all include the nodes, the relationship between the nodes, and the node attributes, but the attribute values of the node attributes are default. These different HL7V3 format data templates are grouped together to form corresponding groups.
S150, acquiring the mapping relation between the set of the first-format medical data template and the set of the second-format medical data template.
Specifically, the templates in the HL7V2 and HL7V3 formats have a one-to-one mapping relationship, and here, the mapping relationship between the corresponding set of HL7V2 templates and the set of HL7V3 templates can be obtained.
S170: and obtaining a second format medical data template corresponding to the first format medical data according to the mapping relation.
Specifically, the method can determine which HL7V2 format template the HL7V2 format data belongs to, and then find the corresponding HL7V3 format template according to the mapping relationship.
S190: and extracting the attribute value of the medical data in the first format according to the object, and assigning values to the corresponding medical data template in the second format to obtain the medical data in the second format.
Specifically, the attribute values of the corresponding attributes in the HL7V2 format data are extracted according to the selected attributes in the object, and then the attribute values are assigned to the HL7V3 format template, so that the format data of HL7V3 corresponding to the HL7V2 format data is obtained. Preferably, the attributes in the object can be manually added according to actual needs.
Referring to fig. 2, in the second embodiment, compared with the first embodiment, the step S170 includes the following steps:
and S171, setting the node marking bit in the second format medical data template as a default value.
Specifically, a node flag bit is included in the HL7V3 format template, and is used for marking a corresponding node of the corresponding HL7V2 format data, and the node flag bit is set as a default value.
And S173, traversing the nodes of the medical data in the first format, and changing the numerical values of the corresponding node marking bits of the medical data template in the second format according to the nodes of the medical data in the first format and the relationship among the nodes.
Specifically, when the traversed node has a corresponding node in the HL7V2 format data, the node is marked with a bit, which indicates that the node needs to be used in the HL7V3 format. In the process of traversing HL7V2 format data, the relationship between the nodes of HL7V3 format data is changed simultaneously.
And S175, obtaining a corresponding medical data template in a second format.
Specifically, when a node in the HL7V3 format data template is not a default value, the node is required, and when the node is still the default value, the corresponding node is not required, and can be discarded, so that a simplified HL7V3 format data template is formed. Therefore, in the subsequent data processing process, the size of the data volume can be reduced, and the conversion efficiency is further improved.
Referring to fig. 3, in the third embodiment, compared with the first embodiment, the step S190 includes the following steps:
s191: attribute values of node attributes in the first-format medical data are acquired.
Specifically, after the HL7V3 format template corresponding to the HL7V2 format data is obtained, all the attribute values of the node attributes in the HL7V2 format data are extracted.
S193: attribute values of node attributes in the first-format medical database are extracted from the subject.
Specifically, the corresponding attribute values in the HL7V2 format data are extracted according to the required node attributes in the object.
S195: and assigning the extracted attribute value to obtain the corresponding attribute of the second database template.
Specifically, the attribute values proposed in the H7V2 format data are assigned to the HL7V3 format template to obtain the corresponding HL7V3 format data.
Referring to fig. 4, in the fourth embodiment, compared with the first embodiment, the step S170 includes the following steps:
s1711: nodes of the first format medical data are traversed.
Specifically, the nodes of the HL7V2 format data are traversed, so as to determine the format category of the HL7V2 format data.
S1713: and acquiring a corresponding second-format medical data template according to the mapping relation and the nodes of the first-format medical data.
Specifically, the HL7V2 format template corresponding to the HL7V2 format data can be determined according to the result of the traversal, and then the corresponding HL7V3 format template can be obtained according to the mapping relationship.
Referring to fig. 5, in the fifth embodiment, compared with the first embodiment, the step S170 includes the following steps:
s1712: and acquiring the mapping of the serial number of the medical data template with the first format and the serial number of the medical data template with the second format.
Specifically, because the HL7V2 and HL7V3 format templates are in a one-to-one correspondence relationship, the format data are numbered directly in the using process, so that the data can be known to belong to the data template of that type, for example, when a certain HL7V2 format data is numbered as V2001, the corresponding HL7V 3526 format template can be known to be the 001 th template, and the HL7V3 format template corresponding to the former template is also the 001 th template, so that the acquisition of the corresponding template in the following steps is facilitated, and the data processing amount is greatly reduced.
S1714: and obtaining the template number of the medical data in the second format according to the template number of the medical data in the first format, and generating a corresponding medical data template in the second format.
Specifically, from the number mapping obtained in the above step, the HL7V3 format template is directly obtained from the number of the HL7V2 format data.
Of course, it will be understood by those skilled in the art that the present embodiment is described with only the conversion of data in the HL7V2 and HL7V3 formats, but other data with nodes, relationships between nodes, node attributes, and attribute values of the node attributes can be directly converted by the method disclosed in the present invention.
Various other changes and modifications to the above-described embodiments and concepts will become apparent to those skilled in the art from the above description, and all such changes and modifications are intended to be included within the scope of the present invention as defined in the appended claims.