A Method and System for Generating Patient Medical Journey Profiles Based on Multi-Source Question-Answer Data
By employing composite patient identification, structured query language aggregation, character budget control, and multi-level anonymization, the problems of unstable patient data aggregation, inaccurate calculation of operational indicators, information leakage, and invisible status in medical intelligent question-and-answer scenarios have been solved, achieving stable generation of patient medical journey profiles and information security.
Patent Information
- Application Number
- CN202611250302.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-08-18
AI Technical Summary
In the context of medical intelligent question answering and service operation, existing technologies suffer from several problems, including the inability to stably aggregate data due to the single patient identifier, the reliance on large language models for operational indicators leading to illusions, excessively long historical conversations causing input overflow, weak protection of personally identifiable information, and the invisibility of status during cold starts and failure paths.
A patient journey profiling generation method based on multi-source question-and-answer data is adopted. Through composite patient identification, structured query language aggregation, character budget control, multi-level desensitization processing, and joint unique constraints, it achieves stable aggregation of patient data, accurate calculation of operational indicators, protection against information leakage, and visibility of the entire journey status.
It enables full aggregation of patients across multiple entry points and identities, improves the accuracy of operational metrics, controls character input in historical sessions, reduces the risk of information leakage, and ensures the visibility of the system's status across all paths.
Smart Images

