Data conversion method and device, electronic equipment, storage medium and computer program product

By generating automated code between medical business systems, the problem of low data conversion efficiency between these systems was solved, and a highly efficient data conversion process was achieved.

CN122113852APending Publication Date: 2026-05-29CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD
Filing Date
2024-11-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Data conversion between medical business systems is inefficient and requires a large amount of conversion code to be written manually, resulting in high labor and time costs.

Method used

Based on the common medical business processes between medical business systems, the system automatically generates first and second codes. It accesses the fields of the first data structure through the first expression and generates the first code, and uses the set mapping relationship to generate the second code for data conversion.

Benefits of technology

It reduced labor and time costs, improved data conversion efficiency, and achieved an automated data conversion process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113852A_ABST
    Figure CN122113852A_ABST
Patent Text Reader

Abstract

The application discloses a data conversion method and device, electronic equipment, a storage medium and a computer program product. The method comprises the following steps: generating one or more first expressions and one or more second expressions based on a medical business process common to a first medical business system and a second medical business system; generating a first code based on the one or more first expressions; the first code is used for processing data of a first data structure to output a set composed of values of all first fields in the data of the first data structure; generating a second code based on a first set mapping relationship and the one or more second expressions; the second code is used for processing the set output by the first code and the first set mapping relationship to output data of a second data structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a data conversion method, apparatus, electronic device, storage medium, and computer program product. Background Technology

[0002] In related technologies, medical data interoperability involves data conversion between multiple medical business systems. However, the data structure of data in medical business systems is relatively complex, requiring a large amount of conversion code to be written manually, which results in low data conversion efficiency. Summary of the Invention

[0003] To address the related technical problems, embodiments of this application provide a data conversion method, apparatus, electronic device, storage medium, and computer program product.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a data conversion method, the method comprising:

[0006] Based on the common medical business processes in the first and second medical business systems, one or more first expressions and one or more second expressions are generated; wherein, each of the one or more first expressions is used to access a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first defined mapping relationship between the first field and the second field;

[0007] Based on the one or more first expressions, a first code is generated; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0008] Based on the first defined mapping relationship and the one or more second expressions, a second code is generated; the second code is used to process the set of outputs of the first code and the first defined mapping relationship to output the data of the second data structure.

[0009] In the above scheme, the generation of one or more first expressions and one or more second expressions based on the common medical business processes in the first and second medical business systems includes:

[0010] Based on the common medical business processes in the first medical business system and the second medical business system, the first data of the first data structure and the second data of the second data structure are generated.

[0011] Based on the first data, a first metadata definition corresponding to the first data structure is generated, and based on the second data, a second metadata definition corresponding to the second data structure is generated;

[0012] A first type of definition is generated based on the first metadata definition, and a second type of definition is generated based on the second metadata definition;

[0013] The first expression is generated based on the first class definition, and the second expression is generated based on the second class definition.

[0014] The method in the above scheme further includes:

[0015] Process each code segment in the first resource and one or more code segments to obtain the error type corresponding to each code segment; wherein,

[0016] The one or more code fragments are derived from the first code and / or the second code; the first resource represents a resource defined by the Fast Medical Interconnection Resource (FHIR) standard.

[0017] In the above scheme, the second data structure conforms to the FHIR standard;

[0018] The error type indicates one or more cases where the data structure of the data output by the second code does not conform to the FHIR standard.

[0019] The method in the above scheme further includes:

[0020] If the error type representation of the first code segment in the one or more code segments is that the first code segment caused the code error, output the code location of the first code segment.

[0021] The method in the above scheme further includes:

[0022] The first code is invoked to process the first string data of the first data structure to obtain a first set; the first set represents the set composed of all the values ​​of the first field in the first string data;

[0023] The second code is invoked to process the first set and the first set mapping relationship to obtain the first string data of the second data structure.

[0024] In the above scheme, the step of calling the first code to process the first string data of the first data structure to obtain the first set includes:

[0025] Based on the first metadata definition, the first string data of the first data structure is deserialized to obtain the first object data of the first data structure.

[0026] Based on each of the one or more first expressions, access the corresponding first field in the first object data of the first data structure to obtain the first set.

[0027] In the above scheme, the step of calling the second code to process the first set and the first set mapping relationship to obtain the first string data of the second data structure includes:

[0028] Based on the first established mapping relationship, determine one or more second fields that match one or more first fields in the first set;

[0029] Based on each of the one or more second expressions, assign a value to the corresponding second field in the second object data of the second data structure;

[0030] Based on the second metadata definition, the second object data of the second data structure is serialized to obtain the first string data of the second data structure.

[0031] This application embodiment also provides a data conversion apparatus, including:

[0032] The first generation unit is used to generate one or more first expressions and one or more second expressions based on the common medical business processes in the first medical business system and the second medical business system; wherein each of the one or more first expressions is used to access a first field set in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first set mapping relationship between the first field and the second field;

[0033] The second generation unit is used to generate first code based on the one or more first expressions; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0034] The third generation unit is used to generate second code based on the first set mapping relationship and the one or more second expressions; the second code is used to process the set of outputs of the first code and the first set mapping relationship to output the data of the second data structure.

[0035] This application also provides an electronic device, including: a first processor and a first communication interface; wherein,

[0036] The first processor is configured to generate one or more first expressions and one or more second expressions based on a common medical business process in both the first and second medical business systems; wherein each of the one or more first expressions is used to access a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; a first defined mapping relationship exists between the first field and the second field;

[0037] Based on the one or more first expressions, a first code is generated; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0038] Based on the first defined mapping relationship and the one or more second expressions, a second code is generated; the second code is used to process the set of outputs of the first code and the first defined mapping relationship to output the data of the second data structure.

[0039] This application also provides an electronic device, including: a first processor and a first memory for storing a computer program capable of running on the processor.

[0040] Wherein, when the first processor is used to run the computer program, it executes the steps of any of the above methods.

