A FHIR service construction method and device, electronic equipment and storage medium
By building a full set of structure definition files based on the FHIR standard and integrating data services, the problem of low flexibility in FHIR service construction in existing technologies is solved, enabling fast and flexible FHIR service construction, improving system interoperability and reducing complexity.
Patent Information
- Application Number
- CN202511741189.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-25
AI Technical Summary
Existing technologies are inflexible and complex when building FHIR services, and cannot fully utilize the flexibility and standardization of the FHIR standard, resulting in limited improvement in interoperability.
Based on the FHIR standard, a full structure definition file is built, data resource blocks are constructed through iterative parsing, data models are integrated, and data services are built to provide complete FHIR standard services.
It enables flexible and rapid FHIR service construction, improves system interoperability and flexibility, and reduces system complexity.
Smart Images

Figure CN121209846B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer software technology, and in particular to FHIR service construction technology, specifically to an FHIR service construction method, apparatus, electronic device and storage medium. Background Technology
[0002] FHIR (Fast Health Interoperability Resource) is an international standard developed by the International Organization for Standardization (ISO) HL7 for the exchange of electronic health information. Its core objective is to enable different healthcare systems to easily and securely connect, share, and understand each other's data, thereby achieving interoperability.
[0003] FHIR generally consists of resources, RESTful APIs (Representational State Transition Application Programming Interfaces), structure definitions, and data formats. Resources are the basic building blocks and core concepts of FHIR. Each resource is a well-defined, discrete data unit representing an entity or activity in the healthcare field, such as "Patient" representing an individual receiving healthcare services. RESTful APIs provide a unified, simple, and widely understood way of interacting. Structure definitions are used to define the specific structure of each resource, ensuring that all systems following FHIR have a completely consistent understanding of the same resource. Data formats ensure data readability and cross-platform compatibility.
[0004] When building FHIR services, a standard FHIR server or an XML / JSON mapping method is typically used. Using a standard FHIR server like HAPI-FHIR employs a completely custom FHIR framework. While this provides high support for the FHIR standard, any FHIR extensions require manual coding, resulting in low flexibility. While using an XML / JSON mapping method reduces the reliance on a standard FHIR server, it limits the scope of the original service, merely mapping the native standard to the FHIR standard. If the original service does not meet the corresponding standard, a complete FHIR service cannot be built. Furthermore, it fails to leverage the flexibility and standardization of the FHIR standard to improve interoperability, instead increasing system complexity. Summary of the Invention
[0005] To address the aforementioned deficiencies in the prior art, this application provides an FHIR service construction method, apparatus, electronic device, and storage medium, which can flexibly and quickly construct FHIR services and has strong practicality.
[0006] To achieve the above objectives, the present invention employs the following techniques:
[0007] A method for building an FHIR service includes the following steps:
[0008] Based on the on-site business requirements, a full set of structural definition files were constructed using the FHIR standard.
[0009] The entire structure definition file is parsed in a loop to construct data resource blocks;
[0010] Data models are built based on data resource blocks, and these data models are integrated into a model set.
[0011] Build data services based on model sets;
[0012] Integrate data services and provide complete FHIR standard services to external parties based on the integrated data services.
[0013] An apparatus for building FHIR services includes a full build module, a resource block build module, a model build module, a service build module, and a service provision module;
[0014] The full build module is used to build a full set of structure definition files based on the FHIR standard according to the on-site business requirements;
[0015] The resource building module is used to parse the entire set of structure definition files in a loop and build data resource blocks;
[0016] The model building module is used to build data models based on data resource blocks and integrate the data models into a model set;
[0017] The service building module is used to build data services based on model sets;
[0018] The service provision module is used to integrate data services and provide complete FHIR standard services to the outside world based on the integrated data services.
[0019] An electronic device includes: at least one processor and a memory; wherein the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to perform the FHIR service construction method.
[0020] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, controls the device where the storage medium is located to perform the FHIR service construction method.
[0021] The beneficial effects of this invention are as follows:
[0022] This invention connects the structure definition file based on the FHIR standard with the data model function of existing data centers, so that the structure definition file not only provides support for FHIR verification, but also opens up the way of FHIR standard definition and FHIR standard design, enabling flexible and rapid construction of FHIR services. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the FHIR service construction method according to an embodiment of this application.
[0024] Figure 2 This is a schematic diagram illustrating the process of constructing the full set of structure definition files according to an embodiment of this application.
[0025] Figure 3 This is a flowchart illustrating the process of cyclically parsing the entire structure definition file according to an embodiment of this application.
[0026] Figure 4 This is a schematic diagram of the process of building a data service based on a model set according to an embodiment of this application.
[0027] Figure 5 This is a schematic diagram of the structure of the FHIR service building apparatus according to an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the implementation methods of the present invention will be described in detail below with reference to the accompanying drawings. However, the embodiments described in this invention are only some embodiments of the present invention, and not all embodiments.
[0029] like Figure 1 As shown, one aspect of this application embodiment provides an FHIR service construction method, including the following steps:
[0030] S100. Based on the on-site business requirements, construct a full set of structural definition files based on the FHIR standard.
[0031] S200: Perform loop parsing of the entire structure definition file to construct data resource blocks;
[0032] S300: Construct a data model based on data resource blocks and integrate the data model into a model set.
[0033] S400, data services are built based on model sets.
[0034] S500 integrates data services and provides complete FHIR standard services to external parties based on the integrated data services.
[0035] Step S100 of this embodiment illustrates a method for constructing the full structure definition file, namely, first constructing the full structure definition file (AllPatientStructureDefintition.xml) based on the needs of the field operations and the FHIR standard; the specific construction method of step S100 can be as follows: Figure 2 The preferred solutions S101~S103 shown are implemented as follows:
[0036] S101. Obtain the original structure definition file based on the FHIR standard.
[0037] S102. Design the extended structure definition file according to the on-site business requirements.
[0038] S103. Compare and merge the expanded structure definition file with the original structure definition file to obtain the full structure definition file.
[0039] Taking the Patient resource as an example, step S101 of this embodiment shows a method for obtaining the original structure definition file. That is, the system will first automatically obtain the standard, unmodified original structure definition file (PatientStructureDefintition.xml). This original structure definition file defines a series of standard elements in the standard Patient resource, such as id (logical ID of the resource), identifier (various identifiers of the patient), name (patient's name), gender, birthdate, address, and telephone.
[0040] The standard Patient resource may not have an "occupation" field, but the hospital needs to record this information to determine whether the patient's occupation has an impact on their medical history. Therefore, as shown in step S102, a new element representing the patient's occupation needs to be added to the standard Patient resource to obtain the extended structure definition file (MyPatientStructureDefintition.xml).
[0041] Step S103 of this embodiment shows that the system compares, analyzes, and merges the expanded structure definition file with the original structure definition file to generate a full structure definition file (AllPatientStructureDefintition.xml). This ensures that the final definition file used to build the model contains all the mandatory content and specifications of the FHIR standard, as well as all the custom extensions required by this project.
[0042] Step S200 of this embodiment illustrates a method for constructing data resource blocks, namely, performing a cyclic parsing of the entire structure definition file to construct data resource blocks; specifically, the construction method of step S200 can be as follows: Figure 3 The preferred solutions S201~S203 shown are implemented as follows:
[0043] S201. Use a parser to read every element in the entire structure definition file in a loop.
[0044] S202, Extract attribute information from each element.
[0045] S203. Organize the extracted attribute information into data resource blocks according to their hierarchical relationship.
[0046] Step S201 of this embodiment shows a method for traversing and reading elements, that is, using a parser to read each element tag in the full structure definition file in a loop, that is, reading each element of the Patient resource defined by the full structure definition file, ensuring that no part of the definition in the full structure definition file is missed, thus guaranteeing the completeness and accuracy of the processing.
[0047] Step S202 of this embodiment illustrates a method for obtaining attribute information, namely, extracting the corresponding attribute information from each element read in step S201.
[0048] Step S203 of this embodiment illustrates a method for constructing data resource blocks using attribute information, that is, reorganizing and constructing the scattered attribute information extracted in step S202 into data resource blocks with a certain structure according to their inherent hierarchical relationship.
[0049] Step S300 of this embodiment illustrates a method for constructing a data model and a model set, namely, constructing a data model based on data resource blocks and integrating the data model into a model set; specifically, the method for constructing the data model can be as follows: Figure 3 The preferred solution S301 shown is implemented as follows:
[0050] S301. Map the attribute information in the data resource block to the data model specification of the data center to construct a data model.
[0051] Step S301 of this embodiment illustrates a mapping method for data resource blocks. Taking the Patient resource as an example, in the Mapping data of the full structure definition file, attribute information such as short, min, max, and type is defined. This attribute information can be mapped with the data specification of the data center, such as type, length, enumeration, dictionary, and cardinality. After the mapping in step S301, a Patient resource is split into multiple child nodes, and different data models are constructed for each.
[0052] Step S400 of this embodiment illustrates the construction of a data service based on a model set. Specifically, the method for constructing the data service can be as follows: Figure 4 The preferred solutions S401~S403 shown are implemented as follows:
[0053] S401, A script for creating database tables based on a model set.
[0054] S402. Execute the database table creation script to create the corresponding database table in the database.
[0055] S403, Build a data service API based on database tables.
[0056] Step S401 of this embodiment illustrates the script construction method, which takes the model set as input, uses a script generator to traverse each model in the model set, and generates multiple script files according to their definitions.
[0057] Step S402 of this embodiment illustrates a method for creating a database table by executing a script. That is, after connecting to the target database, the script created in step S401 is submitted to the server of the target database. After receiving the script, the server of the target database parses and executes it to create the corresponding database table.
[0058] S403 of this embodiment illustrates a method for constructing a data service API, namely, writing business logic code based on the database tables created in S402 to construct the corresponding data service API.
[0059] S500 of this embodiment illustrates a method for providing complete FHIR standard services, which involves integrating the data services constructed in S400 and providing complete FHIR standard services externally based on the integrated data services; specifically, the method for providing complete FHIR standard services externally can be as follows: Figure 4 The preferred solution S501 shown is implemented as follows:
[0060] S501 integrates data service APIs and releases them to the outside world, providing complete FHIR standard services.
[0061] S501 of this embodiment illustrates a method for providing complete FHIR standard services to the outside world, which involves uniformly orchestrating and managing the data service API built in S403 before publishing it to the outside world, ultimately achieving flexible and efficient construction of FHIR services.
[0062] like Figure 5 As shown, another aspect of the embodiments of this application provides an FHIR service building apparatus, including a full building module, a resource block building module, a model building module, a service building module, and a service providing module.
[0063] The full build module is used to build a full set of structure definition files based on the FHIR standard according to the on-site business requirements.
[0064] The resource block building module is used to parse the entire structure definition file in a loop and build data resource blocks.
[0065] The model building module is used to build data models based on data resource blocks and integrate the data models into a model set.
[0066] The service building module is used to build data services based on model sets.
[0067] The service provision module is used to integrate data services and provide complete FHIR standard services to the outside world based on the integrated data services.
[0068] Preferred, such as Figure 5 As shown, the full build module includes a raw file acquisition component, an extended file acquisition component, and a merge and comparison component.
[0069] The original file acquisition component is used to acquire the original structure definition file based on the FHIR standard.
[0070] The extended file acquisition component is used to design extended structure definition files based on on-site business requirements.
[0071] The merge comparison component is used to compare and merge the expanded structure definition file with the original structure definition file to obtain the full structure definition file.
[0072] Preferred, such as Figure 5 As shown, the resource block building module includes an element reading component, an attribute extraction component, and an attribute processing component.
[0073] The element reading component is used to read every element in the entire structure definition file in a loop using a parser.
[0074] The attribute extraction component is used to extract attribute information from each element.
[0075] The attribute processing component is used to organize the extracted attribute information into data resource blocks according to their hierarchical relationship.
[0076] The model building module is also used to map the attribute information in the data resource block to the data model specification of the data center to build the data model.
[0077] Preferred, such as Figure 5 As shown, the service building module includes a script creation component, a script execution component, and an API building component.
[0078] The script creation component is used to build database creation tables based on the model set.
[0079] The script execution component is used to execute the script that creates tables in the database, and then create the corresponding database tables in the database.
[0080] API building components are used to build data service APIs based on database tables.
[0081] The service provider module is used to integrate the data service API and publish it to the outside world, providing complete FHIR standard services.
[0082] In another aspect of this application, an electronic device is provided, comprising: at least one processor and a memory; wherein the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to execute the FHIR service construction method described in the preceding embodiments.
[0083] In another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, controls the device where the storage medium is located to execute the FHIR service construction method described in any of the preceding embodiments.
[0084] The above description is only a preferred embodiment of this application and is not intended to limit this application. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application.
Claims
1. A method for constructing an FHIR service, characterized in that, Including the following steps: Based on the on-site business requirements, a full set of structural definition files is constructed based on the FHIR standard, including the following steps: obtaining the original structural definition file based on the FHIR standard; designing the extended structural definition file according to the on-site business requirements; comparing and merging the extended structural definition file with the original structural definition file to obtain the full set of structural definition files. The process involves iteratively parsing the entire structure definition file to construct data resource blocks, including the following steps: using a parser to iteratively read each element in the entire structure definition file; Extract attribute information from each element; organize the extracted attribute information into data resource blocks according to their hierarchical relationship; Data models are constructed based on data resource blocks, and these data models are integrated into a model set. Constructing data models based on data resource blocks includes mapping attribute information in data resource blocks to data model specifications in the data center to build the data model. Building data services based on model sets includes the following steps: building a database table creation script based on the model set; Execute the script to create the database table and create the corresponding database table in the database; Build a data service API based on database tables; Integrate data services and provide complete FHIR standard services externally based on the integrated data services, including: integrating data service APIs and publishing them externally. Provides complete FHIR standard services.
2. An FHIR service building apparatus, characterized in that, This includes a full build module, a resource block build module, a model build module, a service build module, and a service provision module; The full-scale construction module is used to build a full set of structural definition files based on the FHIR standard according to the on-site business requirements. The full-scale construction module includes an original file acquisition component, an extended file acquisition component, and a merging and comparison component. The original file acquisition component is used to acquire the original structural definition file based on the FHIR standard. The extended file acquisition component is used to design the extended structural definition file according to the on-site business requirements. The merging and comparison component is used to compare and merge the extended structural definition file with the original structural definition file to obtain the full set of structural definition files. The resource block building module is used to parse the entire structure definition file in a loop and build data resource blocks; The resource block building module includes an element reading component, an attribute extraction component, and an attribute processing component; the element reading component is used to use a parser to read every element in the entire structure definition file in a loop; The attribute extraction component is used to extract attribute information from each element; the attribute processing component is used to organize the extracted attribute information into data resource blocks according to their hierarchical relationship. The model building module is used to build data models based on data resource blocks and integrate the data models into a model set; the model building module is also used to map the attribute information in the data resource blocks to the data model specification of the data center to build the data model. The service building module is used to build data services based on model sets; the service building module includes a script creation component, a script execution component, and an API building component. The script creation component is used to build a script for creating database tables based on the model set; The script execution component is used to execute the script that creates tables in the database, and then create the corresponding database tables; the API building component is used to build data service APIs based on the database tables. The service provider module is used to integrate data services and provide complete FHIR standard services to the outside world based on the integrated data services. This includes integrating the data service API and publishing it to the outside world, providing complete FHIR standard services.
3. An electronic device, comprising: At least one processor and a memory; wherein the memory stores computer-executable instructions; characterized in that the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to perform the FHIR service construction method as described in claim 1.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor, it controls the device containing the storage medium to execute the FHIR service construction method as described in claim 1.
Citation Information
Patent Citations
Method and system for sharing and opening health medical data based on FHIR
CN113380351A
Medical data analysis method and equipment
CN119484669A