Figure CN122800089B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information processing technology, specifically to a method and system for generating patient medical journey profiles based on multi-source question-and-answer data. Background Technology
[0002] In the context of intelligent medical Q&A and service operation, medical institutions typically provide consultation services to patients through multiple online service portals, such as online consultation windows, outpatient guidance systems, specialist Q&A platforms, and third-party customer service access. The same patient may generate multiple rounds of Q&A data at different times and through different portals. To support service quality assessment, gap work order assignment, and personalized guidance on the operational side, the aforementioned scattered multi-round Q&A data needs to be consolidated into a structured profile centered on the patient. This profile should depict the patient's current stage of medical treatment, primary needs, unresolved issues, potential disease clues, and emotional baseline.
[0003] However, existing technologies have the following shortcomings in this scenario: First, patient identification is singular, and data from multiple entry points cannot be stably aggregated. Existing solutions typically aggregate records using only a single identifier. However, in scenarios where multiple online service entry points and third-party platform access coexist in a hospital, different entry points use different identifier systems. Some entry points only provide the primary identifier, while others only provide the third-party platform identifier. A single identifier cannot cover all patients, leading to the same patient being incorrectly split into multiple independent profiles. Real-world testing shows that when aggregating only using the primary identifier, some patients are incorrectly split. Second, operational metrics rely on large language models for calculation, leading to illusions in numerical fields. Existing solutions entrust operational metrics such as total number of records, total number of sessions, first and last question-and-answer time, and high-priority gaps to large language models for calculation. Large language models exhibit uncontrollable illusions in numerical fields, resulting in compromised profile credibility. Third, high-frequency patients have excessively long historical conversations, causing uncontrolled prompt word budgeting. Existing solutions directly concatenate all historical questions and answers into prompt words before feeding them into the large language model. The character count of questions and answers from high-frequency patients can easily exceed the model's input budget, leading to truncation, errors, or uncontrolled processing costs. Real-world testing shows that without character budget control, some high-frequency patient prompts frequently exceed 12,000 characters, far exceeding the model's input budget. Fourth, the protection of personally identifiable information is weak, posing a high risk of privacy leaks. Existing solutions only require the model not to output private information in the prompts for large language models, lacking post-processing and fallback checks before writing. When the model occasionally violates these constraints, personally identifiable information can directly fall into the database, posing a risk of leakage. Fifth, the status is invisible during cold starts and failed paths. When a patient's profile has not yet been generated or profile generation has failed, the front end cannot distinguish whether the patient has been analyzed but has no data, or has not yet been analyzed, resulting in the operational status being invisible.
[0004] In view of this, the present invention is proposed. Summary of the Invention
[0005] The present invention aims to solve at least one of the above technical problems, and provides a method and system for generating patient medical journey profiles based on multi-source question-and-answer data.
[0006] To achieve the above objectives, the first technical solution adopted by the present invention is as follows: Methods for generating patient medical journey profiles based on multi-source question-answering data include: Composite patient identifiers are extracted from multiple candidate identifier fields of multi-source question and answer records according to a preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type. Based on the composite patient identifier, structured query language aggregation is performed on the full historical question and answer records to obtain operational indicators; the operational indicators are independent of the semantic processing of the downstream large language model. Extract the most recent preset number of records from the full historical question and answer records in reverse chronological order. Truncate the question and answer content of each record according to the maximum character limit and concatenate them into text to be processed. Compare the number of characters in the text to be processed with the preset character budget. If it exceeds the preset character budget, remove them one by one from the end to obtain the text to be processed that meets the preset character budget. The text to be processed that meets the preset character budget is input into the large language model to generate structured profile text. The structured profile text is then subjected to multi-level desensitization processing to obtain the desensitized structured profile text. The operational metrics are merged with the anonymized structured profile text to form a patient's medical journey profile; when the number of historical question and answer records is zero, or lower than the minimum threshold for the number of historical question and answer records, or when the large language model call fails, the preset placeholder result is used as the patient's medical journey profile. Based on the joint unique constraint of the identifier value and the identifier type, the patient's medical journey profile is atomically written into the database in one go.
[0007] Preferably, the extraction according to a preset priority includes: when the main identifier field is not empty, using the value of the main identifier field and the corresponding identifier type; otherwise, when the third-party platform identifier field is not empty, using the value of the third-party platform identifier field and the corresponding identifier type; when both are empty, discarding the question and answer record.
[0008] Preferably, the filtering conditions of the structured query language aggregation distinguish between two channels: a first channel that matches the primary identifier with equal value, and a second channel that matches the third-party platform identifier with an empty or empty primary identifier, in order to avoid double counting of operational metrics; the time field prioritizes the business time, and if there is no business time, it reverts to the record creation time.
[0009] Preferably, the operational metrics include at least the total number of records, the total number of sessions, the number of high-quality gaps, the optimization count, and the time between the first and last question and answer sessions.
[0010] Preferably, the preset quantity is 30, the maximum number of characters is 80, and the preset character limit is 9000 characters.
[0011] Preferably, the multi-level desensitization process includes: applying a first-level constraint to personally identifiable information at the system prompt word level; applying a second-level identification and replacement to the personally identifiable information after model output; and applying a third-level identification and replacement to all text fields before writing to the database; the personally identifiable information includes at least mobile phone number, email address, ID card number, detailed address, patient's self-proclaimed name, and name plus medical role.
[0012] Preferably, after extracting the composite patient identifier and before performing the structured query language aggregation, the method further includes: deduplicating and aggregating all question and answer records according to the identifier value and the identifier type to obtain a candidate patient set, and filtering them according to the time window, the minimum number of records, and the maximum number of candidates to support full backfilling and incremental refresh.
[0013] Preferably, the structured profile text includes at least an enumeration of the medical treatment stage, confidence level, main demands, unresolved issues, disease clues, an enumeration of the emotional baseline, and a long text summary; the disease clues follow a conservative output strategy: they are only output when at least two historical question-and-answer records consistently point to the same disease, location, or treatment method, and specific diagnostic terms are disabled, while business-oriented generalized expressions are used.
[0014] Preferably, in the preset occupancy results, the medical treatment stage enumeration is in a state of insufficient information.
[0015] The second technical solution adopted in this invention is: A patient journey profile generation system based on multi-source question-and-answer data includes: The extraction module is used to extract composite patient identifiers from multiple candidate identifier fields of multi-source question and answer records according to a preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type. The aggregation module is used to perform structured query language aggregation on the full set of historical question and answer records based on the composite patient identifier to obtain operational indicators; the operational indicators are independent of the semantic processing of the downstream large language model. The splicing and comparison module is used to extract the most recent preset number of records from the full historical question and answer records in reverse chronological order, truncate the question and answer content of each record according to the upper limit of characters and splice them into text to be processed, compare the number of characters of the text to be processed with the preset character budget, and if it exceeds the preset character budget, it will be removed one by one from the end to obtain the text to be processed that meets the preset character budget. The desensitization module is used to input the text to be processed that meets the preset character budget into the large language model to generate structured profile text, and to perform multi-level desensitization processing on the structured profile text to obtain the desensitized structured profile text. The merging module is used to merge the operational metrics with the anonymized structured profile text to form a patient's medical journey profile; when the number of historical question and answer records is zero, or lower than the minimum threshold for the number of historical question and answer records, or when the large language model call fails, the preset placeholder result is used as the patient's medical journey profile. The writing module is used to atomically write the patient's medical journey profile into the database in one go, based on the joint unique constraint of the identifier value and the identifier type.
[0016] Compared with the prior art, the present invention has the following beneficial effects: This invention uses a composite patient identifier that includes a main identifier field and a third-party platform identifier field, and extracts the identifier value and identifier type based on a preset priority. This enables the full aggregation of patients in multi-entry and multi-identity scenarios, fundamentally solving the problem of patient splitting caused by incomplete coverage of a single identifier.
[0017] This invention enables the full aggregation of operational metrics to be processed independently by a structured query language and completely separates it from the semantic processing of the downstream large language model. This eliminates the dependence of the calculation of operational metrics on the output of the large language model, avoids the illusion of the large language model on numerical fields, and significantly improves the accuracy of operational metrics.
[0018] This invention extracts the most recent preset number of records in reverse chronological order, truncates each question and answer content according to the maximum character limit and concatenates them into text to be processed, then compares the total number of characters with the preset character budget and removes the excess part one by one from the end, thus controlling the input of prompt words for any patient within a fixed character budget and avoiding input overflow caused by excessively long historical conversations of high-frequency patients.
[0019] This invention constructs a multi-level desensitization processing chain by performing a first layer of constraints at the system prompt word level, a second layer of identification and replacement after model output, and a third layer of identification and replacement before writing to the database. Even if the upstream model violates the prompt word constraints, a fallback check can be completed before writing, significantly reducing the leakage rate of personally identifiable information.
[0020] When the number of historical question and answer records is zero, below the minimum threshold of the number of historical question and answer records, or when the large language model call fails, the present invention uses the preset placeholder result as a patient's medical journey profile and writes it into the database. Under the premise that the composite patient identifier is valid, the database contains the patient's status record. The front end does not need to distinguish between analyzed and unanalyzed states, thus realizing full-path status visibility. Attached Figure Description
[0021] Figure 1 A flowchart illustrating a method for generating patient profiles based on multi-source question-and-answer data; Figure 2 A schematic diagram of the structure of a patient medical journey profile generation system 200 based on multi-source question-and-answer data; Figure 3 A schematic block diagram of an example electronic device 300 for implementing an embodiment of the present invention. Detailed Implementation
[0022] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Figure 1 This is a flowchart illustrating a method for generating patient profiles based on multi-source question-and-answer data. (Refer to...) Figure 1 The first embodiment of the present invention provides a method for generating a patient medical journey profile based on multi-source question-and-answer data, including the following steps.
[0024] S101, extract composite patient identifiers from multiple candidate identifier fields of multi-source question and answer records according to preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type.
[0025] In multi-source heterogeneous question-and-answer data scenarios, different online service entry points use different identifier systems. A single identifier key cannot cover all patients, resulting in the same patient being incorrectly split into multiple independent profiles. This step aims to extract composite patient identifiers from multiple candidate identifier fields by setting preset priorities, achieving stable aggregation of patient dimensions and providing a unified primary key basis for subsequent full data collection.
[0026] Candidate identifier fields refer to data fields in the question-and-answer records that can be used to identify the patient's identity. In this embodiment, the plurality of candidate identifier fields include at least a primary identifier field (such as an internal user identifier) and a third-party platform identifier field (such as an external platform unified identifier).
[0027] A composite patient identifier is a binary structure consisting of an identifier value and an identifier type. The identifier value is used to uniquely identify the patient, and the identifier type is used to distinguish the source system of the identifier value. Together, they form a composite primary key component for subsequent database operations.
[0028] Preset priority refers to the extraction priority rules pre-configured by the system when multiple candidate identifier fields exist simultaneously or are partially missing.
[0029] It should be noted that the patient identification information and medical Q&A data processed in this invention all originate from data collected with the patient's formal authorization. Specifically, the aforementioned data originates from Q&A records legally and compliantly collected and stored by the hospital's information system after the patient's informed consent and authorization during the provision of online intelligent Q&A services by medical institutions. This invention only performs subsequent aggregation, analysis, and profile generation processing on the aforementioned legally obtained data and does not involve any illegal acquisition of personal information.
[0030] Those skilled in the art will recognize that mature solutions for unified patient identification already exist in the field of healthcare informatics. For example, the EMPI (Employment Master Index) technology associates patient records from multiple systems with unique identifiers through multi-attribute matching (such as name, ID number, mobile phone number, gender, date of birth, etc.); similarly, in the internet domain, a unified user identifier mapping table maps device IDs, accounts, and third-party platform identifiers to globally unique identifiers, enabling cross-platform user identification. These methods are all conventional in the field, and their core idea is to unify multiple identifiers into a single identifier through mapping or matching.
[0031] Unlike conventional methods, this invention does not map multiple identifiers to a single identifier and discard the original identifier information. Instead, it retains the identifier type as a component of the composite patient identifier and uses the identifier value and identifier type as the joint operation primary key. Its core objective is that when identifiers from different source systems cannot be forcibly normalized, by retaining the original identifier type, it achieves full data coverage and provides the necessary joint unique constraint basis for subsequent atomic database writes.
[0032] Furthermore, this invention employs a preset priority extraction strategy, with the following priority rules: when the main identifier field is not empty, the value of the main identifier field and its corresponding identifier type are used; otherwise, when the third-party platform identifier field is not empty, the value of the third-party platform identifier field and its corresponding identifier type are used; when both are empty, the question-and-answer record is discarded. This priority rule is designed for question-and-answer data scenarios, avoiding the performance overhead and mismatch risk caused by complex matching.
[0033] In one specific implementation, when reading records from the question-and-answer record table, the system first checks if the primary identifier field exists and is not empty. If it exists, the value of this field is used as the identifier value, and the identifier type is marked as the primary identifier type. If the primary identifier field is empty, the system further checks if the third-party platform identifier field (such as the external platform identifier stored in the extended data field) exists and is not empty. If it exists, the value of this field is used as the identifier value, and the identifier type is marked as the third-party platform identifier type. If both fields are empty, the record will not participate in subsequent profile generation.
[0034] As an example of a question-and-answer record source table structure, the question-and-answer record table may include the following fields: unique question-and-answer identifier, primary identifier, extended data fields (storing third-party platform identifier, business time, question-and-answer content, etc. in structured data format), session identifier, question-and-answer content, category tag, gap marker, gap subtype, sentiment tone, optimization requirement marker, priority, etc. Among them, the primary identifier is used for internal user identification; the extended data fields are used to store the third-party platform identifier and business time to support composite identifier extraction and time field priority judgment; the gap marker is used to indicate whether the question-and-answer did not resolve the patient's problem; the optimization requirement marker is used to indicate whether the AI response to the question-and-answer requires manual optimization; and the priority is used to indicate the urgency of the question-and-answer.
[0035] In one specific implementation, the multi-source question-and-answer records can originate from multiple business tables, such as online consultation record tables, outpatient AI record tables, head and neck surgery record tables, and radiotherapy record tables. Statistical analysis shows that in a set of test data, the record distribution across different source tables is as follows: online consultation record tables account for approximately 70.5%, outpatient AI record tables account for approximately 25.3%, head and neck surgery record tables account for approximately 2.3%, and radiotherapy record tables account for approximately 1.8%.
[0036] The table structure described above is merely a preferred implementation of this embodiment. Those skilled in the art can add, delete, or adjust fields according to actual business needs. For example, the name of the third-party platform identifier field in the extended data field can be adjusted according to the actual access platform; this invention does not limit this.
[0037] After extracting the composite patient identifiers and before subsequent aggregation, as an optional and conventional data processing method, those skilled in the art can further deduplicate and aggregate all question-and-answer records according to the identifier value and the identifier type to obtain a candidate patient set. This set can then be filtered based on a time window (e.g., the most recent few days), a minimum number of records (e.g., at least a few records), and a maximum number of candidates (e.g., an upper limit of a few people) to support both full data backfilling and incremental refresh operation modes. This filtering operation is a conventional method in the field of data processing, and this invention does not limit it.
[0038] S102, based on the composite patient identifier, perform structured query language aggregation on the full set of historical question and answer records to obtain operational indicators; the operational indicators are independent of the semantic processing of the downstream large language model.
[0039] In scenarios with multi-source heterogeneous question-and-answer data, the same patient may generate question-and-answer records through different identifier channels. Simple aggregation can easily lead to the same record being counted repeatedly. Furthermore, existing technologies rely on large language models to calculate operational metrics, resulting in the illusion of numerical fields. This step aims to independently aggregate all historical question-and-answer records using a structured query language, avoiding double counting and completely decoupling operational metric calculations from the large language model, thereby eliminating the illusion of numerical fields and providing preliminary data support for subsequent anomaly path identification.
[0040] Operational metrics refer to numerical indicators obtained from all historical question-and-answer records and used to characterize patients' question-and-answer behavior. These include, but are not limited to, total number of records, total number of sessions, number of high-optimization gaps, optimization count, and time between the first and last question-and-answer sessions.
[0041] Mutually independent means that the calculation process of operational indicators does not depend on any output of the large language model, and its data source, calculation logic and output results are physically isolated from the downstream large language model processing.
[0042] Those skilled in the art will recognize that in the fields of data analysis and profiling, there are generally two conventional methods for calculating metrics: one is for a large language model to directly output statistical figures while generating text summaries; this method is simple but carries the risk of model illusion. The other is to define the metric's scope through a semantic layer, and then have the query engine convert it into a database query based on natural language intent; this method focuses on the semantic understanding of the query interface and does not physically separate metric calculation from model processing. Furthermore, simple database statistical aggregations (such as COUNT and SUM) are also common techniques in this field.
[0043] This invention adopts a completely different technical approach. Instead of improving the model itself, it completely separates the calculation of numerical indicators from the model and processes them independently by the structured query language. The large language model is only responsible for generating semantic summaries.
[0044] Because of the adoption of full aggregation using structured query language, the system can know the number of historical question and answer records (total number of records) before calling the large language model. Thus, when the number is zero or lower than the minimum threshold, the system can directly trigger the short-circuit placeholder of the subsequent step S105 without initiating a call to the large language model.
[0045] As a preferred implementation, to prevent the same record from being counted repeatedly under different identifier channels, the filtering conditions can distinguish between two channels: the first channel is based on the primary identifier's equivalence; the second channel is based on the third-party platform's identifier equivalence, with the primary identifier being empty or an empty string. This dual-channel filtering design is a conventional anti-duplicate measure used in conjunction with composite identifier structures, and those skilled in the art can also employ other deduplication strategies.
[0046] As a preferred implementation, the time field prioritizes the business time (such as the actual time of the question and answer, which is usually stored in the extended data field) for aggregation and statistics, and reverts to the record creation time when there is no business time. This time priority handling is a common optimization technique for database queries.
[0047] In one preferred embodiment, the operational metrics may include total number of records, total number of sessions, number of high-optimization gaps, optimization count, and first and last question-and-answer time, etc. Those skilled in the art can add or remove metric items according to actual business needs, and this invention does not limit this.
[0048] As a specific implementation, for a given composite patient identifier, the system executes a structured query language aggregation query to calculate the total number of records, the total number of deduplicated sessions, the number of gap records marked as high priority or urgent, the number of records requiring AI optimization, and the earliest and latest question-and-answer times. Specifically, the number of sessions is obtained by deduplicating session identifiers; the number of high priority gaps is obtained through conditional filtering (gap marked as true and priority as high or urgent); and the optimization count is obtained through conditional filtering (requiring optimization is marked as true). The time field is preferentially extracted from the extended data fields; if this field is empty or invalid, the record creation time is used as a fallback.
[0049] S103, extract the most recent preset number of records from the full historical question and answer records in reverse chronological order, truncate the question and answer content of each record according to the upper limit of characters and concatenate them into text to be processed, compare the number of characters in the text to be processed with the preset character budget, if it exceeds the preset character budget, remove them one by one from the end to obtain the text to be processed that meets the preset character budget.
[0050] The question-and-answer history of high-frequency patients may contain a large number of records. If the entire history is directly input into the prompt words of a large language model, it is very easy to exceed the model's input budget, leading to truncation, errors, or uncontrolled processing costs. This step aims to control the prompt word input of any patient within a fixed character budget through sliding window truncation and adaptive pruning based on the character budget, while prioritizing the preservation of the information value of the most recent records.
[0051] Sliding window truncation refers to the process of selecting a fixed window range of records from the full historical record in chronological order and discarding records outside the window.
[0052] Character budget refers to the pre-defined upper limit on the number of characters in the input text of a large language model, used to control processing costs and avoid input overflow.
[0053] Tail-by-tail removal refers to removing entries one by one from the oldest record in the text to be processed, starting with the question and answer content corresponding to the oldest record, when the total number of characters after concatenation exceeds the preset character budget, until the budget requirement is met.
[0054] Those skilled in the art will recognize that controlling input length is a standard engineering requirement in large language model applications. Common methods include: the server retaining a fixed number of recent characters and discarding earlier content; using a sliding window mechanism to retain only recent context; or directly truncating the text to a fixed length. These methods are all standard techniques in the field and can control input length to some extent.
[0055] Unlike conventional methods, this invention employs a three-step collaborative budget control mechanism: First, extract the most recent preset number of records in reverse chronological order. This step prioritizes retaining the latest records because, in medical Q&A scenarios, recent records typically contain the patient's most pressing concerns and current condition. Second, truncate the Q&A content of each record according to a character limit. This step controls the maximum length of a single record, preventing excessively long Q&As (such as those containing lengthy descriptions of illness) from consuming too much budget. Third, compare the total number of characters after concatenation with the preset character budget; if it exceeds the limit, records are discarded one by one from the end. Here, the end corresponds to the oldest record in reverse chronological order; that is, when the budget is insufficient, the oldest information is discarded rather than the newest.
[0056] Because the structured query language has independently processed the entire historical data and output operational metrics, the large language model does not need to process the entire dataset repeatedly. It only needs to perform semantic summarization on a preset number of recent records, making sliding window truncation and character budget adaptive pruning necessary and feasible technical steps. Without the independent aggregation in step S102, the large language model would still need to process the entire historical data to obtain operational metrics, and sliding window truncation would lose its technical basis.
[0057] In one preferred implementation, the preset number of records can be 30, the maximum number of characters can be 80, and the preset character budget can be 9000 characters. The system first selects the 30 most recent records from the entire historical Q&A record in reverse chronological order; truncates the Q&A content of each record to the first 80 characters; concatenates the 30 truncated Q&A records in reverse chronological order to form the text to be processed; calculates the total number of characters in the text to be processed; if the total number of characters exceeds 9000 characters, then starting from the Q&A content corresponding to the oldest record in the text to be processed, each record is removed one by one, and the total number of characters is recalculated until it does not exceed 9000 characters.
[0058] Experiments have shown that, without character budget control, the maximum input of prompt words by some high-frequency patients can reach approximately 102,471 characters, far exceeding the model's input budget. After adopting the sliding window truncation and character budget adaptive pruning of this invention, none of the 596 portrait generation tasks exceeded the 9,000-character budget, with a maximum input of approximately 6,342 characters and an average input of approximately 1,682 characters.
[0059] Of course, the present invention is not limited thereto. Those skilled in the art can flexibly adjust the specific values of the preset quantity, character limit and preset character budget according to the average length of question and answer records, model input budget and cost constraints in actual business scenarios.
[0060] S104, input the text to be processed that meets the preset character budget into the large language model to generate structured profile text, and perform multi-level desensitization processing on the structured profile text to obtain the desensitized structured profile text.
[0061] Medical Q&A data contains a large amount of personally identifiable information, such as patient names, contact information, ID numbers, and detailed addresses. Current technologies only require the model not to output private information during the initial prompts in the large language model, lacking post-processing and pre-writing fallback checks, leading to privacy risks. This step aims to systematically eliminate the risk of personally identifiable information leakage by constructing a complete protection chain from input constraints to output filtering and pre-writing fallback through multi-level anonymization processing.
[0062] Personally identifiable information refers to information that can identify a specific natural person, either alone or in combination with other information. In the medical question-and-answer scenario of this invention, it includes at least: mobile phone number, email address, ID card number, detailed address, patient's self-proclaimed name, and a person's name plus a medical role.
[0063] Multi-level desensitization refers to the technical means of performing desensitization operations at different stages of data processing to form a layered protection.
[0064] Those skilled in the art will recognize that data anonymization is widely used in the field of information security. Common methods include: adding constraint instructions to system prompts requiring the model not to output sensitive information; using general regular expressions or named entity recognition models to identify and replace names, phone numbers, ID numbers, etc., in the output text; or setting field-level encryption at the database level. The aforementioned single-layer or double-layer protection methods are all conventional technologies in this field.
[0065] Before inputting the text to be processed into the large language model, pre-anonymization processing can be performed on the original question-and-answer content. This pre-anonymization processing is performed during or before constructing the text to be processed, identifying and replacing personally identifiable information in the original question-and-answer records, and then concatenating the pre-anonymized question-and-answer content into the text to be processed. This pre-anonymization processing, as an input-side privacy protection measure, together with subsequent system prompts at the word level, post-model output identification and replacement, and pre-database identification and replacement, constitutes a complete privacy protection chain.
[0066] As one specific implementation, the pre-desensitization processing can perform recognition and replacement on the question text and answer text in the original question-and-answer record respectively. The recognition rules can be consistent with the recognition rules of the second layer, or a more lightweight general rule can be adopted. For example, personal identifiable information such as mobile phone number, ID card number, and detailed house number in the original question-and-answer content can be masked to prevent the above information from entering the input side of the large language model in plaintext form.
[0067] Unlike conventional methods, the preferred embodiment of this invention employs a three-layer engineering link-level anonymization approach, rather than a single strategy or rule layer. Specifically: The first layer, the system prompt word layer, constrains personally identifiable information. Before inputting the text to be processed into the large language model, privacy protection rules are explicitly embedded in the system prompt words, requiring the model to prohibit the output of specific personal names, doctor names, patient self-identification, phone numbers, email addresses, ID numbers, detailed address information, and specific pathology result values, and providing generalized expression examples.
[0068] As one specific implementation, the constraints of the system's prompt word layer can be implemented using the following exemplary prompt words: You are a patient journey analysis expert at the hospital. Based on the patient's multi-turn historical Q&A (arranged in reverse chronological order, truncated to the most recent preset number of entries), a structured profile is generated. Task decomposition: Determine the medical treatment stage; summarize the main needs; identify unresolved issues; infer disease clues; assess the emotional baseline; generate a long-form summary of the timeline.
[0069] Strict privacy protection rules: Prohibit the output of specific personal names, doctor names, and patient self-designations; prohibit the output of specific phone numbers, email addresses, ID numbers, and detailed house numbers; prohibit the output of specific pathology result values, and instead use the description "abnormal related indicators"; in long text summaries, personal names should be generalized to "doctor" or "director", and locations should be generalized to "this hospital" or "other hospital".
[0070] The above prompts are merely examples. Those skilled in the art can adjust the specific wording and generalized examples of privacy constraints according to actual business scenarios, and this invention does not limit them.
[0071] The second layer involves identifying and replacing personally identifiable information after the model outputs. After the large language model returns structured profile text, it immediately performs proactive identification and replacement on all text fields. This layer targets specific language patterns in medical question-and-answer scenarios, identifying and replacing at least the following six types of personally identifiable information: Chinese mobile phone number (retaining the first and last few digits for auditing, with a middle mask), email address (retaining the first few characters of the username and the domain name), ID card number (retaining the first and last few digits), detailed address number (including building, unit, room, and number), patient's self-designation (such as "My name is XX," "I am XX," "I am XX," "I am XX," etc. followed by the name), and a name plus a medical role (such as "Doctor X," "Director X," "Professor X," etc., with a stop word whitelist added to avoid false positives for functional expressions).
[0072] As one specific implementation, the stop word whitelist may include the following functional words: "please ask," "hello," "thank you," "trouble," "consult," "want to ask," "can," etc. When a combination of a person's name and a medical role is detected, the system first determines whether the prefix of the person's name is in the aforementioned whitelist; if it is in the whitelist, the system determines that the combination is a functional expression rather than a real person's name, and retains the original text without replacement. For example, "please ask" in "please ask the doctor" is in the whitelist, so this expression will not be misidentified as a patient's name or a doctor's name.
[0073] The third layer involves identifying and replacing all text fields before writing them to the database. Before writing the profile data to the database, all text fields that have undergone the second layer of data anonymization are identified and replaced again, serving as a final fallback for the first two layers. This layer ensures that even if the first-layer constraints fail or the second-layer rules are omitted, final verification can still be completed before the data is written to the database.
[0074] It's important to note that the third layer of identification and replacement differs from the second layer in the following ways: The second layer of anonymization is executed immediately after the large language model outputs, targeting the original structured profile text returned by the model; the third layer of anonymization, however, is executed just before the profile data is written to the database, targeting all text fields after the second layer of anonymization, including long-form summaries, main requests, unresolved issues, and disease clues. The third layer serves as a final safety net for the first two layers, ensuring that final verification is completed before data is written to the database, even if the first layer's system prompt constraints become ineffective due to model version upgrades or prompt adjustments, or if the second layer's anonymization rules are omitted due to new scenarios. Therefore, the third layer is not a simple repetition of the second layer's results, but rather an independent verification step set up at different processing stages and for different risk scenarios.
[0075] The three layers of desensitization processing mentioned above each return a hit report independently. The hit report refers to the identification hit record returned independently after each layer of desensitization processing, which is used for auditing and traceability. The second and third layers do not throw errors during the processing, but only report them in the form of log alarms to ensure the continuity of the processing flow.
[0076] As a preferred conventional setting, the identification and replacement of the second and third layers can target the following categories of personally identifiable information: mobile phone number, email address, ID card number, detailed house number, patient's self-proclaimed name, and name plus medical role. The above six types of information are preferred rules extracted based on the language features of medical question-and-answer scenarios. Those skilled in the art can also use other general or scenario-specific identification rules, and this invention does not limit them.
[0077] For example, taking a mobile phone number as an example, the system identifies an 11-digit sequence and replaces it with the "telephone" tag. Simultaneously, it records the first three and last four digits of the number in the hit record for auditing purposes. For the identification of names with medical roles, the system first matches a combination of one or two Chinese character prefixes with a medical role suffix, then determines whether the prefix is in the stop word whitelist. If it is not in the whitelist, the prefix is replaced with "name," while the role suffix is retained. The above specific replacement rules are merely preferred examples of this embodiment; those skilled in the art can use other equivalent desensitization rules.
[0078] S105, merge the operational metrics with the desensitized structured profile text to form a patient medical journey profile; when the number of historical question and answer records is zero, or lower than the minimum threshold of the number of historical question and answer records, or the large language model call fails, use the preset placeholder result as the patient medical journey profile.
[0079] Throughout the entire lifecycle of patient profile generation, several abnormal paths exist: the patient has never generated any question-and-answer records, the number of question-and-answer records is insufficient to support semantic analysis, or the large language model call fails. Existing technologies typically return error codes or null values in these paths, making it impossible for the front end to distinguish between "analyzed but no data" and "not yet analyzed." This step aims to ensure that the patient's status record always exists in the database through a unified placeholder mechanism, achieving full-path status visibility.
[0080] A patient's medical journey profile refers to a structured data object that includes operational metrics and semantic summaries, used to depict a patient's medical journey stages, main needs, unresolved issues, disease clues, emotional baseline, and long-form summary.
[0081] Placeholder results refer to the preset default profile generated under abnormal paths. Its structure is consistent with the normal profile, but the content indicates insufficient information.
[0082] The minimum threshold refers to the lower limit of the number of historical question-and-answer records required to trigger semantic analysis of a large language model.
[0083] Those skilled in the art will recognize that handling abnormal paths in software systems is a common programming requirement. Common methods include: using exception handling statements to catch exceptions and return error codes; setting default values or null values to fill exception results; or using loading status or blank placeholders in the front-end interface to indicate that loading is incomplete. All of the above exception handling mechanisms are conventional techniques in this field.
[0084] Unlike conventional methods, this invention uses pre-defined placeholder results directly as a form of the patient's medical journey profile, rather than as an independent error state or null value. This means that regardless of whether the path is normal or abnormal, the system's output is always a structurally consistent patient medical journey profile, only the content differs.
[0085] Specifically, the key points include: First, a pre-judgment mechanism. Because the full aggregation of the structured query language in step S102 already knows the number of historical question-and-answer records before calling the large language model, the system can directly determine whether to enter an abnormal path without initiating a call to the large language model. This pre-judgment is fundamentally different from conventional post-event anomaly capture and can significantly reduce system overhead. Second, unified handling of three abnormal paths. When the number of historical question-and-answer records is zero, or below the minimum threshold for the number of historical question-and-answer records, or when the large language model call fails, the system uses a preset placeholder result as the patient's medical journey profile. In this placeholder result, the medical stage enumeration is in the state of insufficient information, and other fields are empty or default values, thus ensuring that the patient's status record exists in the database when the composite patient identifier is valid, and the front end does not need to distinguish between multiple abnormal states. Third, mutual exclusion between normal and abnormal paths. Under the normal path, the system merges the operational indicators obtained in step S102 with the desensitized structured profile text obtained in step S104 to form the patient's medical journey profile; under the abnormal path, the system directly uses the placeholder result. Both processes execute mutually exclusively through conditional checks to ensure data consistency.
[0086] In a preferred embodiment, the structured profile text may include fields such as medical treatment stage enumeration, confidence level, main requests, unresolved issues, disease clues, emotional baseline enumeration, and long text summary. The above fields are merely preferred examples of profile output; those skilled in the art can add or remove fields according to business needs, and this invention does not limit this.
[0087] As a preferred implementation, the disease clues may follow a conservative output strategy: output is only performed when at least two historical question-and-answer records consistently point to the same disease, location, or treatment method, and specific diagnostic terms are disabled, using business-oriented generalized expressions (such as "proton therapy consultation," "related to a certain location," "concern about a certain side effect"). This strategy is a preferred compliant approach in medical scenarios and is not essential to achieving the technical objectives of this invention.
[0088] In a preferred embodiment, the medical treatment stage enumeration in the occupancy result can be in an information-insufficient state. This state value is only a preferred example of abnormal occupancy, and those skilled in the art can also use other equivalent default values or state codes, which are not limited in this invention.
[0089] In one specific implementation, when merging normal profiles, the system merges operational metrics and anonymized structured profile text into a unified data object based on field mapping relationships. Under abnormal paths, the system generates placeholder results, where the medical treatment stage enumeration field is assigned "Insufficient Information," the confidence level is assigned 0, the text array field is assigned an empty array, and the long text summary is assigned an empty string.
[0090] S106, based on the joint unique constraint of the identifier value and the identifier type, the patient's medical journey profile is atomically written into the database in one go.
[0091] In scenarios with multi-source heterogeneous question-answering data, profile generation tasks may be triggered concurrently by multiple threads or distributed nodes. Simple query-then-write operations are prone to race conditions in concurrent environments, leading to unique constraint conflicts or data overwriting. This step aims to ensure safe concurrent writes through atomic operations at the database layer.
[0092] A combined unique constraint is a unique constraint established in a database table based on a combination of two or more fields, used to ensure that the values of the combined fields are unique in the table.
[0093] Atomic writes refer to database operations that are indivisible; they either all succeed or none succeed, preventing data inconsistencies caused by partial execution.
[0094] Those skilled in the art will recognize that there are various conventional methods in the database field to ensure safe concurrent writes. For example, transactional locks (pessimistic locks) are used to lock the target record before writing; distributed locks (such as locks based on caches or coordination services) are used to control concurrent access; or optimistic locks (version number mechanisms) are used to verify the version during updates. In addition, checking whether the target record exists before deciding whether to perform an insert or update is also a common and conventional logic, but it carries the risk of race conditions in a concurrent environment.
[0095] Unlike conventional methods, this invention employs atomic insertion or update operations based on joint unique constraints. Since step S101 uses a composite patient identifier containing both an identifier value and an identifier type, the database profile table uses both the identifier value and identifier type as the joint unique key. When concurrent writes occur, the database engine automatically detects conflicts through the joint unique constraint and completes the insertion or update in a single atomic operation, eliminating the need for the application layer to perform a lookup-before-write logic, thus completely avoiding concurrent conflicts.
[0096] It is precisely because of the adoption of a composite identifier structure that the need for joint unique constraints arises; conversely, joint unique constraints ensure the uniqueness and consistency of composite identifiers at the database level.
[0097] As a preferred implementation, in multi-medical institution deployment scenarios, the joint unique constraint can further include the medical institution identifier. In this case, the database profile table uses the medical institution identifier, identifier value, and identifier type as the joint unique key. When concurrent writes occur, the database engine automatically detects conflicts through this triple joint unique constraint and completes the insertion or update in a single atomic operation, thereby achieving data isolation and concurrency security between different medical institutions.
[0098] In a preferred embodiment, the system executes a database insert statement, using all fields of the patient's medical journey profile (including identifier value, identifier type, operational metrics, profile text field, and timestamp) as the insert values. The database engine checks whether a record with the same composite key already exists using a pre-established combined unique constraint (identifier value and identifier type). If a conflict exists, an update operation is automatically performed, overwriting the old value with the new one; otherwise, a new record is directly inserted. The entire operation is completed atomically within a database transaction, requiring no additional transaction control logic from the application layer.
[0099] As an optional conventional implementation, the system of the present invention can be deployed using the following hardware and software environment: a backend service framework supporting asynchronous processing at runtime; a relational database supporting joint unique constraints, conditional aggregation, and atomic insertion or update operations; and a general model compatible with standard dialogue interfaces for the large language model service. The frontend can use mainstream web frameworks to provide patient journey list pages and detail pages. The selection of the above deployment environment is a conventional technical approach in this field, and the present invention does not limit it.
[0100] As an exemplary data table structure design, the patient profile table may include the following fields: unique identifier, identifier value, identifier type, first appearance time, last appearance time, total number of records, total number of sessions, enumeration of medical treatment stages, confidence level, array of main concerns, array of unresolved issues, array of disease clues, enumeration of emotional baseline, long text summary, number of high-quality gaps, optimization count, creation time, and update time. Among these, the identifier value and identifier type together constitute a joint unique constraint. The question-and-answer record source table may include fields such as question-and-answer identifier, main identifier, extended data fields (storing third-party platform identifiers and business time), session identifier, question-and-answer content, category tag, gap marker, priority, and optimization marker. The above table structure is only a preferred implementation of this embodiment; those skilled in the art can add, delete, or adjust fields or types according to actual business needs.
[0101] To verify the technical effectiveness of the embodiments of the present invention, the applicant conducted verification in a multi-source question-and-answer system actually running at Sichuan Cancer Hospital. The dataset contains 46,298 question-and-answer records (of which 33,541 are non-duplicate records and 31,426 are valid for analysis), covering multiple entry points such as online consultation, outpatient guidance, and specialist questions and answers.
[0102] In this dataset, the system identified 23,181 unique patient identifiers according to the composite identifier extraction rules, generating 596 patient journey profiles, covering 4,706 historical question-and-answer records and 2,764 conversations. Among them, 581 profiles were generated normally, and 15 profiles were placeholders due to insufficient information.
[0103] Regarding patient identification coverage, the coverage has been improved from partial coverage of a single main identifier channel to full coverage of composite identifiers. In terms of operational metrics, the use of independent aggregation with Structured Query Language (SCL) eliminated the illusion of large language models on numeric fields; after the final snapshot update, the operational metrics were consistent with the SCL aggregation results. Regarding input budget control, after using sliding window truncation and adaptive character budget pruning, none of the 596 profile generation tasks exceeded a 9000-character budget, with a maximum input of approximately 6342 characters; without budget control, some patient inputs exceeded 12000 characters. Regarding the protection of personally identifiable information, after scanning with anonymization rules, no mobile phone numbers, email addresses, ID card numbers, detailed address numbers, patient self-identification, or names combined with medical roles were detected in the output fields of the 596 profiles; the leakage rate of personally identifiable information after anonymization was zero. Regarding concurrent write security, checks based on the joint unique constraint of medical institution identifier, identifier value, and identifier type revealed no duplicate profile rows.
[0104] Table 1 shows the distribution of the 596 patient profiles across different medical stages. As shown in Table 1, there were 212 profiles after the visit (35.6%), 200 profiles before the visit (33.6%), 86 profiles during the visit (14.4%), 83 profiles with mixed information across different stages (13.9%), and 15 profiles with insufficient information (2.5%).
[0105] Table 1. Distribution of Portrait Stages .
[0106] Table 2 shows the baseline distribution of emotions in 596 patient profiles. As shown in Table 2, 411 patients (69.0%) were in a calm state, 128 (21.5%) were in an anxious state, 14 (2.3%) were in a depressed state, and 43 (7.2%) had insufficient signal.
[0107] Table 2 Baseline Distribution of Emotions .
[0108] Figure 2This is a schematic diagram of a patient medical journey profiling generation system based on multi-source question-and-answer data, with reference to... Figure 2 The second embodiment of the present invention provides a patient medical journey profile generation system 200 based on multi-source question-and-answer data, including: an extraction module 201, an aggregation module 202, a splicing and comparison module 203, a desensitization module 204, a merging module 205, and a writing module 206. The functions of each module are described in detail below: Extraction module 201 is used to extract composite patient identifiers from multiple candidate identifier fields of multi-source question and answer records according to a preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type. The aggregation module 202 is used to perform structured query language aggregation on the full set of historical question and answer records based on the composite patient identifier to obtain operational indicators; the operational indicators are independent of the semantic processing of the downstream large language model. The splicing comparison module 203 is used to extract the most recent preset number of records from the full historical question and answer records in reverse chronological order, truncate the question and answer content of each record according to the upper limit of characters and splice them into text to be processed, compare the number of characters of the text to be processed with the preset character budget, and if it exceeds the preset character budget, it will be removed one by one from the end to obtain the text to be processed that meets the preset character budget. The desensitization module 204 is used to input the text to be processed that meets the preset character budget into the large language model to generate structured profile text, and to perform multi-level desensitization processing on the structured profile text to obtain the desensitized structured profile text. The merging module 205 is used to merge the operational indicators with the desensitized structured profile text to form a patient medical journey profile; when the number of historical question and answer records is zero, or lower than the minimum threshold of the number of historical question and answer records, or when the large language model call fails, the preset placeholder result is used as the patient medical journey profile. The writing module 206 is used to atomically write the patient's medical journey profile into the database in one go based on the joint unique constraint of the identifier value and the identifier type.
[0109] Based on the above embodiments, the present invention also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the steps in the patient medical journey profile generation method based on multi-source question-and-answer data in the first embodiment.
[0110] Figure 3A schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0111] like Figure 3 As shown, the electronic device 300 may include a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, the ROM 302, and the RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0112] Multiple components in electronic device 300 are connected to input / output (I / O) interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of monitors, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0113] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as a method for generating a patient's medical journey profile based on multi-source question-and-answer data or a model training method for generating a patient's medical journey profile based on multi-source question-and-answer data. For example, in some embodiments, the method for generating a patient's medical journey profile based on multi-source question-and-answer data or the model training method for generating a patient's medical journey profile based on multi-source question-and-answer data can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 300 via memory (ROM) 302 and / or communication unit 309. When the computer program is loaded into random access memory (RAM) 303 and executed by computing unit 301, one or more steps of the patient medical journey profiling method based on multi-source question-and-answer data or the model training method for generating patient medical journey profiling based on multi-source question-and-answer data described above can be performed. Alternatively, in other embodiments, computing unit 301 can be configured by any other suitable means (e.g., by means of firmware) to execute the patient medical journey profiling method based on multi-source question-and-answer data or the model training method for generating patient medical journey profiling based on multi-source question-and-answer data.
[0114] Based on the above embodiments, the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the patient medical journey profile generation method based on multi-source question-and-answer data disclosed in the embodiments of the present invention.
[0115] Based on the above embodiments, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the patient medical journey profile generation method based on multi-source question-and-answer data disclosed in the embodiments of the present invention.
[0116] The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0117] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.
[0122] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating patient medical journey profiles based on multi-source question-and-answer data, characterized in that, include: Composite patient identifiers are extracted from multiple candidate identifier fields of multi-source question and answer records according to a preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type. The extraction according to a preset priority includes: when the main identifier field is not empty, using the value of the main identifier field and the corresponding identifier type; otherwise, when the third-party platform identifier field is not empty, using the value of the third-party platform identifier field and the corresponding identifier type; when both are empty, discarding the question and answer record. Based on the composite patient identifier, structured query language aggregation is performed on all historical question and answer records to obtain operational metrics. The operational metrics are independent of the semantic processing of the downstream large language model. The filtering conditions of the structured query language aggregation distinguish between two channels: a first channel of primary identifier equality matching, and a second channel of third-party platform identifier equality with the primary identifier being empty or an empty string, to avoid double counting of operational metrics. The time field prioritizes the business time, and if there is no business time, it reverts to the record creation time. The operational metrics include at least the total number of records, the total number of sessions, the number of high-quality gaps, the optimization count, and the first and last question and answer times. Extract the most recent preset number of records from the full historical question and answer records in reverse chronological order. Truncate the question and answer content of each record according to the maximum character limit and concatenate them into text to be processed. Compare the number of characters in the text to be processed with the preset character budget. If it exceeds the preset character budget, remove them one by one from the end to obtain the text to be processed that meets the preset character budget. The text to be processed that meets the preset character budget is input into a large language model to generate structured profile text. The structured profile text is then subjected to multi-level desensitization processing to obtain the desensitized structured profile text. The multi-level desensitization processing includes: first-level constraints on personally identifiable information at the system prompt word level; second-level recognition and replacement of the personally identifiable information after model output; and third-level recognition and replacement of all text fields before writing to the database. The operational metrics and the anonymized structured profile text are merged into a patient's medical journey profile. When merging normal profiles, the operational metrics and the anonymized structured profile text are merged into a unified data object according to the field mapping relationship. When the number of historical question and answer records is zero, or lower than the minimum threshold of the number of historical question and answer records, or when the large language model call fails, an abnormal path is entered, and the preset placeholder result is used as the patient's medical journey profile. Based on the joint unique constraint of the identifier value and the identifier type, the patient's medical journey profile is atomically written into the database in one go.
2. The method for generating a patient's medical journey profile based on multi-source question-and-answer data as described in claim 1, characterized in that, The preset quantity is 30, the maximum number of characters is 80, and the preset character limit is 9000 characters.
3. The method for generating a patient's medical journey profile based on multi-source question-and-answer data as described in claim 1, characterized in that, The personally identifiable information includes at least a mobile phone number, email address, ID card number, detailed address, the patient's self-proclaimed name, and a name plus a medical role.
4. The method for generating a patient's medical journey profile based on multi-source question-and-answer data as described in claim 1, characterized in that, After extracting the composite patient identifier and before performing the structured query language aggregation, the method further includes: deduplicating and aggregating all question and answer records according to the identifier value and the identifier type to obtain a candidate patient set, and filtering them according to the time window, minimum number of records and maximum number of candidates to support full backfilling and incremental refresh.
5. The method for generating a patient medical journey profile based on multi-source question-and-answer data as described in claim 1, characterized in that, The structured profile text includes at least the enumeration of the medical treatment stage, confidence level, main demands, unresolved issues, disease clues, emotional baseline enumeration, and a long text summary; the disease clues follow a conservative output strategy: they are only output when at least two historical question and answer records consistently point to the same disease, location, or treatment method, and specific diagnostic terms are disabled, while business-oriented generalized expressions are used.
6. The method for generating a patient's medical journey profile based on multi-source question-and-answer data as described in claim 5, characterized in that, In the preset placeholder results, the medical treatment stage enumeration is in a state of insufficient information.
7. A patient medical journey profile generation system based on multi-source question-and-answer data, characterized in that, include: The extraction module is used to extract composite patient identifiers from multiple candidate identifier fields of multi-source question and answer records according to a preset priority. The multiple candidate identifier fields include a main identifier field and a third-party platform identifier field. The composite patient identifier includes an identifier value and an identifier type. The extraction according to a preset priority includes: when the main identifier field is not empty, using the value of the main identifier field and the corresponding identifier type; otherwise, when the third-party platform identifier field is not empty, using the value of the third-party platform identifier field and the corresponding identifier type; when both are empty, discarding the question and answer record. The aggregation module is used to perform structured query language aggregation on the full historical question and answer records based on the composite patient identifier to obtain operational metrics. The operational metrics are independent of the semantic processing of the downstream large language model. The filtering conditions of the structured query language aggregation distinguish between two channels: a first channel of primary identifier equality matching, and a second channel of third-party platform identifier equality with the primary identifier being empty or an empty string, to avoid double counting of operational metrics. The time field prioritizes the business time, and if there is no business time, it reverts to the record creation time. The operational metrics include at least the total number of records, the total number of sessions, the number of high-optimization gaps, the optimization count, and the first and last question and answer times. The splicing and comparison module is used to extract the most recent preset number of records from the full historical question and answer records in reverse chronological order, truncate the question and answer content of each record according to the upper limit of characters and splice them into text to be processed, compare the number of characters of the text to be processed with the preset character budget, and if it exceeds the preset character budget, it will be removed one by one from the end to obtain the text to be processed that meets the preset character budget. The desensitization module is used to input the text to be processed that meets the preset character budget into a large language model to generate structured profile text, and to perform multi-level desensitization processing on the structured profile text to obtain the desensitized structured profile text; the multi-level desensitization processing includes: performing a first-level constraint on personally identifiable information at the system prompt word level; performing a second-level recognition and replacement on the personally identifiable information after model output; and performing a third-level recognition and replacement on all text fields before writing to the database; The merging module is used to merge the operational metrics and the anonymized structured profile text into a patient's medical journey profile; when merging normal profiles, the operational metrics and the anonymized structured profile text are merged into a unified data object according to the field mapping relationship; when the number of historical question and answer records is zero, or lower than the minimum threshold of the number of historical question and answer records, or when the large language model call fails, an abnormal path is entered, and the preset placeholder result is used as the patient's medical journey profile; The writing module is used to atomically write the patient's medical journey profile into the database in one go, based on the joint unique constraint of the identifier value and the identifier type.
Citation Information
Patent Citations
Patient portrait generation method fusing multi-source traffic
CN121790024A
KR20260042668A