[0041] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0042] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0043] In this embodiment, based on the common medical business processes in the first and second medical business systems, one or more first expressions and one or more second expressions are generated. Each of the one or more first expressions accesses a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions assigns a value to a second field in a second data structure supported by the second medical business system. A first predetermined mapping relationship exists between the first and second fields. Then, based on the one or more first expressions, first code is generated. This first code processes the data in the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure. Furthermore, based on the first predetermined mapping relationship and the one or more second expressions, second code is generated. This second code processes the set output by the first code and the first predetermined mapping relationship to output the data in the second data structure. Thus, based on the common medical business processes, first and second codes for data conversion are automatically generated. Compared to related technologies, data conversion can be performed based on automatically generated code, reducing labor and time costs, thereby improving the efficiency of data conversion. Attached Figure Description

[0044] Figure 1 A schematic diagram illustrating the implementation flow of a data conversion method provided in an embodiment of this application;

[0045] Figure 2 A schematic diagram of metadata definition provided for an embodiment of this application;

[0046] Figure 3 A schematic diagram of a class definition provided for an embodiment of this application;

[0047] Figure 4 A schematic diagram illustrating the generation of a class definition provided in an embodiment of this application;

[0048] Figure 5 A schematic diagram illustrating another class definition generation method provided in this application embodiment;

[0049] Figure 6 A schematic diagram of a model structure provided for an embodiment of this application;

[0050] Figure 7 A schematic diagram illustrating the workflow of a code generation engine provided for an application embodiment of this application;

[0051] Figure 8 A schematic diagram illustrating the workflow of another code generation engine provided for an application embodiment of this application;

[0052] Figure 9This is a schematic diagram of the structure of a data conversion device provided in an embodiment of this application;

[0053] Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0054] With the development of medical informatization, medical data interoperability has become an important way to promote medical information sharing and ensure the orderly scheduling between medical business systems. In related technologies, medical data interoperability involves data exchange between multiple medical business systems. In practical applications, the multiple medical business systems used by hospitals are usually built by multiple vendors at different times. These systems differ in interface design and business implementation logic, resulting in different data structures supported by each system. Therefore, data conversion is needed to transform the data structure of data from one medical business system to the data structure supported by another system before data exchange between the two systems can occur. However, the data structures in medical business systems are quite complex, requiring extensive manual coding for data conversion, which consumes significant manpower and time, leading to low efficiency.

[0055] Based on this, in this embodiment, based on the common medical business processes in the first and second medical business systems, one or more first expressions and one or more second expressions are generated. Each of the one or more first expressions is used to access a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system. A first predetermined mapping relationship exists between the first field and the second field. Then, based on the one or more first expressions, first code is generated. The first code processes the data in the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure. Furthermore, based on the first predetermined mapping relationship and the one or more second expressions, second code is generated. This second code processes the set output by the first code and the first predetermined mapping relationship to output the data in the second data structure. Thus, based on the common medical business processes, first and second codes for data conversion are automatically generated. Compared to related technologies, data conversion can be performed based on automatically generated code, reducing labor and time costs, thereby improving the efficiency of data conversion.

[0056] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.

[0057] This application provides a data conversion method, see [link to relevant documentation] Figure 1 The method includes:

[0058] Step 101: Based on the common medical business processes in the first and second medical business systems, generate one or more first expressions and one or more second expressions.

[0059] Wherein, each of the one or more first expressions is used to access a first field set in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first set mapping relationship between the first field and the second field.

[0060] In practical applications, the first and second medical business systems can be understood as two medical business systems that exchange data. The data that the medical business systems can process can be tree-structured, meaning that the data includes one or more fields that can be nested to form a tree structure. Each field can be used to describe business information, i.e., it carries business information.

[0061] In practical applications, the data type that a medical business system supports processing can be either an object (OBJECT), meaning the data can be object data, or a string (STRING), meaning the data can be string data following a tree structure. For example, if the data type supported by the medical business system is string, the data can be JavaScript Object Notation (JSON) string data or Extensible Markup Language (XML) string data.

[0062] For example, a piece of data that a medical business system can process might be '{"name":"A","address":{"city":"city_A","street":"street_A"}}', which is a JSON string. The "name" and "address" fields are at the same level in a tree structure. The "address" field contains nested "city" and "street" fields; that is, the "city" and "street" fields are sub-levels of the "address" field. "name" describes the username, "address" describes the user's address, "city" describes the city where the user lives, and the "street" field describes the street where the user lives. The username, address, city, and street can all be understood as business information. If this data type is converted from a string to an object, an object data structure can be obtained, namely, {name:"A",address:{city:"city_A",street:"street_A"}}.

[0063] The data structure supported by a medical business system can be understood as the organization, management, and storage format of the data processed by the system. For example, the data structure supported by a medical business system can be a specification of the field name, data type of the field value, and nesting relationships between fields for one or more fields included in the data being processed. The data type of the field value can be described as the field value type, which can include: OBJECT, STRING, array (ARRAY), Boolean (BOOLEAN), integer (INTEGER), and floating-point number (DOUBLE). A field in a data structure can be understood as a field included in the data of that data structure.

[0064] Here, the first medical business system and the second medical business system support different data structures, so data conversion is required when data is exchanged.

[0065] For example, the first medical business system can be a medical record system, and the data structure supported by the medical record system is equivalent to the first data structure. The second medical business system can be a registration system, and the data structure supported by the registration system is equivalent to the second data structure. In processing a user's registration, the registration system needs to retrieve the user's medical record data from the medical record system; that is, data exchange is required.

[0066] Suppose the first data structure supported by the medical record system specifies that the field describing the username is named "name", and the second data structure supported by the registration system specifies that the field describing the username is named "patient_name". Then, the medical record data for user A that the medical record system can process is {name:"A"}, meaning the data that can be provided to the registration system is {name:"A"}. However, the medical record data for user A that the registration system can process is {patient_name:"A"}. It can be seen that data conversion is required between the medical record system and the registration system to achieve data interoperability. It should be noted that, for ease of explanation, only the fields related to the username in the medical record data are shown in the example; the medical record data may also include other fields.

[0067] Here, the first field in the first data structure and the second field in the second data structure have a first predefined mapping relationship. For example, in the previous example, the field "name" in the medical record system and the field "patient_name" in the registration system are both used to describe usernames and have a first predefined mapping relationship. In practical applications, the first predefined mapping relationship can be set by the user and persistently stored in the database in the form of a mapping table. Each field in the first predefined mapping relationship can be assigned a unique identifier so that the field can be searched from the tree-structured data.

