Device and method for automatically calculating observation items according to formula
阅读说明:本技术 根据公式自动计算观察项的装置及方法 (Device and method for automatically calculating observation items according to formula ) 是由 李超 周寿林 程宗星 孙丛兵 于 2020-07-15 设计创作,主要内容包括:本发明公开了一种根据公式自动计算观察项的装置及方法,包括:数据接收模块;数据存储模块;观察项模块,对观察项进行模型定义;字典模块,定义字典类观察项的计算值;计算公式模块,定义观察项之间的关联计算的若干第一计算公式;计算触发模块,定义每一个第一计算公式的触发条件;计算运行时模块,根据计算触发模块定义的触发条件自动调用对应的第一计算公式对数据存储模块中存储的观察项进行关联计算。本发明的根据公式自动计算观察项的装置及方法,对观察项进行模型定义,对字典类观察项设定对应的计算值,设定观察项之间的关联计算的若干第一计算公式,设定每个第一计算公式的触发条件,自动对输入的观察项进行关联计算。(The invention discloses a device and a method for automatically calculating an observation item according to a formula, wherein the method comprises the following steps: a data receiving module; a data storage module; the observation item module is used for carrying out model definition on the observation items; the dictionary module defines the calculation value of the dictionary type observation item; the calculation formula module is used for defining a plurality of first calculation formulas for correlation calculation among the observation items; the calculation triggering module defines triggering conditions of each first calculation formula; and the calculation runtime module automatically calls a corresponding first calculation formula according to the trigger condition defined by the calculation trigger module to perform correlation calculation on the observation items stored in the data storage module. The device and the method for automatically calculating the observation items according to the formulas define the models of the observation items, set corresponding calculation values for dictionary observation items, set a plurality of first calculation formulas for correlation calculation among the observation items, set triggering conditions of each first calculation formula and automatically perform correlation calculation on the input observation items.)
1. An apparatus for automatically calculating an observation term according to a formula, comprising:
the data receiving module is used for receiving a plurality of observation items, and the observation items comprise dictionary observation items and numerical observation items;
the data storage module is used for storing the received observation items;
the observation item module is used for carrying out model definition on all the observation items;
the dictionary module is used for defining calculation values corresponding to different dictionary class observation items;
a calculation formula module for defining a plurality of first calculation formulas for correlation calculation between the observation terms and input and output of each of the first calculation formulas;
the calculation triggering module is used for defining triggering conditions of each first calculation formula;
and the calculation runtime module is used for automatically calling the corresponding first calculation formula according to the trigger condition defined by the calculation trigger module to perform correlation calculation on the observation items stored in the data storage module.
2. The apparatus for automatically computing an observation term according to a formula according to claim 1,
the compute runtime module includes:
the general graph generating unit is used for automatically generating a directed acyclic graph as a general graph of all the calculation relations according to the relations of the observation items defined by all the first calculation formulas;
a subgraph generation unit, configured to extract a subgraph related to current computation from the directed acyclic graph according to the observation term involved in a certain first computation formula when the first computation formula is triggered;
a topology ranking unit for performing topology ranking on the generated subgraphs and determining the computation order of the observations involved;
the first data acquisition unit is used for acquiring corresponding numerical value observation items and dictionary observation items from the data storage module according to the model definition of the observation item module, and acquiring calculation values corresponding to the dictionary observation items from the dictionary module;
the data injection unit is used for injecting the obtained calculated values corresponding to the numerical class observation items and the dictionary class observation items into the subgraph;
a second data acquisition unit for acquiring calculation parameters required for calculation;
and the formula calculation unit is used for calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the calculated sequence of the topological sequencing.
3. The apparatus for automatically computing an observation term according to a formula according to claim 2,
the formula calculation unit includes:
the grammar parsing subunit is used for carrying out grammar parsing on the triggered first calculation formula to generate a grammar tree;
the variable subunit is used for replacing the variables in the first calculation formula with corresponding data;
an operator sub-unit for defining operator meaning in the first calculation formula;
a function subunit, configured to define a meaning of a function in the first calculation formula;
the evaluation subunit is used for traversing the syntax tree and calculating a root node as the output of the first calculation formula;
and the result deriving unit is used for deriving the calculation results of all the observation items in the subgraph to the corresponding observation items after all the calculations are finished.
4. The apparatus for automatically computing an observation term according to a formula according to claim 1,
the observation item module includes:
the observation item basic model unit is used for defining the general metadata of the observation item, and comprises a code, a name, a data type and a default value of the observation item;
the observation item additional model unit is used for defining the non-general metadata of the observation item, and comprises dictionary codes of the dictionary type observation items, and reasonable numerical value ranges and decimal point numbers of the numerical value type observation items;
the calculation formula module comprises:
the abstract formula unit is used for editing and storing all the first calculation formulas;
a formula input unit for defining an input of each of the first calculation formulas;
and the formula output unit is used for defining the output of each first calculation formula.
5. The apparatus for automatically computing an observation term according to a formula according to claim 4,
the calculation formula module is also used for defining a plurality of second calculation formulas of the correlation calculation between the target item and the observation item and the input and the output of each second calculation formula;
the abstract formula unit also stores all the second calculation formulas;
the formula input unit is also used for defining the input of each second calculation formula;
the formula output unit is further used for defining the output of each second calculation formula.
6. A method for automatically calculating an observation term according to a formula, comprising the steps of:
receiving a plurality of observation terms, wherein the observation terms comprise dictionary observation terms and numerical observation terms;
storing the received observation items;
performing model definition on all the observation items;
defining calculation values corresponding to different dictionary class observation items;
defining first calculation formulas for correlation calculations between the observation terms and inputs and outputs of each of the first calculation formulas;
defining a trigger condition for each of the first calculation formulas;
and automatically calling the corresponding first calculation formula according to a defined trigger condition to perform correlation calculation on the stored observation items.
7. The method of automatically computing an observation term according to a formula of claim 6,
the specific method for automatically calling the corresponding first calculation formula according to the defined trigger condition to perform the correlation calculation on the stored observation items comprises the following steps:
automatically generating a directed acyclic graph as a general graph of all the calculation relations according to the relations of the observation terms defined by all the first calculation formulas;
when a certain first calculation formula is triggered, extracting a subgraph related to the current calculation from the directed acyclic graph according to the observation term related to the first calculation formula;
performing topological sorting on the generated subgraphs and determining the calculation order of the observations involved;
acquiring corresponding numerical value observation items and dictionary observation items from the stored observation items according to the model definition of all the observation items, and acquiring calculated values corresponding to the dictionary observation items;
injecting the obtained calculated values corresponding to the numerical class observation items and the dictionary class observation items into the subgraph;
acquiring calculation parameters required by calculation;
and calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the sequence calculated by topological sequencing.
8. The method of automatically computing an observation term according to a formula of claim 7,
the specific method for calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the sequence calculated by topological sorting comprises the following steps:
the triggered first calculation formula is parsed to generate a syntax tree;
replacing variables in the first calculation formula with corresponding data;
traversing the syntax tree and calculating a root node as the output of the calculation formula according to the operator meaning and the function meaning in the calculation formula;
and after all the calculation is finished, exporting calculation results of all the observation items in the subgraph to the corresponding observation items.
9. The method of automatically computing an observation term according to a formula of claim 6,
the specific method for performing model definition on all the observation items comprises the following steps:
defining generic metadata for the observation term including a code, a name, and a data type of the observation term;
defining non-generic metadata for the observations, including dictionary codes for the dictionary class observations and reasonable numerical ranges and decimal places for the numerical class observations;
the specific method of defining the first calculation formula of the correlation calculation between the observation items and the input and output of each first calculation formula is as follows:
editing and storing all the first calculation formulas;
defining an input for each of said first calculation formulas;
an output of each of the first calculation formulas is defined.
10. The method of automatically computing an observation term according to a formula of claim 9,
the method for automatically calculating the observation term according to the formula further comprises the following steps:
defining a number of second calculation formulas of correlation calculation between the target item and the observation item and input and output of each second calculation formula;
and selecting the corresponding observation item from the stored observation items according to a selected certain second calculation formula to calculate to obtain the corresponding target item.
Technical Field
The invention relates to the technical field of medical information processing, in particular to a device and a method for automatically calculating an observation item according to a formula.
Background
With the continuous development of medical information technology, the record of clinical observation items of patients depends on information systems such as vital signs, administration metering, statistics of the amount of entrance and exit, and clinical scores in a large amount. The viewing item information may come from a variety of sources, perhaps from manual records by a caregiver, perhaps collected by a medical facility, and perhaps from other information systems such as a hospital administration system, a clinical laboratory information system, an electronic medical advice system.
The observation item information has the characteristics of high complexity and strong correlation, for example, clinical scoring needs to extract observation item data from a plurality of data sources, calculate and sum the observation item data, and then map the result to a final score, and a plurality of interdependent calculation relations exist among the observation items. In addition, the relationship between the observation items can have the requirement of changing along with the application scene, which requires that the calculation formula has certain configurability.
Disclosure of Invention
The invention provides a device and a method for automatically calculating an observation item according to a formula, which adopt the following technical scheme:
an apparatus for automatically calculating an observation term according to a formula, comprising:
the data receiving module is used for receiving a plurality of observation items, and the observation items comprise dictionary observation items and numerical observation items;
the data storage module is used for storing the received observation items;
the observation item module is used for carrying out model definition on all observation items;
the dictionary module is used for defining calculated values corresponding to different dictionary class observation items;
the calculation formula module is used for defining a plurality of first calculation formulas for correlation calculation among the observation items and the input and the output of each first calculation formula;
the calculation triggering module is used for defining triggering conditions of each first calculation formula;
and the calculation runtime module is used for automatically calling a corresponding first calculation formula according to the trigger condition defined by the calculation trigger module to perform correlation calculation on the observation items stored in the data storage module.
Further, the compute runtime module includes:
the general graph generating unit is used for automatically generating a directed acyclic graph as a general graph of all the calculation relations according to the relations of the observation terms defined by all the first calculation formulas;
the subgraph generation unit is used for extracting subgraphs related to current calculation from the directed acyclic graph according to observation items related to a certain first calculation formula when the first calculation formula is triggered;
the topology sequencing unit is used for carrying out topology sequencing on the generated subgraphs and determining the calculation sequence of the related observation;
the first data acquisition unit is used for acquiring corresponding numerical value observation items and dictionary observation items from the data storage module according to the model definition of the observation item module and acquiring a calculation value corresponding to the dictionary observation items from the dictionary module;
the data injection unit is used for injecting the obtained calculated values corresponding to the numerical value class observation items and the dictionary class observation items into the subgraph;
a second data acquisition unit for acquiring calculation parameters required for calculation;
and the formula calculation unit is used for calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the calculated sequence of the topological sequencing.
Further, the formula calculation unit includes:
the syntax analysis subunit is used for performing syntax analysis on the triggered first calculation formula to generate a syntax tree;
the variable subunit is used for replacing the variable in the first calculation formula with corresponding data;
an operator sub-unit for defining operator meaning in the first calculation formula;
a function subunit, configured to define a meaning of a function in the first calculation formula;
the evaluation subunit is used for traversing the syntax tree and calculating a root node as the output of the first calculation formula;
and the result exporting unit exports all the observation item calculation results in the subgraph to the corresponding observation items after all the calculations are finished.
Further, the observation item module includes:
the observation item basic model unit is used for defining the universal metadata of the observation item, and comprises a code, a name, a data type and a default value of the observation item;
the observation item additional model unit is used for defining the non-universal metadata of the observation item, and comprises dictionary codes of the dictionary type observation items, a reasonable numerical range and decimal digits of the numerical type observation items;
the calculation formula module comprises:
the abstract formula unit is used for editing and storing all the first calculation formulas;
a formula input unit for defining an input of each first calculation formula;
and the formula output unit is used for defining the output of each first calculation formula.
Further, the calculation formula module is also used for defining a plurality of second calculation formulas of the correlation calculation between the target item and the observation item and the input and the output of each second calculation formula;
the abstract formula unit also stores all second calculation formulas;
the formula input unit is also used for defining the input of each second calculation formula;
the formula output unit is also used for defining the output of each second calculation formula.
A method for automatically calculating an observation term according to a formula, comprising the steps of:
receiving a plurality of observation items, wherein the observation items comprise dictionary observation items and numerical observation items;
storing the received observation items;
performing model definition on all observation items;
defining calculation values corresponding to different dictionary class observation terms;
defining first calculation formulas for correlation calculations between observation terms and inputs and outputs of each of the first calculation formulas;
defining a trigger condition of each first calculation formula;
and automatically calling a corresponding first calculation formula according to a defined trigger condition to perform correlation calculation on the stored observation items.
Further, the specific method for automatically calling the corresponding first calculation formula according to the defined trigger condition to perform the association calculation on the stored observation items includes:
automatically generating a directed acyclic graph as a general graph of all the calculation relations according to the relations of the observation terms defined by all the first calculation formulas;
when a certain first calculation formula is triggered, extracting a subgraph related to the current calculation from the directed acyclic graph according to an observation term related to the first calculation formula;
carrying out topological sorting on the generated subgraphs and determining the calculation sequence of the related observations;
acquiring corresponding numerical value observation items and dictionary observation items from the stored observation items according to the model definition of all the observation items, and acquiring a calculation value corresponding to the dictionary observation items;
injecting the obtained calculated values corresponding to the numerical value class observation items and the dictionary class observation items into the subgraph;
acquiring calculation parameters required by calculation;
and calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the calculated sequence of the topological sequencing.
Further, according to the subgraph of the injected data and the obtained calculation parameters, the specific method for calculating the calculation result of each step in sequence according to the sequence calculated by topological sorting comprises the following steps:
carrying out syntactic analysis on the triggered first calculation formula to generate a syntactic tree;
replacing variables in the first calculation formula with corresponding data;
traversing the syntax tree and calculating a root node as the output of the calculation formula according to the operator meaning and the function meaning in the calculation formula;
and after all the calculation is finished, exporting calculation results of all the observation items in the subgraph to the corresponding observation items.
Further, the specific method for performing model definition on all observation items is as follows:
defining general metadata of the observation item, including a code, a name, and a data type of the observation item;
defining non-universal metadata of the observation items, wherein the non-universal metadata comprises dictionary codes of the dictionary type observation items, and reasonable numerical ranges and decimal point numbers of the numerical type observation items;
the specific method of defining the first calculation formulas of the correlation calculation between the observation terms and the input and output of each first calculation formula is as follows:
editing and storing all first calculation formulas;
defining an input for each first calculation formula;
the output of each first calculation formula is defined.
Further, the method for automatically calculating the observation term according to the formula further comprises the following steps:
defining a plurality of second calculation formulas of the correlation calculation between the target item and the observation item and the input and the output of each second calculation formula;
and selecting a corresponding observation item from the stored observation items according to a selected certain second calculation formula to calculate to obtain a corresponding target item.
The device and the method for automatically calculating the observation items according to the formulas have the advantages that the model definition is carried out on the observation items, the corresponding calculation values are set for the dictionary observation items, a plurality of first calculation formulas for the correlation calculation among the observation items are defined, the triggering condition of each first calculation formula is set, and the automatic correlation calculation is automatically carried out on the input observation items according to the setting.
Drawings
FIG. 1 is a schematic diagram of an apparatus for automatically calculating an observation term according to a formula according to the present invention;
FIG. 2 is a schematic diagram of a view item module of the present invention;
FIG. 3 is a schematic diagram of a calculation formula module of the present invention;
FIG. 4 is a schematic diagram of the compute runtime module of the present invention;
FIG. 5 is a schematic diagram of a formula calculation unit of the present invention;
the system comprises a
Detailed Description
The invention is described in detail below with reference to the figures and the embodiments.
Fig. 1 shows an apparatus for automatically calculating observation terms according to a formula according to the present invention, in which the observation terms mainly refer to data related to the patient himself, such as vital signs, administration dosage, statistics of the amount of input and output, clinical scores, etc. It mainly comprises: the system comprises a
The
Data sources of the
The
The
The
The
The
The
Specifically, the general
As shown in fig. 5, wherein the
It is understood that when one of the first calculation formulas is changed, the general
As a preferred embodiment, the
The invention also discloses a method for automatically calculating the observation item according to the formula, which comprises the following steps:
(1) a number of observation terms are received, the observation terms including a dictionary-like observation term and a numeric-like observation term.
(2) The received observation items are stored.
(3) Model definition is performed for all observation terms.
The specific method for performing model definition on all the observation items comprises the following steps: general metadata defining the observation item includes the code, name, and data type of the observation item. Non-generic metadata defining observations, including dictionary codes for dictionary class observations and reasonable numerical ranges and decimal places for numerical class observations.
(4) And defining the calculated values corresponding to the observation items of different dictionary classes.
(5) First calculation formulas defining calculation of associations between observation terms and inputs and outputs of each of the first calculation formulas.
The specific method of defining the first calculation formulas of the correlation calculation between the observation terms and the input and output of each first calculation formula is as follows: all the first calculation formulas are edited and stored. The input of each first calculation formula is defined. The output of each first calculation formula is defined.
(6) A trigger condition for each first calculation formula is defined.
(7) And automatically calling a corresponding first calculation formula according to a defined trigger condition to perform correlation calculation on the stored observation items.
Specifically, the specific method for automatically calling the corresponding first calculation formula according to the defined trigger condition to perform the association calculation on the stored observation items includes: and automatically generating a directed acyclic graph as a total graph of all the calculation relations according to the relations of the observation terms defined by all the first calculation formulas. When a certain first calculation formula is triggered, extracting a subgraph related to the current calculation from the directed acyclic graph according to the observation term related to the first calculation formula. And carrying out topological sorting on the generated subgraphs, and determining the calculation order of the related observations. And acquiring corresponding numerical value observation items and dictionary observation items from the stored observation items according to the model definition of all the observation items, and acquiring a calculation value corresponding to the dictionary observation items. And injecting the calculated values corresponding to the acquired numerical value class observation items and the acquired dictionary class observation items into the subgraph. And acquiring calculation parameters required by calculation. And calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the calculated sequence of the topological sequencing.
The specific method for calculating the calculation result of each step in sequence according to the subgraph of the injection data and the obtained calculation parameters and the sequence calculated by topological sorting comprises the following steps: and parsing the triggered first calculation formula to generate a syntax tree. And replacing the variables in the first calculation formula with corresponding data. And traversing the syntax tree and calculating a root node as the output of the calculation formula according to the operator meaning and the function meaning in the calculation formula. And after all the calculation is finished, exporting calculation results of all the observation items in the subgraph to the corresponding observation items.
As a preferred embodiment, the method of automatically calculating the observation term according to the formula further includes:
(8) a number of second calculation formulas defining an association calculation between the target item and the observation item, and an input and an output of each second calculation formula.
(9) And selecting a corresponding observation item from the stored observation items according to a selected certain second calculation formula to calculate to obtain a corresponding target item.
The foregoing illustrates and describes the principles, general features, and advantages of the present invention. It should be understood by those skilled in the art that the above embodiments do not limit the present invention in any way, and all technical solutions obtained by using equivalent alternatives or equivalent variations fall within the scope of the present invention.
- 上一篇:一种医用注射器针头装配设备
- 下一篇:识别专有名词的系统和方法