Drug recommendation method and device, electronic equipment and storage medium
By obtaining patient information and using language models and knowledge bases to recommend drugs, the problem of information asymmetry in traditional pharmacies purchasing drugs is solved, and the accuracy and service efficiency of drug recommendations are improved.
Patent Information
- Application Number
- CN202411353513.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-31
AI Technical Summary
There is information asymmetry in the process of purchasing drugs in traditional pharmacies, resulting in inaccurate drug selection and low service efficiency during peak periods.
By obtaining the basic information of patients and condition information, generating drug use query statements, searching recommendation plans using pre-trained language models and external knowledge bases, we integrate feedback content, including recommended drugs, and improve the accuracy and efficiency of drug recommendations.
Reduces inaccuracy in drug selection and improves pharmacy service efficiency, especially in peak hours to provide accurate drug recommendations more quickly.
Smart Images

Figure CN119230053A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent service technology for drug stores, and in particular to a drug recommendation method, device, electronic device and storage medium. Background Art
[0002] In the traditional drugstore purchase process, patients describe their symptoms to drugstore staff, who then recommend drugs based on their own experience and medical knowledge. However, this method has the problem of information asymmetry, which may lead to inaccurate drug selection or poor treatment effects. In addition, the efficiency of drugstore services is also affected by peak hours. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a drug recommendation method, device, electronic device and storage medium.
[0004] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0005] In a first aspect, the present invention provides a drug recommendation method, the method comprising:
[0006] Obtain basic patient information and patient condition information;
[0007] Generate a medication query statement based on the patient's basic information and the patient's condition information;
[0008] At least one recommendation scheme is retrieved from a pre-trained language model and / or a preset external knowledge base using the medication query statement, and all the recommendation schemes are integrated to obtain feedback content, wherein the feedback content includes recommended drugs.
[0009] Optionally, the step of generating a medication query statement according to the patient's basic information and the patient's condition information includes:
[0010] Extracting information entities from the patient's basic information and the patient's condition information;
[0011] The medication query statement is generated using the information entity and a preset statement template.
[0012] Optionally, the information entity includes symptoms and signs, the preset statement template, and the step of generating the medication query statement using the information entity and the preset statement template includes:
[0013] The preset statement template is filled with the symptoms and the signs to generate the medication query statement.
[0014] Optionally, the recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes:
[0015] Determine a first recommended solution from all the recommended solutions according to the recommendation probability of each of the recommended solutions;
[0016] The feedback content is obtained by filling a preset feedback template using the disease description and available drugs in the first recommended plan.
[0017] Optionally, the recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes:
[0018] Determine a first recommended solution and alternative solutions from all the recommended solutions according to the recommendation probability of each of the recommended solutions;
[0019] The preset feedback template is filled with the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to obtain the feedback content.
[0020] Optionally, the recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes:
[0021] Determine a first recommended solution from all the recommended solutions according to the recommendation probability of each of the recommended solutions;
[0022] The remaining recommended solutions are combined and the obtained results are used as alternative solutions;
[0023] The preset feedback template is filled with the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to obtain the feedback content.
[0024] Optionally, the step of determining a first recommended solution from all the recommended solutions according to the recommendation probability of each of the recommended solutions includes:
[0025] The recommended solution with the highest recommendation probability is used as the first recommended solution.
[0026] In a second aspect, the present invention provides a drug recommendation device, the device comprising:
[0027] Data collection module, used to obtain basic information of patients and information on their condition;
[0028] The data analysis module is used to generate a medication query statement based on the patient's basic information and the patient's condition information; use the medication query statement to retrieve at least one recommendation plan from a pre-trained language model and / or a preset external knowledge base, integrate all the recommendation plans, and obtain feedback content, which includes recommended drugs.
[0029] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the drug recommendation method described in any of the aforementioned embodiments.
[0030] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a drug recommendation method as described in any one of the aforementioned embodiments.
[0031] The drug recommendation method provided by the present invention obtains basic information of the patient and information about the patient's condition, generates a medication query statement based on the basic information of the patient and the patient's condition, and uses the medication query statement to retrieve at least one recommendation plan from a pre-trained language model and / or a preset external knowledge base, integrates all recommendation plans, and obtains feedback content including recommended drugs, thereby avoiding inaccurate drug selection caused by pharmacy staff recommending drugs based on their own experience and medical knowledge and improving pharmacy service efficiency during peak hours.
[0032] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention is shown;
[0035] Figure 2 A functional unit block diagram of a drug store drug purchasing system provided by an embodiment of the present invention is shown;
[0036] Figure 3 A schematic diagram of a process of a drug recommendation method provided by an embodiment of the present invention is shown;
[0037] Figure 4 A schematic diagram showing a process flow of generating feedback content provided by an embodiment of the present invention;
[0038] Figure 5 A schematic diagram showing a flow chart of another feedback content generation process provided by an embodiment of the present invention;
[0039] Figure 6 A schematic flow chart of another feedback content generation process provided by an embodiment of the present invention is shown.
[0040] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication component; 200 - drug recommendation device; 201 - data acquisition module; 202 - data analysis module. DETAILED DESCRIPTION
[0041] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0043] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0044] Please refer to Figure 1 , is a block diagram of an electronic device 100. The electronic device 100 includes a memory 110, a processor 120, and a communication component 130. The memory 110, the processor 120, and the communication component 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0045] The memory 110 is used to store programs or data. The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0046] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions.
[0047] The communication component 130 is used to establish a communication connection between the electronic device and other communication terminals through the network, and to send and receive data through the network.
[0048] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0049] In order to overcome the deficiencies of the prior art, an embodiment of the present invention provides a drug recommendation method applied to the above-mentioned electronic device 100, which will be described in detail below.
[0050] like Figure 2 As shown, a drug store drug purchase system is installed on the electronic device, and the drug store drug purchase system includes an interactive interface, a dialogue module, a drug recommendation device 200, a feedback module, and a database module. Among them, the drug store staff inputs information through the interactive interface of the drug store drug purchase system, and the corresponding feedback information is displayed on the interactive interface of the drug store drug purchase system. The drug store drug purchase system can be connected to the drug information communication of the drug store sales management system, and obtain drug library information from the drug store sales management system, including drug name, specification, manufacturer, inventory, etc. The drug recommendation device 200 can execute the corresponding steps in the following embodiments and various possible methods, including a data acquisition module 201 and a data analysis module 202.
[0051] Please refer to Figure 3 , the drug recommendation method includes steps S101 to S103.
[0052] S101, obtaining basic information of the patient and information of the patient's condition.
[0053] Among them, the patient's basic information includes the patient's name, patient's gender, patient's age, patient's contact number, etc.
[0054] The pharmacy staff inputs the patient's basic information and the patient's condition information into the pharmacy drug purchasing system by operating the interactive interface of the drug purchasing system, and the data collection module 201 of the drug recommendation device 200 transmits the patient's basic information to the data analysis module 202.
[0055] Patient condition information includes the patient's specific symptoms and signs, such as headache, fever, cough, sore throat, etc.
[0056] Based on the patient's description, the pharmacy staff inputs the patient's specific symptoms and signs by operating the interactive interface of the pharmacy drug purchasing system. At this time, the dialogue module transmits the patient's symptoms and signs to the database module to obtain inquiries about possible causes, other accompanying symptoms, etc., and displays them to the pharmacy staff through the interactive interface. After the conversation is over, the dialogue module transmits the patient's symptoms and signs to the data analysis module 202.
[0057] S102, generating a medication query statement based on the patient's basic information and the patient's condition information.
[0058] The implementation process of the data analysis module 202 generating a medication query statement based on the patient's basic information and the patient's condition information may include sub-steps S102 - 1 to S102 - 2 .
[0059] S102-1, extracting information entities from the patient's basic information and the patient's condition information.
[0060] The data analysis module 202 uses natural language processing technology to perform semantic understanding on the text of the input patient basic information and the text of the patient condition information, and identifies information entities such as key symptoms and signs.
[0061] For example, if the patient's medical condition information is "I felt a sore throat and cough a day ago, and my temperature reached 38.5 degrees when I woke up this morning. I feel weak all over, and my limbs ache.", the data analysis module 202 uses natural language processing technology to split the sentence into several words or phrases such as "I felt a sore throat and cough a day ago, and my temperature reached 38.5 degrees when I woke up this morning. I feel weak all over, and my limbs ache."
[0062] Subsequently, the data analysis module 202 performs noun, verb, adjective and other part-of-speech tagging on the above split words or phrases, and the result is "One day ago / TIME, I felt / v a sore throat / n, / w a cough / vn, / w today / TIME morning / TIME woke up / v body temperature / n reached / v 38.5 degrees / m, / w general / n fatigue / a, / w limbs / n sore / a. / w"
[0063] The data analysis module 202 uses named entity recognition technology to extract key information entities such as disease names, symptoms, and signs:
[0064] Symptoms: [sore throat, cough, body temperature up to 38.5 degrees, general fatigue, limb aches];
[0065] Physical signs: [There is no clear description of physical signs, but "general fatigue" and "body temperature reaches 38.5 degrees" can be considered as a sign].
[0066] The data analysis module 202 further analyzes the relationship between symptoms and signs, and their association with possible diseases. The analysis results are as follows:
[0067] [Sore throat, cough] may be related to upper respiratory tract infection or respiratory tract infection;
[0068] [Body temperature reaches 38 degrees, general fatigue, and limb aches] are possible accompanying symptoms caused by infection.
[0069] S102-2, using the information entity and the preset statement template, generate the medication query statement.
[0070] In possible implementations, the preset sentence templates are designed around the scenario of medical consultation to ensure that the pre-trained language model can accurately capture and understand the patient's symptoms, signs, and the input of the pharmacy staff. For example, the preset sentence templates can be "The patient describes the symptoms as [symptom 1, symptom 2, symptom 3...], what are the possible diseases?", "Based on the symptoms described by the patient [symptom 1, symptom 2, symptom 3...], are there any more [symptom 1-1, symptom 1-2, symptom 1-3...]?", "For [disease], what drugs are recommended?", "The patient has a headache and fever, what disease may it be? How to recommend drugs?", etc.
[0071] In an embodiment of the present invention, the data analysis module 202 may generate a medication query statement by filling in a preset statement template using symptoms and signs.
[0072] For example, assuming that the preset statement template is "The patient describes the symptoms as [symptom 1, symptom 2, symptom 3...], what are the possible diseases?", and the patient's symptoms and signs are "sore throat, cough, body temperature reaches 38.5 degrees, general fatigue, limb pain", the patient's symptoms and signs are filled in the corresponding positions of the first template to generate a medication query statement "The patient describes the symptoms as sore throat, cough, body temperature reaches 38.5 degrees, general fatigue, limb pain, what are the possible diseases?"
[0073] Assume that the preset statement template is "The patient's symptoms and signs are described as [symptom 1, symptom 2, symptom 3...], may I ask if it is caused by catching a cold", and the patient's symptoms and signs are "sore throat, cough, body temperature reaches 38.5 degrees, general fatigue, limb pain", fill the patient's symptoms and signs into the corresponding positions of the preset statement template, and generate a medication query statement "The patient describes the symptoms as sore throat, cough, body temperature reaches 38.5 degrees, general fatigue, limb pain, may I ask if it is caused by catching a cold?"
[0074] In an embodiment of the present invention, a template library can be pre-built, and the template library includes multiple preset statement templates. The data analysis module 202 selects at least one preset statement template from the template library, fills the selected at least one preset statement template with the extracted entity information, and obtains at least one medication query statement.
[0075] S103, using the medication query statement to retrieve at least one recommendation plan from the pre-trained language model and / or the preset external knowledge base, integrating all the recommendation plans to obtain feedback content.
[0076] Among them, the feedback content includes recommended drugs.
[0077] In the embodiment of the present invention, it is necessary to build an internal knowledge base in advance for retrieval by the pre-trained language model.
[0078] The process of building an internal knowledge base can be as follows:
[0079] First, authoritative medical information is collected from a variety of channels such as medical books, journals, online databases, etc. The collected data is cleaned to remove errors, redundancy and outdated information, and organized according to a certain structure (such as disease classification, drug classification).
[0080] The medical information collected from various channels such as medical books, journals, and online databases at this stage is often disorganized and contains a lot of errors, redundancy, and outdated information. The following is a sample snippet of the data before sorting:
[0081] Data item 1:
[0082] Disease name: cold (Flu);
[0083] Symptoms: fever, cough, nasal congestion, sneezing, body aches;
[0084] Recommended drugs: Tylenol, BaiJiaHei.
[0085] Data item 2:
[0086] Disease: Cough;
[0087] Symptoms: sore throat, cough, chest tightness;
[0088] Suggested Medications: Liquorice Tablets, Kebiqing.
[0089] Data item 3:
[0090] Disease: Common Cold;
[0091] Symptoms: headache, fatigue, sore throat;
[0092] Recommended drugs: Aspirin, WeiC Yinqiao Pills.
[0093] The data before sorting had the following problems: different naming methods were used for disease names (such as "Flu" and "Cold", "Cough" and "Cough"); the list formats of symptoms and recommended drugs were inconsistent, some were separated by commas, and some were not clearly separated (such as "fatigue" and "sore throat" were not separated by commas); there was a lack of unified structure or identification between data entries.
[0094] The collected data can be organized in the following JSON format:
[0095] Outer structure: Use JSON array to store all disease information, and each array element is a disease object;
[0096] Disease object: contains three attributes: "disease" (disease name), "symptoms" (symptom list) and "recommendedMedications" (recommended medicine list);
[0097] Symptom list: Use JSON array to store all symptoms related to the disease;
[0098] Recommended drug list: It is also a JSON array, but each element is an object containing the drug name, possible English name, and description.
[0099] The above sample data is sorted out, and the results are as follows:
[0100] ```json
[0101]
[0102] }]}.
[0103] Here is a comparison of the information fragments about drugs before and after the sorting. The information fragments of drugs before the sorting are as follows:
[0104] Drug Information 1:
[0105] Drug name: Aspirin;
[0106] Manufacturer: A pharmaceutical factory;
[0107] Indications: cold, headache, fever, joint pain (obsolete);
[0108] Specifications: 100mg, 500mg;
[0109] Stock quantity: 500 boxes.
[0110] Drug Information 2:
[0111] Drug name: Paracetamol;
[0112] Manufacturer: B Pharmaceuticals;
[0113] Indications: fever, pain (too general description);
[0114] Specification: 500mg, 1g;
[0115] Inventory: Number of medicines: 300 boxes (redundant information).
[0116] Drug Information 3:
[0117] Drug name: Aspirin;
[0118] Manufacturer: C Pharmaceutical Factory (duplicate entry, different manufacturer);
[0119] Indications: cold, headache, anti-inflammatory;
[0120] Specification: 100mg;
[0121] Availability: Out of stock.
[0122] The data is sorted in JSON format. The following is the sorted data:
[0123] ```json
[0124] {"Drug List":[
[0125] {
[0126] "Drug Name":"Aspirin",
[0127] "Manufacturer":"A Pharmaceutical Factory",
[0128] "Indications": ["cold", "headache", "fever"],
[0129] "Specification":["100mg","500mg"],
[0130] "Stock Quantity":500},
[0131] {
[0132] "Drug Name":"Paracetamol",
[0133] "Manufacturer":B Pharmaceuticals,
[0134] "Indications": ["Fever", "Pain (including but not limited to headache, muscle pain)"],
[0135] "Specification":["500mg","1g"],
[0136] "Stock Quantity":300
[0137] }
[0138] ].
[0139] After complete data collection and organization, the associations between diseases, drugs, symptoms, and signs are established to form a complex knowledge graph network. The process is as follows:
[0140] First, define "entity" and "relationship".
[0141] The defined entities include: (1) diseases: such as colds, bronchitis, headaches, hypertension, diabetes, etc.; (2) medicines: such as Ganmaoling granules, amoxicillin capsules, headache tablets, nifedipine tablets, metformin sustained-release tablets, etc.; (3) symptoms: such as fever, cough, sore throat, headache, dizziness, numbness of hands, etc.; (4) physical signs: such as increased heart rate, increased blood pressure, redness of the skin, etc.
[0142] The defined “relationships” include: (1) therapeutic relationship: a drug is used to treat a certain disease; (2) symptom association: what symptoms or signs a certain disease may cause; (3) drug side effects: side effects or adverse reactions that a certain drug may cause.
[0143] Then, relevant information on diseases, drugs, symptoms and signs is collected from medical books, journals, online databases, pharmacopoeias and other databases, and then cleaned and sorted to remove erroneous, redundant and outdated information.
[0144] Next, perform entity recognition on the collected data (e.g., cold belongs to the disease entity, aspirin belongs to the drug entity, headache belongs to the symptom entity, and increased heart rate belongs to the sign entity), extract the unique identifier and description information of each entity, and standardize it.
[0145] Subsequently, relationships are automatically extracted from the data using natural language processing techniques or manually defined based on expert knowledge.
[0146] Finally, choose a database suitable for storing graph data, such as Neo4j, JanusGraph, etc.; create a node for each entity (such as disease, medicine, symptom, sign) in the database and store its basic information; establish edges between corresponding entity nodes according to the extracted relationships, and mark the type and attributes of the relationship. For example, establish an edge "may be caused by..." between the "headache" symptom node and the "cold" disease node; add necessary attribute information to each node and edge, such as the dosage of the drug, the description of the disease, the confidence of the relationship, etc.
[0147] The internal knowledge base is constructed through the above process. It should be noted that the internal knowledge base needs to be updated regularly to reflect the latest research results and clinical practice changes in the medical field.
[0148] In an embodiment of the present invention, the data analysis module 202 may first input the medication query statement into a pre-trained language model to retrieve a recommended solution.
[0149] The pre-trained language model will first encode the input medication query sentence (such as the patient's sore throat, cough and other symptom descriptions mentioned above) to form a series of high-dimensional vectors; using the neural network structure and learned parameters within the model, these high-dimensional vectors are used to capture the semantic information of the sentence and predict possible recommendations.
[0150] The training process of the pre-trained language model can be as follows: First, prepare a training data set containing real consultation dialogues, patient symptoms, signs, disease diagnosis, drug recommendations, etc.; then, use the training data set to train the large language model to optimize the model's performance in medical consultation scenarios. Adjust the model's parameters, such as learning rate, number of iterations, etc., based on feedback during the training process to obtain the best performance.
[0151] During the training process, the model's feedback mainly comes from the training loss (Loss), validation loss / accuracy, and gradient information. If the training loss drops sharply in the initial stage but then stagnates or begins to oscillate, it may indicate that the learning rate is too high, causing the model to be unable to stably converge to the optimal solution. At this time, you need to lower the learning rate. If the training loss drops very slowly, and the gap between the validation loss and the training loss continues to increase (with no obvious signs of overfitting), it may be that the learning rate is too low, causing the model to learn slowly and possibly fall into a local optimal solution. At this time, you can try to increase the learning rate.
[0152] The learning rate can be automatically adjusted using a predefined decay strategy (such as reducing the learning rate by a certain percentage every certain number of iterations, or using an adaptive decay strategy based on changes in validation loss).
[0153] You can also apply optimizers such as Adam and RMSprop to implement an adaptive adjustment mechanism for the learning rate, and dynamically adjust the learning rate of each parameter based on the historical gradient information of the parameter.
[0154] The intensity of the learning rate adjustment (i.e., the magnitude of the reduction or increase) usually depends on the difference between the current learning rate and the optimal learning rate. If the current learning rate is much higher or much lower than the optimal learning rate estimate, a larger adjustment may be required. However, if the loss fluctuates greatly during training, the learning rate may need to be adjusted carefully to avoid causing training instability. Towards the end of training, a larger learning rate adjustment may destroy the established model structure, so a smaller adjustment may be required.
[0155] In the embodiment of the present invention, if the pre-trained language model cannot retrieve a comprehensive and accurate recommendation solution from the internal knowledge base, the data analysis module 202 turns to the external knowledge base for retrieval.
[0156] The external knowledge base mainly contains authoritative medical information such as medical books, journal articles, online databases, etc. By inputting the medication query statement into the external knowledge base, at least one recommended solution is obtained.
[0157] The recommended regimen includes a description of the disease and available medications.
[0158] For example, assuming that the symptoms described by the patient are "headache, fever, sore throat", the data analysis module 202 retrieves the following possible recommendations based on these three symptoms:
[0159] Recommended Option A:
[0160] Disease description: influenza, probability 0.8;
[0161] Related symptoms: headache, fever, malaise, sore throat;
[0162] Recommended drugs: Oseltamivir capsules, ibuprofen granules, and Ganmaoling granules.
[0163] Recommended Option B:
[0164] Disease description: Migraine, probability 0.2;
[0165] Related symptoms: unilateral or bilateral headache, fever;
[0166] Recommended drugs: acetaminophen tablets, sumatriptan nasal spray.
[0167] After obtaining at least one recommended solution, the data analysis module 202 needs to integrate all the recommended solutions, obtain feedback content and display it on the interactive interface.
[0168] In a possible implementation, the data analysis module 202 integrates all the recommended solutions to obtain the feedback content, which may include the following steps: Figure 4 Steps S2011 to S2012 are shown.
[0169] S2011, according to the recommendation probability of each recommended solution, determine the first recommended solution from all recommended solutions.
[0170] The first recommended solution may be the solution with the highest recommendation probability among all the recommended solutions, that is, the solution with the highest recommendation probability is taken as the first recommended solution.
[0171] S2012, use the disease description and available drugs in the first recommended plan to fill in the preset feedback template and obtain the feedback content.
[0172] It can be understood that the data analysis module 202 transmits only the recommendation scheme with the highest recommendation probability as feedback content to the feedback module, so that the feedback module displays the feedback content on the interactive interface.
[0173] In another possible implementation, the data analysis module 202 integrates all the recommended solutions to obtain the feedback content, which may include the following steps: Figure 5 Steps S2021 to S2022 are shown.
[0174] S2021, determine the first recommended solution and alternative solutions from all recommended solutions according to the recommendation probability of each recommended solution.
[0175] The first recommended solution may be the solution with the highest recommendation probability among all recommended solutions, and the alternative solution may be the solution with the second highest recommendation probability among all recommended solutions. That is, the solution with the highest recommendation probability is the first recommended solution, and the solution with the second highest recommendation probability is the alternative solution.
[0176] S2022, fill in a preset feedback template using the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to obtain feedback content.
[0177] It can be understood that the data analysis module 202 transmits the two recommendation solutions with the highest recommendation probability as feedback content to the feedback module, so that the feedback module displays the feedback content on the interactive interface.
[0178] In another possible implementation, the data analysis module 202 integrates all the recommended solutions to obtain the feedback content, which may include the following steps: Figure 6 Steps S2031 to S2033 are shown.
[0179] S2031, determining a first recommended solution from all recommended solutions according to the recommendation probability of each recommended solution.
[0180] The first recommended solution may be the solution with the highest recommendation probability among all the recommended solutions, that is, the solution with the highest recommendation probability is taken as the first recommended solution.
[0181] S2032: The remaining recommended solutions are merged and the obtained processing results are used as alternative solutions.
[0182] Among them, if the remaining recommended options have common symptoms or available drugs, the repeated parts will be merged to obtain at least one alternative option.
[0183] S2033, using the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to fill in a preset feedback template to obtain feedback content.
[0184] It can be understood that the data analysis module 202 transmits the integration results of all the recommended solutions as feedback content to the feedback module, so that the feedback module displays the feedback content on the interactive interface.
[0185] The drugstore staff can interact with the drugstore drug purchasing system according to the actual situation, such as adjusting the input patient's symptoms and signs, or screening and adjusting the recommended drugs. The drug recommendation device 200 in the drugstore drug purchasing system will re-analyze and recommend according to the new input until a satisfactory drug is obtained.
[0186] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory shown in the figure or solidified in the operating system (OS) of the electronic device, and can be Figure 1 Meanwhile, the data and program codes required for executing the above modules can be stored in the memory.
[0187] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0188] In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0189] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0190] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A drug recommendation method, characterized in that: The method comprises: Obtain basic patient information and patient condition information; Generate a medication query statement based on the patient's basic information and the patient's condition information; At least one recommendation scheme is retrieved from a pre-trained language model and / or a preset external knowledge base using the medication query statement, and all the recommendation schemes are integrated to obtain feedback content, wherein the feedback content includes recommended drugs.
2. The method according to claim 1, characterized in that The step of generating a medication query statement according to the patient's basic information and the patient's condition information includes: Extracting information entities from the patient's basic information and the patient's condition information; The medication query statement is generated using the information entity and a preset statement template.
3. The method according to claim 2, characterized in that The information entity includes symptoms and signs, the preset statement template, and the step of generating the medication query statement using the information entity and the preset statement template includes: The preset statement template is filled with the symptoms and the signs to generate the medication query statement.
4. The method according to claim 1, characterized in that The recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes: Determine a first recommended solution from all the recommended solutions according to the recommendation probability of each of the recommended solutions; The feedback content is obtained by filling a preset feedback template using the disease description and available drugs in the first recommended plan.
5. The method according to claim 1, characterized in that The recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes: Determine a first recommended solution and alternative solutions from all the recommended solutions according to the recommendation probability of each of the recommended solutions; The preset feedback template is filled with the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to obtain the feedback content.
6. The method according to claim 1, characterized in that The recommended solution includes a description of the disease and available drugs, and the step of integrating all the recommended solutions to obtain feedback content includes: Determine a first recommended solution from all the recommended solutions according to the recommendation probability of each of the recommended solutions; The remaining recommended solutions are combined and the obtained results are used as alternative solutions; The preset feedback template is filled with the disease description and available drugs in the first recommended solution and the disease description and available drugs in the alternative solution to obtain the feedback content.
7. The method according to any one of claims 4 to 6, characterized in that The step of determining the first recommended solution from all the recommended solutions according to the recommendation probability of each recommended solution comprises: The recommended solution with the highest recommendation probability is used as the first recommended solution.
8. A drug recommendation device, characterized in that: The device comprises: Data collection module, used to obtain basic information of patients and information on their condition; The data analysis module is used to generate a medication query statement based on the patient's basic information and the patient's condition information; use the medication query statement to retrieve at least one recommendation plan from a pre-trained language model and / or a preset external knowledge base, integrate all the recommendation plans, and obtain feedback content, which includes recommended drugs.
9. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the drug recommendation method described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the drug recommendation method according to any one of claims 1 to 7 is implemented.