[0068] In practical applications, the common medical business processes in the first and second medical business systems can be understood as the medical business processes involved in data interoperability.

[0069] For example, if the first medical business system is a medical record system and the second medical business system is a registration system, and the registration system needs to exchange data with the medical record system during the process of processing a user's registration, then the common medical business processes in the registration system and the medical record system include the registration process.

[0070] In practical applications, common medical business processes shared by the first and second medical business systems can be described in text; this text can also be called a business process description. A business process description needs to include all necessary steps, decision points, inputs, and outputs of the process.

[0071] For example, a business process description could be: Upon arrival at the hospital, a patient first registers. Then, the doctor collects information about the patient's symptoms. Based on the symptoms, the doctor makes a preliminary diagnosis. If necessary, the doctor orders laboratory tests. Based on the laboratory results, the doctor makes a final diagnosis and provides treatment recommendations.

[0072] In practical applications, business process descriptions can be manually written based on the FHIR standard, and then syntactic analysis and semantic role labeling can be performed on the written business process descriptions to obtain business process descriptions for data conversion.

[0073] In practical applications, sample input data for a first data structure and sample output data for a second data structure can be generated based on the business process description corresponding to a general medical business process. The sample input data can be used to simulate the data before data transformation, and the sample output data can be used to simulate the data after data transformation. Then, one or more first expressions can be generated based on the sample input data, and one or more second expressions can be generated based on the sample output data. It should be noted that the sample output data does not necessarily have to be the data after data transformation corresponding to the sample input data.

[0074] Here, each first expression is used to access a first field defined in the first data structure supported by the first medical business system. In practical applications, the first expression can read the value of the first field in the data of the first data structure by accessing the first field. For example, the format of the first expression can be get_$p1$p2$p3...$pn, where pn is a sub-level of pn-1. For example, the first expression get_$Patient$contact$name can be used to access the "name" field under the "contact" field under the "Patient" field, thereby reading the value of the "name" field.

[0075] Here, each second expression is used to assign a value to a second field in the second data structure supported by the second medical business system. In practical applications, the value of each second field in the data of a second data structure before assignment may be empty. In this case, the data does not carry business information. In practice, the second expression can be used to assign a value to each field in the data, making the data carry business information. In practice, the second expression can also be used to add a second field to empty data that does not contain any fields and assign a value, thereby converting the empty data into data of a second data structure carrying business information. It should be noted that empty data without any fields can be understood as data of an empty second data structure.

[0076] In practical applications, the first expression can also be called the access expression, and the second expression can also be called the set expression.

[0077] Step 102: Generate the first code based on one or more first expressions.

[0078] The first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0079] In practical applications, one or more first expressions can be combined to generate first code. During the processing of the data to be converted in the first data structure, the first code can be called to control each first expression to read the value of each first field in the data to be converted, thereby obtaining a set of values ​​of all the first fields in the data to be converted.

[0080] In practical applications, when calling the first code to process the data to be converted, there may be situations where the data to be converted is of object type. For example, there may be situations where the first expression only supports accessing the first field in the object data. Based on this, the first code can also be used to convert string data into object data, thereby enabling the string type data to be converted into the object type data.

[0081] Step 103: Generate second code based on the first established mapping relationship and one or more second expressions.

[0082] The second code is used to process the set output by the first code and the first set mapping relationship to output the data of the second data structure.

[0083] In practical applications, one or more second expressions can be combined to generate second code. During the processing of the data to be converted from the first data structure, the second code can be invoked to control each second expression to set the value of each second field for a given set of data. The value set by each second expression can be determined based on the first set mapping relationship and the set of outputs from the first code. The set data can be data from a second data structure that does not carry business information. Running the second code converts the set data into data from a second data structure that carries business information; that is, it yields the converted output data.

[0084] In practical applications, when calling the second code to process the data to be converted, there may be situations where the output data after data conversion needs to be string data, but the data set by the second expression is object data. Based on this, the second code can also be used to convert object data into string data, thereby ensuring that the output data after data conversion is string data.

[0085] In this embodiment, based on a common medical business process, first code and second code for data conversion are automatically generated. Compared with related technologies, data conversion can be performed based on the automatically generated code, reducing labor and time costs, thereby improving the efficiency of data conversion.

[0086] The methods for generating the first and second codes will be explained in further detail below.

[0087] In one embodiment, based on the common medical business processes in the first and second medical business systems, one or more first expressions and one or more second expressions are generated, including:

[0088] Based on the common medical business processes in the first and second medical business systems, generate first data of the first data structure and second data of the second data structure;

[0089] Based on the first data, generate a first metadata definition corresponding to the first data structure, and based on the second data, generate a second metadata definition corresponding to the second data structure;

[0090] A first-class definition is generated based on the first metadata definition, and a second-class definition is generated based on the second metadata definition;

[0091] One or more first expressions are generated based on the first type definition, and one or more second expressions are generated based on the second type definition.

[0092] In practical applications, the first data is equivalent to sample input data, and the second data is equivalent to sample output data. A Business Process Model and Notation (BPMN) flowchart can be generated based on a general medical business process. This BPMN flowchart can then be processed to obtain the first and second data. For example, the databases used by the first and second medical business systems in the general medical business process can be determined based on the BPMN flowchart. The first and second data can then be extracted from this database, or they can be constructed (mocked) based on the table structure in the database.

[0093] In practical applications, metadata definition can be understood as a tree representation of a data structure. That is, metadata definition is data in a tree structure, which includes one or more nodes. Each node can be used to describe the data structure's specification for a field.

[0094] Here, the first metadata definition can be understood as a tree representation of the first data structure, and the second metadata definition can be understood as a tree representation of the second data structure.

[0095] For example, a first metadata definition can be as follows: Figure 2As shown in the diagram. Here, "name" represents the field name of the first field, "type" represents the field value type of the first field, "id" represents the level of the first field, "pid" represents the parent level of the first field, "leaf" indicates whether the first field has a lower level, and "properties" represents the attributes of the first field. Attributes can be seen as a description of the first data structure's specifications for all first fields in the next level of the first field. If the value of "properties" is null, it indicates that the first field has no lower level. Figure 2 The data in the first data structure corresponding to the first metadata type in the document can be: {Patient:{name:“A”}}.

