Method of machine-readable representation of medical knowledge
The system addresses the challenge of converting medical documents across different formats by representing them as semantic subgraphs, normalized using medical code systems and ontologies, achieving efficient and semantically interoperable use in healthcare systems.
Patent Information
- Authority / Receiving Office
- RU · RU
- Patent Type
- Patents
- Current Assignee / Owner
- OBSHCHESTVO S OGRANICHENNOJ OTVETSTVENNOSTYU LABORATORIYA INFORMATSIONNYKH SISTEM REALNOGO VREMENI
- Filing Date
- 2025-12-25
- Publication Date
- 2026-07-01
Smart Images

Figure 00000001_ABST
Abstract
Description
[0001] FIELD OF TECHNOLOGY
[0002] This technical solution belongs to the field of computer engineering, and more precisely to solutions related to the processing of medical information, semantic interoperability of medical data and ontological representation of knowledge.
[0003] STATE OF THE ART
[0004] The prior art discloses solution US2005240439 (A1) - 2005-10-27. The analog describes a system and method for automatically assigning medical codes to unformatted data. The system automatically assigns medical codes, such as ICD codes (ICD-9 and ICD-10, as well as other versions), to unformatted or uncoded medical documents (e.g., medical records, discharge summaries, etc.). The system reads the document and then scans (evaluates) it for diagnoses associated with the medical codes. After establishing a diagnosis, the system can also examine the linguistic context in which this diagnosis appears. Using rules derived from syntactic and semantic usage, the system decides whether or not to apply the identified ICD code to the processed document. The result of the module's work is a set of medical codes and corresponding diagnoses that comply with generally accepted syntactic and semantic coding rules.These codes can be stored or used on various media, such as database records, attachments to the document itself, email to the document owner, electronic or paper forms, etc.
[0005] The proposed technical solution is aimed at eliminating the shortcomings of the current state of the art and differs from known solutions in that the proposed solution ensures high-quality and efficient automated conversion of medical documents between various forms of representation (e.g., FHIR, HL7 v2, CDA / CCD, DICOM, JSON, CSV, etc.) while preserving the semantics of the medical document by representing documents in the internal form of semantic subgraphs of terms, subsequent normalization of terms according to medical code systems and ontologies, and validation of these subgraphs based on a unified knowledge graph, including a biomedical graph of the PrimeKG type, which makes it possible to achieve semantically interoperable use of medical information in various healthcare information systems.
[0006] SUMMARY OF THE INVENTION
[0007] The technical problem addressed by the claimed solution is the creation of a system and method for converting medical documents. Additional embodiments of the present invention are presented in the dependent claims.
[0008] The technical result consists in the efficient automated conversion of medical documents between various forms of representation (for example, FHIR, HL7 v2, CDA / CCD, DICOM, JSON, CSV, etc.) while ensuring high-quality preservation of the semantics of the medical document by representing documents in the internal form of semantic subgraphs of terms, subsequent normalization of terms according to medical code systems and ontologies and validation of the said subgraphs based on a unified knowledge graph, including a biomedical graph of the PrimeKG type, which makes it possible to achieve semantically interoperable use of medical information in various healthcare information systems.
[0009] The claimed result is achieved by implementing a medical document conversion system, including at least one computing device and an interface for exchanging data with external clinical systems, and containing:
[0010] - a document reception and pre-processing module configured to receive medical documents in at least one of the FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML and CSV formats and convert the said documents into an internal representation;
[0011] - a module for constructing a semantic representation of a document, associated with a module for receiving and pre-processing documents and configured to parse the internal representation of an input document into a set of terms associated with at least diagnoses, procedures, observations, studies and drugs, and to form a semantic subgraph of the document, the nodes and edges of which correspond to the specified terms and their relationships;
[0012] - an operation processing module associated with the module for constructing a semantic representation of a document and the terminology service and configured to perform at least the operations of normalization, validation, comparison and expansion of nodes of a semantic subgraph based on medical code systems and ontologies;
[0013] - a terminology service containing a registry of coding systems and ontologies, including at least one of the coding systems for diagnoses, procedures, observations, laboratory tests and drugs, a code mapping module implementing rules and deterministic procedures for processing terms, and a module for caching pairs “term description - term code”;
[0014] - a unified knowledge graph that includes a repository of nodes, edges, attributes, and axioms, and a programming interface for receiving queries and performing read and update operations on said repository, wherein the unified knowledge graph is structured with the ability to store and use biomedical ontologies and knowledge graphs;
[0015] - a semantic subgraph validation module associated with the operation processing module and the unified knowledge graph and configured to match nodes and edges of the semantic subgraph with nodes and edges of the unified knowledge graph and to check at least the consistency of term codes, the admissibility of relationships between them and the completeness of coding with respect to specified ontological constraints;
[0016] - a conflict resolution module associated with an operation processing module, a semantic subgraph validation module and a unified knowledge graph and containing a term resolver configured to perform a secondary search for term codes using deterministic linguistic analysis and semantic search in the unified knowledge graph, and a query generator configured to generate queries to the unified knowledge graph in the graph query language to clarify the structure of the semantic subgraph;
[0017] - a module for generating output documents, associated with a semantic subgraph validation module and configured to generate an output medical document in the target format based on a validated semantic subgraph, ensuring that the semantics of the original medical document are preserved when the presentation form is changed;
[0018] - a security and audit module associated with the specified modules and configured to authenticate and authorize requests, record construction logs, normalize and validate semantic subgraphs, and provide information on the progress of the semantic transformation of each data element upon request.
[0019] In a particular embodiment of the described system, the operation processing module is configured to access the terminology service through an interface that implements code search operations, checks for membership in a set, and expands sets that are compatible with the operations of the FHIR terminology service, while the system does not require knowledge of the internal structure of clinical system repositories and performs semantic normalization of terms at the level of code systems and ontologies.
[0020] In a particular embodiment of the described system, the unified knowledge graph is structured with the ability to integrate biomedical ontologies and knowledge graphs, including graphs similar in structure and purpose to the PrimeKG biomedical graph, with the nodes of the unified knowledge graph additionally containing links to external identifiers borrowed from biomedical ontologies and registries of diseases, phenotypes, and drugs.
[0021] In a particular embodiment of the described system, the resolver of the terms of the conflict resolution layer is designed with the ability to sequentially apply deterministic linguistic analysis and contextual verification of terms based on the structure of the medical document and the semantic subgraph, and when selecting a code, restrictions on the permissible combinations of codes and the context of their use are taken into account, while this approach uses the unified knowledge graph as a source of restrictions and semantic connections
[0022] In a particular embodiment of the described system, the terminology service contains a subsystem for semantic expansion of terms, designed with the ability to calculate semantically related terms based on ontological relationships in a selected ontology, due to which expanded sets of terms are formed during search and normalization, while the subsystem uses ontological relationships for semantic search using the specified search in the contour of construction and validation of the semantic subgraph of a medical document.
[0023] In a particular embodiment of the described system, the security and audit module additionally contains means for maintaining audit logs that record, for each converted medical document, information about the versions of the used coding systems, ontologies and the state of the unified knowledge graph, as well as information about the operation of the conflict resolution layer, which ensures end-to-end traceability of the conversion results and the ability to subsequently control the correctness of the coding and data comparison.
[0024] The claimed technical result is also achieved by implementing a method for converting medical documents, which is implemented by the above-mentioned system, and the method includes the steps of:
[0025] - accept at least one input medical document from an external medical system in one of the following formats: FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML, CSV in the input interface;
[0026] - transform the specified input medical document into an internal representation in the input module;
[0027] - perform parsing of the internal representation in the module for constructing the semantic representation of the document and form a semantic subgraph of the document containing nodes corresponding to terms describing at least diagnoses, procedures, observations, studies and drugs, and edges representing semantic relationships between the specified nodes;
[0028] - perform primary normalization of the nodes of the semantic subgraph in the operation processing module by sending requests to the terminology service, in which the code mapping module, using the mapping cache and the registry of code systems and ontologies, maps each node to at least one code in the target code system;
[0029] - if there is no primary normalization result for one or more nodes of the semantic subgraph, a secondary search for codes is initiated by passing the corresponding queries to the conflict resolution layer, in which the term resolver performs a deterministic linguistic analysis of the terms and generates refined queries, and the query generator constructs queries to the unified knowledge graph;
[0030] - execute the generated queries in the unified knowledge graph, obtain at least one node of the unified knowledge graph that semantically corresponds to the nodes of the semantic subgraph, and assign to the specified nodes codes associated with the found nodes of the unified knowledge graph;
[0031] - perform in the semantic subgraph validation module a comparison of the nodes and edges of the semantic subgraph with the nodes and edges of the unified knowledge graph and check the consistency of codes, the admissibility of relations and the completeness of the semantic description of the document in relation to the specified ontological constraints;
[0032] - in case of successful validation, an output medical document is generated in the output document generation module in the target format based on the validated semantic subgraph, ensuring the preservation of the semantics of the original medical document;
[0033] - registers in the security and audit module information about the construction, normalization and validation of the semantic subgraph, including the used versions of code systems, ontologies and the state of the unified knowledge graph.
[0034] In a particular embodiment of the described method, when performing the primary normalization of the nodes of the semantic subgraph, requests to the terminology service are formed and processed using the operations of the terminology service that supports the REST and FHIR programming interfaces, including at least the operations of code search and expansion of set values, while the normalization of the semantic subgraph is performed as a separate ontological stage, independent of the choice of the target format of the output document.
[0035] In a particular embodiment of the described method, during a secondary search for term codes for nodes of a semantic subgraph in a unified knowledge graph, queries are additionally expanded using ontologically linked nodes of the unified knowledge graph and the found nodes are subsequently ranked according to the degree of semantic closeness to the original term, with the unified knowledge graph constructed taking into account the structure of biomedical knowledge graphs.
[0036] In a particular embodiment of the described method, before assigning a code to a node of the semantic subgraph, an additional check of the context of the corresponding term in the document and in the entire semantic subgraph is performed, including an analysis of the admissibility of code combinations and their consistency with the ontological constraints of the unified knowledge graph, and the rules of contextual checking used take into account the approaches of contextual and restrictive medical coding.
[0037] In a particular embodiment of the described method, when registering information about the construction, normalization, and validation of a semantic subgraph in the security and audit module, the identifiers of the versions of the used code systems, ontologies, and the state of the unified knowledge graph are additionally saved, as well as information about the applied conflict resolution rules, which ensures the possibility of semantic traceability and subsequent audit of the correctness of the transformation of medical documents and their comparison.
[0038] DESCRIPTION OF DRAWINGS
[0039] The invention will be further described in accordance with the accompanying drawings, which are provided to clarify the essence of the invention and in no way limit the scope of the invention. The following drawings are attached to the application:
[0040] Fig. 1 illustrates the overall architecture of the medical document conversion system.
[0041] DETAILED DESCRIPTION OF THE INVENTION
[0042] The following detailed description of the invention includes numerous implementation details to provide a clear understanding of the present invention. However, one skilled in the art will readily understand how the present invention may be used with or without these implementation details. In other instances, well-known methods, procedures, and components have not been described in detail to avoid unnecessarily obscuring the features of the present invention.
[0043] Furthermore, it will be clear from the foregoing description that the invention is not limited to the embodiment described. Numerous possible modifications, changes, variations, and substitutions, while preserving the spirit and form of the present invention, will be apparent to those skilled in the art.
[0044] This group of inventions relates to the field of medical information processing, semantic interoperability of medical data, and ontological knowledge representation. The proposed method for semantically correct transformation of medical documents and the system implementing it, in a preferred embodiment, can be used for the automated transformation of medical documents between various representation forms (e.g., FHIR, HL7 v2, CDA / CCD, DICOM, JSON, CSV, etc.) while ensuring the preservation of the semantics of the medical document by representing documents in the internal form of semantic subgraphs of terms, subsequent normalization of terms according to medical coding systems and ontologies, and validation of said subgraphs based on a unified knowledge graph, including a biomedical graph of the PrimeKG type, which enables the semantically interoperable use of medical information in various healthcare information systems.
[0045] The architecture of the system for semantically correct transformation of medical documents is organized into several interconnected layers (Fig. 1) that support document reception from external systems, construction of a semantic document subgraph, terminology normalization using coding systems and ontologies, subgraph validation using a unified knowledge graph, and generation of output documents in the target format while preserving the original semantics. The system relies on a single semantic layer, including a terminology service and a unified knowledge graph compatible with biomedical knowledge graphs such as PrimeKG.
[0046] The positive technical effect of the solution implementation consists of the effective automated conversion of medical documents between various presentation forms with high-quality preservation of the semantics of the medical document, due to the presentation of documents in the internal form of semantic subgraphs of terms, subsequent normalization of terms according to medical code systems and ontologies and validation of these subgraphs based on a unified knowledge graph, including a biomedical graph of the PrimeKG type, which allows for the semantically interoperable use of medical information in various healthcare information systems.
[0047] External Systems and Semantic Gateway
[0048] In the preferred implementation, the external loop includes medical (clinical) information systems (EHR, LIS, RIS, registries), analytical applications, and AI pipelines that exchange medical documents and transformation requests with the system. All incoming requests pass through the Semantic Gateway component, which includes an API, format adapters, a semantic subgraph construction module, operation handlers, a conflict resolution module, and an output document generation module. The format adapters accept documents in FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML, and CSV standards and convert them to an internal representation. The semantic subgraph construction module then extracts terms (diagnoses, procedures, observations, studies, medications, etc.) from the document and constructs a subgraph of the terms and their relationships.
[0049] Operation handlers perform basic semantic operations on the semantic subgraph: normalization, validation, matching, and term expansion based on connections to the terminology service and the unified knowledge graph. In cases of ambiguous codes or conflicts, a conflict resolution layer is used, containing a term resolver (combining deterministic NLP analysis and document context) and a query generator for the unified knowledge graph (GraphQL / SPARQL / Cypher), which allows for refinement of term meanings and subgraph structure. After successful subgraph normalization and validation, the output document generation module translates it into the required format (e.g., FHIR resources or CDA / CCD documents) while preserving the original semantic structure.
[0050] Unified Semantic Layer: Terminology Service and Unified Knowledge Graph
[0051] The unified semantic layer includes a terminology service and a unified knowledge graph, which serve as the central semantic repository for the system. The terminology service provides an API (compatible with both REST and the FHIR Terminology Service or equivalent), a code mapping module, a registry of code systems and ontologies, a mapping cache, and an update export module, providing centralized access to standardized codes and mappings. The registry of code systems and ontologies includes, among other things, ICD, SNOMED CT, LOINC, HPO, MONDO, RxNorm, ATC, and other domain-specific vocabularies, while the code mapping module implements transformation rules and deterministic NLP for matching narrative terms to codes and maintaining cross-references between systems. The mapping cache allows for faster requeries and the capture of stable mappings, while the update export module is responsible for distributing changes to code system versions and cross-references.
[0052] The unified knowledge graph includes a graph store (nodes, edges, attributes, axioms), a graph API (GraphQL / SPARQL / Cypher), and a snapshot and version export module, providing an ontologically grounded representation of medical entities and their relationships. The structure of the unified knowledge graph is compatible with the architecture of biomedical graphs such as PrimeKG: it represents diseases, phenotypes, genes, drugs, and other entities connected by multiple typed edges, allowing it to be used for validating semantic subgraphs of documents and semantic query expansion. The semantic subgraph validation module, linked to both operation handlers and the unified knowledge graph, uses this graph to check the consistency of codes, the validity of relationships between terms, and the completeness of the document description relative to ontological constraints, forming the basis for semantically correct transformations.
[0053] Security, Transparency, and Audit
[0054] The security, transparency, and audit component is integrated with all core subsystems: the semantic gateway, terminology service, and unified knowledge graph. It implements request authentication and authorization, manages access rights to terminology resources and graph data, and maintains logs of operations for constructing, normalizing, and validating semantic subgraphs. These logs also record versions of code systems, ontologies, and unified knowledge graph states, ensuring end-to-end traceability of medical document transformations and the ability to subsequently audit coding accuracy and compliance with semantic interoperability requirements.
[0055] System Architecture Components
[0056] Outer contour
[0057] • Medical (clinical) systems (EHR, LIS, RIS, registries)
[0058] Exchange structured and semi-structured medical documents (FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML, CSV) with the system and receive back documents in the target format.
[0059] • Analytics
[0060] Uses the results of semantic transformation (normalized codes, links to the knowledge graph) for statistics, reporting, quality analysis and other tasks.
[0061] • AI pipelines
[0062] Consume normalized and semantically validated data to train and apply models (recommender systems, risk forecasts, etc.), based on an agreed-upon ontological model.
[0063] Semantic Gateway
[0064] • API
[0065] Single entry point for all external clients; accepts document transformation requests and returns results, providing protocol and transport interoperability (REST / gRPC, authorization, response format).
[0066] • Format adapters
[0067] Convert input documents from various standards (FHIR, HL7 v2, CDA / CCD, DICOM, JSON, CSV) into an internal canonical representation, normalizing the structure and metadata, but not yet binding to coding systems.
[0068] • Semantic subgraph construction module
[0069] Disassembles the internal representation of a document, identifies medical entities (diagnoses, procedures, observations, studies, medications, etc.) and their relationships, and constructs a semantic subgraph of the document (nodes-terms and edges-relationships).
[0070] • Operation handlers
[0071] Perform basic semantic operations on the semantic subgraph: normalization of terms by code systems, matching, expansion by ontology, launching validation, and initiating calls to the terminology service and the unified knowledge graph.
[0072] • Term Resolver
[0073] Handles cases of ambiguous or missing codes: applies deterministic NLP analysis and document context (surrounding subgraph nodes), generates refined queries to the terminology service and the unified knowledge graph.
[0074] • Query Generator
[0075] Generates queries against a federated knowledge graph (GraphQL / SPARQL / Cypher) based on the output of a term resolver and the subgraph structure to find semantically relevant nodes and relations in the graph.
[0076] • Semantic Subgraph Validation Module
[0077] Compares the constructed document subgraph with the unified knowledge graph: verifies that the term codes exist and are relevant, the relationships between them are valid in terms of ontological constraints, and the document description is complete for the given scenario.
[0078] • Output document generation module
[0079] Converts a validated semantic subgraph into a target format (FHIR resources, CDA / CCD, JSON, etc.), filling in codes and structures according to the requirements of the standard and preserving the semantic structure of the document.
[0080] Unified Semantic Layer
[0081] Terminology Service
[0082] • Terminology API
[0083] Provides terminology service operations (code lookup, set expansion, ValueSet membership checking, mapping between code systems) via RESTful interfaces and FHIR-compliant Terminology Service or equivalent.
[0084] • Code mapping
[0085] Implements mapping rules between textual representations of terms (narratives) and codes, as well as between codes of different systems (ConceptMap), using deterministic NLP and predefined transformation rules.
[0086] • Code systems and ontologies
[0087] Registers and stores descriptions of code systems (ICD, SNOMED CT, LOINC, HPO, MONDO, RxNorm, ATC, etc.) and associated ontologies; serves as a source of "reference" values for mapping and validation.
[0088] • Mapping cache
[0089] Stores the result of previously performed narrative → code mappings and transcodings between systems to speed up repeat queries and offload the main register and graph.
[0090] • Export updates
[0091] Propagates changes in code systems, ontologies, and cross-references (new versions, additional mappings) to other system components, including the cache and, if necessary, external consumers.
[0092] Unified Knowledge Graph
[0093] • Graph storage
[0094] Contains entities (nodes) and links (edges) of a unified knowledge graph with attributes and ontological axioms; serves as a semantic "layer of truth" for verifying and expanding document subgraphs.
[0095] • Graph API
[0096] Provides an interface (GraphQL / SPARQL / Cypher or similar) for performing graph queries: finding nodes and paths, checking constraints, retrieving subgraphs for validation and semantic expansion.
[0097] • Export updates
[0098] Generates snapshots and versioned dumps of the knowledge graph (e.g. for analytics, model training, backup and replication), and can also be used for synchronization with external graph systems.
[0099] Security, Transparency, and Audit
[0100] • Security, transparency and audit module (Audit).
[0101] Provides authentication and authorization of requests to all components, management of roles and access policies, and operation logging (document transformation, normalization, validation, graph and terminology access). The logs record the used versions of code systems, ontologies, and graph state, ensuring end-to-end traceability and the ability to subsequently audit the quality and correctness of transformations.
[0102] Although the invention has been described with reference to the disclosed embodiments, it will be apparent to those skilled in the art that the specific experiments described in detail are provided merely for the purpose of illustrating the present invention and should not be construed as limiting the scope of the invention in any way. It should be understood that various modifications can be made without departing from the spirit of the present invention.
Claims
1. A medical document conversion system comprising at least one computing device and an interface for exchanging data with external clinical systems, comprising: – a module for receiving and pre-processing documents, configured to receive medical documents in at least one of the following formats: FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML and CSV and converting said documents into an internal representation; - a module for constructing a semantic representation of a document, connected to a module for receiving and pre-processing documents and configured to parse the internal representation of an input document into a set of terms associated with at least diagnoses, procedures, observations, studies and drugs, and to form a semantic subgraph of the document, the nodes and edges of which correspond to the specified terms and their relationships; - an operations processing module associated with a module for constructing a semantic representation of a document and a terminology service and configured to perform at least the operations of normalization, validation, comparison and expansion of nodes of a semantic subgraph based on medical code systems and ontologies; – a terminology service containing a registry of coding systems and ontologies, including at least one of the coding systems for diagnoses, procedures, observations, laboratory tests and drugs, a code mapping module implementing rules and deterministic procedures for processing terms, and a module for caching pairs “term description – term code”; – a unified knowledge graph that includes a repository of nodes, edges, attributes, and axioms and a programming interface for receiving requests and performing read and update operations on said repository, wherein the unified knowledge graph is structured with the ability to store and use biomedical ontologies and knowledge graphs; - a semantic subgraph validation module associated with the operation processing module and the unified knowledge graph and configured to match nodes and edges of the semantic subgraph with nodes and edges of the unified knowledge graph and to check at least the consistency of term codes, the admissibility of relationships between them and the completeness of coding with respect to specified ontological constraints; - a conflict resolution module associated with an operation processing module, a semantic subgraph validation module and a unified knowledge graph and containing a term resolver configured to perform a secondary search for term codes using deterministic linguistic analysis and semantic search in the unified knowledge graph, and a query generator configured to generate queries to the unified knowledge graph in the graph query language to clarify the structure of the semantic subgraph; – a module for generating output documents, connected to a semantic subgraph validation module and configured to generate an output medical document in the target format based on a validated semantic subgraph, ensuring the preservation of the semantics of the original medical document when changing the presentation form; – a security and audit module associated with the said modules and capable of authenticating and authorizing requests, recording construction logs, normalizing and validating semantic subgraphs, and providing information on the progress of the semantic transformation of each data element upon request.
2. The system according to claim 1, in which the operation processing module is configured to access the terminology service through an interface that implements the operations of code search, check for membership in a set, and expansion of sets, compatible with the operations of the terminology service that supports the REST and FHIR programming interfaces, while the system does not require knowledge of the internal structure of the clinical system repositories and performs semantic normalization of terms at the level of code systems and ontologies.
3. The system according to paragraph 1, in which the unified knowledge graph is structured with the ability to integrate biomedical ontologies and knowledge graphs, including graphs similar in structure and purpose to the PrimeKG biomedical graph, wherein the nodes of the unified knowledge graph additionally contain links to external identifiers borrowed from biomedical ontologies and registries of diseases, phenotypes and drugs.
4. The system of claim 1, wherein the term resolver of the conflict resolution layer is configured to sequentially apply deterministic linguistic analysis and contextual checking of terms based on the structure of the medical document and the semantic subgraph, wherein when selecting a code, restrictions on the permissible combinations of codes and the context of their use are taken into account, and wherein said approach uses a unified knowledge graph as a source of restrictions and semantic relationships.
5. The system according to paragraph 1, in which the terminology service contains a subsystem for semantic expansion of terms, configured to calculate semantically related terms based on ontological relationships in a selected ontology, due to which expanded sets of terms are formed during search and normalization, wherein the subsystem uses ontological relationships for semantic search using the specified search in the contour of construction and validation of the semantic subgraph of a medical document.
6. The system according to paragraph 1, in which the security and audit module additionally contains means for maintaining audit logs that record, for each converted medical document, information about the versions of the used coding systems, ontologies and the state of the unified knowledge graph, as well as information about the activation of the conflict resolution layer, which ensures end-to-end traceability of the conversion results and the possibility of subsequent control over the correctness of the coding and comparison of clinical and financial data.
7. A method for converting medical documents, implemented by the system according to paragraph 1, including the steps of: – accept at least one input medical document from an external clinical system in one of the following formats: FHIR, HL7 v2, CDA / CCD, DICOM, JSON, XML, CSV in the input interface; – transform the specified input medical document into an internal representation in the input module; – perform analysis of the internal representation in the module for constructing the semantic representation of the document and form a semantic subgraph of the document containing nodes corresponding to terms describing at least diagnoses, procedures, observations, studies and drugs, and edges representing semantic relationships between the specified nodes; – carry out the primary normalization of the nodes of the semantic subgraph in the operation processing module by transmitting requests to the terminology service, in which the code mapping module, using the mapping cache and the register of code systems and ontologies, maps each node to at least one code in the target code system; – if there is no result of primary normalization for one or more nodes of the semantic subgraph, a secondary search for codes is initiated by passing the corresponding queries to the conflict resolution layer, in which the term resolver performs a deterministic linguistic analysis of terms and generates refined queries, and the query generator constructs queries to the unified knowledge graph; – execute the generated queries in the unified knowledge graph, obtain at least one node of the unified knowledge graph that semantically corresponds to the nodes of the semantic subgraph, and assign to the specified nodes codes associated with the found nodes of the unified knowledge graph; – in the semantic subgraph validation module, they perform a comparison of the nodes and edges of the semantic subgraph with the nodes and edges of the unified knowledge graph and check the consistency of the codes, the admissibility of the relationships and the completeness of the semantic description of the document in relation to the specified ontological constraints; – in case of successful validation, an output medical document is generated in the output document generation module in the target format based on the validated semantic subgraph, ensuring the preservation of the semantics of the original medical document; – register in the security and audit module information about the construction, normalization and validation of the semantic subgraph, including the used versions of code systems, ontologies and the state of the unified knowledge graph.
8. The method according to claim 7, wherein, when performing the initial normalization of the nodes of the semantic subgraph, queries to the terminology service are formed and processed using the operations of the FHIR terminology service, including at least the operations of code search and expansion of set values, wherein the normalization of the semantic subgraph is performed as a separate ontological stage, independent of the choice of the target format of the output document.
9. The method according to claim 7, wherein, during the secondary search for term codes for nodes of the semantic subgraph in the unified knowledge graph, the queries are additionally expanded using ontologically linked nodes of the unified knowledge graph and the found nodes are subsequently ranked according to the degree of semantic closeness to the original term, wherein the unified knowledge graph is constructed taking into account the structure of biomedical knowledge graphs.
10. The method according to paragraph 7, in which, before assigning a code to a node of the semantic subgraph, an additional check of the context of the corresponding term in the document and in the entire semantic subgraph is performed, including an analysis of the admissibility of code combinations and their consistency with the ontological constraints of the unified knowledge graph, wherein the rules of contextual checking used take into account the approaches of contextual and restrictive medical coding.
11. The method according to paragraph 7, in which, when registering information about the construction, normalization and validation of the semantic subgraph in the security and audit module, the identifiers of the versions of the used code systems, ontologies and the state of the unified knowledge graph are additionally saved, as well as information about the applied conflict resolution rules, which ensures the possibility of end-to-end traceability and subsequent audit of the correctness of the transformation of medical documents and their comparison.