[0096] In practical applications, the first data can be processed to obtain the first metadata definition corresponding to the first data structure, and the second data can be processed to obtain the second metadata definition corresponding to the second data structure.

[0097] In practical applications, class definitions can be seen as a further abstraction of metadata definitions, which can be directly recognized by computer programs and can be used as part of the generated code.

[0098] Here, the first type of definition can be seen as a further abstraction of the first metadata definition, and the second type of definition can be seen as a further abstraction of the second metadata definition. For example, based on... Figure 2 The first class definition generated from the first metadata definition in the first metadata definition can be as follows: Figure 3 As shown.

[0099] In practical applications, the following two algorithms can be used to process the metadata definition and generate the corresponding class definition.

[0100] Algorithm 1: Algorithm for generating all class definitions.

[0101] See Figure 4 The processing steps corresponding to this algorithm mainly include:

[0102] Step 1: Initialize two queues: the pending node queue and the class definition queue. The pending node queue is used to store the nodes to be processed in the metadata definition, and the class definition queue is used to store the class definitions. After the queues are initialized, the root node in the metadata definition is added to the pending node queue.

[0103] Step 2: Perform a hierarchical traversal of each node in the metadata definition. In each loop, process the nodes to be processed in the hierarchy in turn.

[0104] Specifically, when the data type of the field described by the node to be processed is an object, Algorithm 2 is used to process the node, generate the class definition corresponding to the node, and add the generated class definition to the class definition queue; then, all attributes of the current node to be processed are traversed and added to the node to be processed queue in turn; when the node to be processed queue is empty, the class definition queue is output, that is, the class definition corresponding to the metadata definition is output.

[0105] Algorithm 2: Object class definition generation algorithm.

[0106] See Figure 5 The processing steps corresponding to this algorithm mainly include:

[0107] Step 1: Initialize a list of field definitions to store the field definitions for each nested field in an object type;

[0108] Step 2: Generate field definitions.

[0109] Specifically, iterate through all attributes of the node to be processed, then obtain the field name and field value type of each attribute's corresponding field, and then process the obtained field name and field value type based on the set template to obtain the field definition of the field, and add the field definition of the field to the field definition list.

[0110] In practical applications, the second data structure can follow the FHIR standard. In this case, the node to be processed corresponding to the field whose data type is an object can be regarded as an FHIR resource. Algorithm 2 can also be called the FHIR resource class definition generation algorithm.

[0111] In practical applications, after generating the first type of definition and the second type of definition, the first metadata definition and the second metadata definition can be traversed respectively based on the breadth-first search algorithm to obtain the first traversal result corresponding to the first metadata definition and the second traversal result corresponding to the second metadata definition. Then, based on the first traversal result and the first type of definition, the first expression is generated, and based on the second traversal result and the second type of definition, the second expression is generated.

[0112] As can be seen from the embodiments of this application, based on general medical business processes, one or more first expressions and one or more second expressions are automatically generated, which in turn can generate first code and second code. Compared with related technologies, data conversion can be performed based on automatically generated code, reducing labor and time costs, thereby improving the efficiency of data conversion.

[0113] In practical applications, automatically generated code may contain errors, leading to data conversion failures. For example, if the second data structure conforms to the FHIR standard, code errors may cause the data structure output by the second code to be inconsistent with the FHIR standard. Based on this,

[0114] In one embodiment, the data conversion method provided in this application further includes:

[0115] Process each code segment in the first resource and one or more code segments to obtain the error type corresponding to each code segment.

[0116] One or more code segments are split from a first code and / or a second code; the first resource represents a resource defined by the FHIR standard.

[0117] In practical applications, the first and / or second code can be stored in a code file, which can also be represented as a source file. During the code splitting process, the source file can be processed to obtain one or more code snippets. For example, the source file can be processed based on line-by-line splitting or function body splitting.

[0118] In practical applications, the first resource can also be called an FHIR resource. An FHIR resource has a hierarchical structure and can be represented as tree-structured data. Each node in this tree structure represents an FHIR resource or an attribute within an FHIR resource. For example, an FHIR resource can be data in JSON format or XML format.

[0119] In one embodiment, the second data structure conforms to the FHIR standard;

[0120] Error types indicate one or more cases where the data structure of the data output by the second code does not conform to the FHIR standard.

[0121] For example, the error type corresponding to each code snippet may include: no error, or one or more of the following: invalid value error, formatting error, duplicate element error, reference association error, and position not allowed error.

[0122] The error types will be explained further below. Here, for ease of understanding, the data output by the second code will be referred to as output data.

[0123] Error-free characterization: The data structure of the output data conforms to the FHIR standard.

[0124] Invalid value error description: The field value in the output data does not belong to the valid values ​​specified by the FHIR standard. For example, if the FHIR standard specifies that the value of the "name" field cannot be null, the value of the "name" field in the output data is null.

[0125] Formatting error description: The field value type in the output data does not conform to the FHIR standard. For example, while the FHIR standard specifies that the "age" field value type should be integer, the "age" field value type in the output data is string.

[0126] Duplicate element error: The number of times a field appears in the output data does not conform to the FHIR standard. For example, the FHIR standard stipulates that the "id" field can only appear once in the output data, but the "id" field appears twice in the output data.

[0127] Reference association error symptom: The fields associated with fields in the output data do not conform to the FHIR standard. For example, the FHIR standard stipulates that the "patient" field can only be associated with "doctor", but the "patient" field in the output data is associated with the "medicant" field.

[0128] The location is not allowed to be incorrectly represented: the level of the field in the output data does not conform to the FHIR standard. For example, the FHIR standard stipulates that the "id" field can only appear at the root node level in the output data, but the "id" field in the output data appears at the leaf node level.

[0129] In practical applications, the first set model can be invoked to process each code segment in the first resource and one or more code segments to obtain the error type corresponding to each code segment.

[0130] For example, the first model can be an FHIR Abstract Syntax Tree Neural Network (FHIR-ASTNN) model.

[0131] See Figure 6 The network structure of the FHIR-ASTNN model can include:

[0132] Tree structure encoding structure: used to represent the input code fragment and the first resource as tree-structured data to obtain a tree sequence; in practical applications, the first resource can provide more reference information for the code fragment, thereby improving the accuracy of the FHIR-ASTNN model.

[0133] Node embedding structure: used to convert each node in the tree sequence into an embedding vector, resulting in a vector sequence. For non-leaf nodes with multiple child nodes, the embedding vector is aggregated from the embedding vectors of the child nodes. In practical applications, the node embedding structure can be a recursive neural network (RvNN) statement encoder.

[0134] Recurrent Neural Network (RNN): Used to process and update each node in a vector sequence based on a bidirectional recurrent neural network (RNN) to obtain a tree representation of the input code snippet;

[0135] Output layer: Includes a pooling layer and a normalized exponential function (Softmax, SoftMaximum) layer, used to determine the error type corresponding to the code snippet based on the tree representation corresponding to the code snippet.

[0136] For example, processing a first resource and a code snippet using the FHIR-ASTNN model to obtain the error type corresponding to the code snippet can mainly include the following steps:

[0137] Step 1: Parse the code snippet into one or more Abstract Syntax Trees (ASTs), and perform a preorder traversal on the parsed ASTs to divide each AST into a sequence of statement trees (ST-trees); and, based on the FHIR standard, perform a preorder traversal on the first resource to obtain a sequence of resource trees (FHIR-trees).

[0138] In practical applications, both ST-tree and FHIR-tree can be regarded as tree sequences.

[0139] Step 2: Based on the RvNN statement encoder, learn the vector representation of each node in the tree sequence.

[0140] Specifically, given an ST-tree and an FHIR-tree, in practical applications, the non-leaf nodes of these two tree sequences can be denoted as n, and the number of child nodes of these two tree sequences can be denoted as C.

[0141] Then, based on the pre-trained embedding parameters, the two tree sequences are processed to obtain the vector representation of each node in the two tree sequences. In practical applications, the embedding parameters can be denoted as: W e ∈R V*d , where V represents vocabulary size and d represents composite embedding dimension.

[0142] In practical applications, the vector representation of node n can be denoted as h, and the formula for calculating h is:

[0143]

[0144] Among them, W n Characterizing the weight matrix, representing the bias term, h i σ represents the hidden state of each child node, and σ represents the activation function. In practical applications, the vector representation of node n can also be regarded as the updated hidden state of node n.

[0145] Among them, v n The calculation formula is:

[0146] v n =W e (x n +f n )

[0147] Where, x n The one-hot encoding of node n in an ST-tree represents f n The One-Hot representation of node n in the FHIR-tree.

[0148] Then, max pooling is performed on the nodes to obtain the features in the vector representation, denoted as e. t This leads to the vector sequences of the ST-tree and FHIR-tree.

[0149] In practical applications, the features in the vector representation can be denoted as e. t e t The calculation formula is:

[0150] e t =[max(h i1 ), max(h i2 ), ..., max(h ik )], i = 1, 2, ..., N

[0151] Step 3: Based on the vector sequences of ST-tree and FHIR-tree, use a gated recurrent unit (GRU) to track the naturalness of the statements.

[0152] In practical applications, the transformation equation within time t is:

[0153] r t =σ(W r e t +U r h t-1 +b r )

[0154] z t =σ(W z e t +U z h t-1 +b z )

[0155]

[0156]

[0157] Where, r t The reset gate represents the degree of influence of the previous state; z t Representation update gates are used to combine old information with new information; h t Characterize the candidate state and compare it with the previous state h. t-1 Together, determine the current state.

[0158] In practical applications, a bidirectional GRU can be used to connect the hidden states in two directions to form a new state, thereby further enhancing the ability to obtain dependency information and improving the accuracy of the output error types.

[0159] In practical applications, the formula for calculating the new state is:

[0160]

[0161] Step 4: Perform max pooling sampling on the calculated state to obtain the vector representation of the input code snippet.

[0162] Step 5: Use the Softmax layer to classify the vector representation of the code snippet to obtain the error type corresponding to the code snippet.

[0163] In one embodiment, the data conversion method provided in this application further includes:

[0164] If the error type representation of the first code segment in one or more code segments is that the first code segment caused the code error, output the code location of the first code segment.

[0165] In practical applications, the location of the first code snippet in the source file can be determined based on the positional mapping relationship between the code snippet and the source file.

[0166] In practical applications, the location of the first code snippet can be indicated in the source file through highlighting or other methods. In this way, business personnel can quickly locate the error location in the automatically generated code and correct it in time, thereby improving the correctness of the generated code. Moreover, the operation is simple and improves the efficiency of data conversion.

[0167] The data conversion method will be further explained below.

[0168] In one embodiment, the data conversion method provided in this application includes:

[0169] The first code is invoked to process the first string data of the first data structure, resulting in a first set; the first set represents the set of all values ​​of the first field in the first string data;

[0170] The second code is called to process the first set and the first set of mapping relationships, and the first string data of the second data structure is obtained.

[0171] Here, by calling the first code and the second code in sequence, the first string data of the first data structure is converted into the string data of the second data structure.

[0172] In practical applications, the first string data in the first data structure can be understood as the data to be transformed, which may come from the first medical business system. The first string data in the second data structure can be understood as the data that has already been transformed and can be used by the second medical business system.

[0173] In this way, data conversion can be carried out efficiently by automatically generating the first and second codes, thereby enabling data interoperability between the first and second medical business systems.

[0174] In one embodiment, calling first code to process first string data in a first data structure to obtain a first set includes:

[0175] Based on the first metadata definition, the first string data of the first data structure is deserialized to obtain the first object data of the first data structure.

[0176] Based on each of the first expressions in one or more first expressions, access the corresponding first field in the first object data of the first data structure to obtain the first set.

[0177] In practical applications, the first object data and the first string data of the first data structure include the same first field. For example, the first string data of the first data structure can be '{"name":"A","address":{"city":"city_A","street":"street_A"}}', and the first object data of the first data structure can be {name:"A",address:{city:"city_A",street:"street_A"}}.

[0178] In practical applications, the value of each first field in the first object data of the first data structure can be obtained based on the access to the first object data of the first data structure by each of the first expressions in one or more first expressions. That is, the value of each first field in the first string data of the first data structure can be obtained. Then, based on these obtained field values, the first set can be constructed.

[0179] In one embodiment, the second code is invoked to process the first set and the first predefined mapping relationship to obtain the first string data of the second data structure, including:

[0180] Based on the first established mapping relationship, determine one or more second fields that match one or more first fields in the first set;

[0181] Based on each of the one or more second expressions, assign a value to the corresponding second field in the second object data of the second data structure;

[0182] Based on the second metadata definition, the second object data of the second data structure is serialized to obtain the first string data of the second data structure.

[0183] In practical applications, the first mapping relationship can be recorded in a mapping table. This mapping table records the relationship between each first field and second field in the first set. Based on the mapping table corresponding to the first mapping relationship, the value of the first field matching the second field in the first set can be determined as the value of that second field. Then, based on the second expression and the determined value of the second field, a value can be assigned to the second data object.

[0184] In practical applications, before assigning a value to a second data object through one or more second expressions, the second data object may already include all or part of the second fields, but the value of each second field is empty; the second data object may also be an empty data object that does not include any fields.

[0185] For example, if the first string data of the first data structure is '{"name":"A","address":{"city":"city_A","street":"street_A"}}', and according to the records with the first set mapping relationship, it can be known that: the first field "name" has a mapping relationship with the second field "patient_name", the first field "address" has a mapping relationship with the second field "patient_address", the first field "city" has a mapping relationship with the second field "level1_address", and the first field "street" has a mapping relationship with the second field "level2_address". Since "address" has a mapping relationship, before assigning a value to the second data object through one or more second expressions, the second data object can be {patient_name:"",patient_address:{level1_address:"",level2_address:""}}. After assigning a value to the second data object through one or more second expressions, the second data object can be transformed into {patient_name:"A",patient_address:{level1_address:"city_A",level2_address:"street_A"}}.

[0186] In practical applications, the second field included in the second object data of the second data structure is exactly the same as the second string data of the second data structure. For example, after serializing the second data object that has been assigned a value in the previous example, we can obtain '{"patient_name":"A","patient_address":{"level1_address":"city_A","level2_address":"street_A"}}', that is, we obtain the first string data of the second data structure.

[0187] In this embodiment, a first code and a second code are automatically generated based on a common medical business process. Then, data conversion is performed based on the first code and the second code. Compared with related technologies, data conversion can be performed based on automatically generated code, which reduces labor and time costs and thus improves the efficiency of data conversion.

[0188] The present application will be further described in detail below with reference to application examples.

[0189] This application provides a data conversion system, which includes a code generation engine.

[0190] See Figure 7The workflow of a code generation engine mainly includes the following steps:

[0191] Step 1: The code generation engine receives the business process description input by the user.

[0192] In practical applications, users can be business personnel. The business process description entered by the user is equivalent to a description of the common medical business process in the first and second medical business systems of this application embodiment, and this business process description can conform to the FHIR standard.

[0193] Step 2: The code generation engine generates first data and second data based on the business process description.

[0194] In practical applications, the code generation engine can generate a BPMN diagram based on the business process description, and generate first data and second data based on the BPMN diagram.

[0195] Step 3: The code generation engine generates code based on the first and second data.

[0196] Here, the code generated by the code generation engine is equivalent to the first code and the second code in the embodiments of this application.

[0197] In practical applications, code generation engines can save the generated code in the source file.

[0198] Step 4: The code generation engine determines whether there are errors in the code.

[0199] In practical applications, the code that the code generation engine judges can be the code generated in steps 1 to 3, or the user-modified code in step 5 below.

[0200] In practical applications, code generation engines can break down code into one or more code snippets and indicate the location of the code snippet that caused the error in the source file.

[0201] If there is an error in the code, proceed to step 5;

[0202] If there are no errors in the code, proceed to step 6.

[0203] Step 5: The user modifies the error segment that is causing the code error.

[0204] In practical applications, after the user completes the modifications, step 4 is executed again, and the code generation engine determines whether there are any errors in the modified code.

[0205] Step 6: Output the code.

[0206] In practical applications, the output code can be used for data transformation.

[0207] The following section further explains the workflow of the code generation engine, which generates code based on the first and second data. See also... Figure 8 The workflow mainly includes the following steps:

[0208] Step 1: Generate metadata definitions based on the first data and the second data.

[0209] In practical applications, the code generation engine can generate a first metadata definition based on the first data, and generate a second metadata definition based on the second data.

[0210] Step 2: Generate class definitions based on metadata definitions.

[0211] In practical applications, the code generation engine can generate a first-class definition based on the first metadata definition, and generate a second-class definition based on the second metadata definition.

[0212] Step 3: Generate access expressions and set expressions based on the class definition.

[0213] Here, the access expression is equivalent to the first expression in this application embodiment, and the set expression is equivalent to the second expression in this application embodiment.

[0214] In practical applications, the code generation engine can generate access expressions based on the first type of definition, and generate set expressions based on the second type of definition.

[0215] Step 4: Establish mapping relationships.

[0216] Here, the mapping relationship is equivalent to the first set mapping relationship in the embodiments of this application.

[0217] In practical applications, the code generation engine can receive the initial mapping relationship configured by the user.

[0218] Step 5: Generate the first code for outputting the set of input values.

[0219] Here, the set of input values ​​is equivalent to the first set in the embodiments of this application.

[0220] Step 6: Generate the second code used to set the output object.

[0221] Here, the output object is equivalent to the second object data in the embodiments of this application.

[0222] In practical applications, once the output object is set, it is equivalent to being converted into data of the second data structure in the embodiments of this application.

[0223] In practical applications, depending on business needs, the second code can directly output the set output object during operation, or it can serialize the set output object into string data before outputting it, thereby achieving data conversion.

[0224] In practical applications, after generating code based on the above code generation engine's workflow, the code can be called to process the data to be transformed, thereby achieving data transformation.

[0225] In this application embodiment, a first code and a second code are automatically generated based on a common medical business process. Then, data conversion is performed based on the first code and the second code. Compared with related technologies, data conversion can be performed based on automatically generated code, which reduces labor and time costs and thus improves the efficiency of data conversion.

[0226] Based on the embodiments described above, this application also provides a data conversion apparatus, see [link to previous document]. Figure 9 The data conversion device includes:

[0227] The first generation unit 91 is used to generate one or more first expressions and one or more second expressions based on the common medical business processes in the first medical business system and the second medical business system; wherein each of the one or more first expressions is used to access a first field set in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first set mapping relationship between the first field and the second field;

[0228] The second generation unit 92 is used to generate first code based on the one or more first expressions; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0229] The third generation unit 92 is used to generate second code based on the first set mapping relationship and the one or more second expressions; the second code is used to process the set of outputs of the first code and the first set mapping relationship to output the data of the second data structure.

[0230] In one embodiment, the first generation unit 91 generates one or more first expressions and one or more second expressions based on the common medical business processes in the first and second medical business systems, including:

[0231] Based on the common medical business processes in the first medical business system and the second medical business system, the first data of the first data structure and the second data of the second data structure are generated.

[0232] Based on the first data, a first metadata definition corresponding to the first data structure is generated, and based on the second data, a second metadata definition corresponding to the second data structure is generated;

[0233] A first type of definition is generated based on the first metadata definition, and a second type of definition is generated based on the second metadata definition;

[0234] The first expression is generated based on the first class definition, and the second expression is generated based on the second class definition.

[0235] In one embodiment, the data conversion apparatus further includes a first processing unit, which is configured to process each code segment in the first resource and one or more code segments to obtain an error type corresponding to each code segment; wherein,

[0236] The one or more code fragments are derived from the first code and / or the second code; the first resource represents a resource defined by the Fast Medical Interconnection Resource (FHIR) standard.

[0237] In one embodiment, the second data structure conforms to the FHIR standard;

[0238] The error type indicates one or more cases where the data structure of the data output by the second code does not conform to the FHIR standard.

[0239] In one embodiment, the first processing unit is further configured to:

[0240] If the error type representation of the first code segment in the one or more code segments is that the first code segment caused the code error, output the code location of the first code segment.

[0241] In one embodiment, the data conversion apparatus further includes a second processing unit, the second processing unit being used for:

[0242] The first code is invoked to process the first string data of the first data structure to obtain a first set; the first set represents the set composed of all the values ​​of the first field in the first string data;

[0243] The second code is invoked to process the first set and the first set mapping relationship to obtain the first string data of the second data structure.

[0244] In one embodiment, the second processing unit calls the first code to process the first string data of the first data structure to obtain a first set, including:

[0245] Based on the first metadata definition, the first string data of the first data structure is deserialized to obtain the first object data of the first data structure.

[0246] Based on each of the one or more first expressions, access the corresponding first field in the first object data of the first data structure to obtain the first set.

[0247] In one embodiment, the second processing unit calls the second code to process the first set and the first set mapping relationship to obtain the first string data of the second data structure, including:

[0248] Based on the first established mapping relationship, determine one or more second fields that match one or more first fields in the first set;

[0249] Based on each of the one or more second expressions, assign a value to the corresponding second field in the second object data of the second data structure;

[0250] Based on the second metadata definition, the second object data of the second data structure is serialized to obtain the first string data of the second data structure.

[0251] In practical applications, the first generation unit 91, the second generation unit 91, the third generation unit 93, the first processing unit, and the second processing unit can all be implemented by the processor in the data conversion device.

[0252] It should be noted that the data conversion device provided in the above embodiments is only illustrated by the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the data conversion device and the data conversion method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0253] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, this application also provides an electronic device, such as... Figure 10 As shown, the electronic device includes:

[0254] The first communication interface 1 is capable of exchanging information with other devices;

[0255] The first processor 2 is connected to the first communication interface 1 to enable information interaction with other devices. When running a computer program, it executes the methods provided by one or more technical solutions in the above embodiments. The computer program is stored in the first memory 3.

[0256] Specifically, the first processor 2 is used to generate one or more first expressions and one or more second expressions based on the common medical business processes in the first medical business system and the second medical business system; wherein, each of the one or more first expressions is used to access a first field set in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first set mapping relationship between the first field and the second field;

[0257] Based on the one or more first expressions, a first code is generated; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure.

[0258] Based on the first defined mapping relationship and the one or more second expressions, a second code is generated; the second code is used to process the set of outputs of the first code and the first defined mapping relationship to output the data of the second data structure.

[0259] In one embodiment, the first processor 2 generates one or more first expressions and one or more second expressions based on medical business processes common to both the first and second medical business systems, including:

[0260] Based on the common medical business processes in the first medical business system and the second medical business system, the first data of the first data structure and the second data of the second data structure are generated.

[0261] Based on the first data, a first metadata definition corresponding to the first data structure is generated, and based on the second data, a second metadata definition corresponding to the second data structure is generated;

[0262] A first type of definition is generated based on the first metadata definition, and a second type of definition is generated based on the second metadata definition;

[0263] The first expression is generated based on the first class definition, and the second expression is generated based on the second class definition.

[0264] In one embodiment, the first processor 2 is further configured to:

[0265] Process each code segment in the first resource and one or more code segments to obtain the error type corresponding to each code segment; wherein,

[0266] The one or more code fragments are derived from the first code and / or the second code; the first resource represents a resource defined by the Fast Medical Interconnection Resource (FHIR) standard.

[0267] In one embodiment, the second data structure conforms to the FHIR standard;

[0268] The error type indicates one or more cases where the data structure of the data output by the second code does not conform to the FHIR standard.

[0269] In one embodiment, the first processor 2 is further configured to:

[0270] If the error type representation of the first code segment in the one or more code segments is that the first code segment caused the code error, output the code location of the first code segment.

[0271] In one embodiment, the first processor 2 is further configured to:

[0272] The first code is invoked to process the first string data of the first data structure to obtain a first set; the first set represents the set composed of all the values ​​of the first field in the first string data;

[0273] The second code is invoked to process the first set and the first set mapping relationship to obtain the first string data of the second data structure.

[0274] In one embodiment, the first processor 2 calls the first code to process the first string data of the first data structure to obtain a first set, including:

[0275] Based on the first metadata definition, the first string data of the first data structure is deserialized to obtain the first object data of the first data structure.

[0276] Based on each of the one or more first expressions, access the corresponding first field in the first object data of the first data structure to obtain the first set.

[0277] In one embodiment, the first processor 2 calls the second code to process the first set and the first set mapping relationship to obtain the first string data of the second data structure, including:

[0278] Based on the first established mapping relationship, determine one or more second fields that match one or more first fields in the first set;

[0279] Based on each of the one or more second expressions, assign a value to the corresponding second field in the second object data of the second data structure;

[0280] Based on the second metadata definition, the second object data of the second data structure is serialized to obtain the first string data of the second data structure.

[0281] It should be noted that the specific processing procedure of the first processor 2 can be understood by referring to the above method.

[0282] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 10 The general will label all buses as Bus System 4.

[0283] The first memory 3 in this embodiment is used to store various types of data to support operation in the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0284] The methods disclosed in the embodiments of this application can be applied to the first processor 2, or implemented by the first processor 2. The first processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the first processor 2. The first processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 2 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the first memory 3. The first processor 2 reads the information in the first memory 3 and completes the steps of the aforementioned method in combination with its hardware.

[0285] In an exemplary embodiment, the electronic device may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.

[0286] It is understood that the first memory 3 in the embodiments of this application can be volatile memory or non-volatile memory, or both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be disk storage or magnetic tape storage. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0287] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as an electronic device including a computer program. The computer program can be executed by a first processor 2 of the electronic device to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0288] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a first processor 2 of an electronic device to perform the steps described in any of the foregoing methods.

[0289] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0290] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the term "one or more" in this document refers to any combination of at least two of any one or more elements from a set of A, B, and C. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set of A, B, and C.

[0291] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0292] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.

Claims

1. A data conversion method, characterized in that, The method includes: Based on the common medical business processes in the first and second medical business systems, one or more first expressions and one or more second expressions are generated; wherein, each of the one or more first expressions is used to access a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first defined mapping relationship between the first field and the second field; Based on the one or more first expressions, a first code is generated; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure. Based on the first defined mapping relationship and the one or more second expressions, a second code is generated; the second code is used to process the set of outputs of the first code and the first defined mapping relationship to output the data of the second data structure.

2. The method according to claim 1, characterized in that, The process, based on the common medical business processes in the first and second medical business systems, generates one or more first expressions and one or more second expressions, including: Based on the common medical business processes in the first medical business system and the second medical business system, the first data of the first data structure and the second data of the second data structure are generated. Based on the first data, a first metadata definition corresponding to the first data structure is generated, and based on the second data, a second metadata definition corresponding to the second data structure is generated; A first type of definition is generated based on the first metadata definition, and a second type of definition is generated based on the second metadata definition; The first expression is generated based on the first class definition, and the second expression is generated based on the second class definition.

3. The method according to claim 1, further comprising: Process each code segment in the first resource and one or more code segments to obtain the error type corresponding to each code segment; wherein, The one or more code fragments are derived from the first code and / or the second code; the first resource represents a resource defined by the Fast Medical Interconnection Resource (FHIR) standard.

4. The method according to claim 3, characterized in that, The second data structure conforms to the FHIR standard; The error type indicates one or more cases where the data structure of the data output by the second code does not conform to the FHIR standard.

5. The method according to claim 3, characterized in that, The method further includes: If the error type representation of the first code segment in the one or more code segments is that the first code segment caused the code error, output the code location of the first code segment.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The first code is invoked to process the first string data of the first data structure to obtain a first set; the first set represents the set composed of all the values ​​of the first field in the first string data; The second code is invoked to process the first set and the first set mapping relationship to obtain the first string data of the second data structure.

7. The method according to claim 6, characterized in that, The step of calling the first code to process the first string data of the first data structure to obtain the first set includes: Based on the first metadata definition, the first string data of the first data structure is deserialized to obtain the first object data of the first data structure. Based on each of the one or more first expressions, access the corresponding first field in the first object data of the first data structure to obtain the first set.

8. The method according to claim 7, characterized in that, The step of calling the second code to process the first set and the first set mapping relationship to obtain the first string data of the second data structure includes: Based on the first established mapping relationship, determine one or more second fields that match one or more first fields in the first set; Based on each of the one or more second expressions, assign a value to the corresponding second field in the second object data of the second data structure; Based on the second metadata definition, the second object data of the second data structure is serialized to obtain the first string data of the second data structure.

9. A data conversion device, characterized in that, include: The first generation unit is used to generate one or more first expressions and one or more second expressions based on the common medical business processes in the first medical business system and the second medical business system; wherein each of the one or more first expressions is used to access a first field set in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; there is a first set mapping relationship between the first field and the second field; The second generation unit is used to generate first code based on the one or more first expressions; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure. The third generation unit is used to generate second code based on the first set mapping relationship and the one or more second expressions; the second code is used to process the set of outputs of the first code and the first set mapping relationship to output the data of the second data structure.

10. An electronic device, characterized in that, include: A first processor and a first communication interface; wherein... The first processor is configured to generate one or more first expressions and one or more second expressions based on a common medical business process in both the first and second medical business systems; wherein each of the one or more first expressions is used to access a first field defined in a first data structure supported by the first medical business system, and each of the one or more second expressions is used to assign a value to a second field in a second data structure supported by the second medical business system; a first defined mapping relationship exists between the first field and the second field; Based on the one or more first expressions, a first code is generated; the first code is used to process the data of the first data structure to output a set consisting of the values ​​of all the first fields in the data of the first data structure. Based on the first defined mapping relationship and the one or more second expressions, a second code is generated; the second code is used to process the set of outputs of the first code and the first defined mapping relationship to output the data of the second data structure.

11. An electronic device, characterized in that, include: A first processor and a first memory for storing computer programs capable of running on the processor. Wherein, when the first processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 8.

12. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.