CN113642563A - Drug use rechecking method, device, equipment and storage medium - Google Patents

Drug use rechecking method, device, equipment and storage medium Download PDF

Info

Publication number
CN113642563A
CN113642563A CN202111015493.2A CN202111015493A CN113642563A CN 113642563 A CN113642563 A CN 113642563A CN 202111015493 A CN202111015493 A CN 202111015493A CN 113642563 A CN113642563 A CN 113642563A
Authority
CN
China
Prior art keywords
medicine
code
information
sound
drug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111015493.2A
Other languages
Chinese (zh)
Inventor
黄祥博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ping An Medical Health Technology Service Co Ltd
Original Assignee
Ping An Medical and Healthcare Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Medical and Healthcare Management Co Ltd filed Critical Ping An Medical and Healthcare Management Co Ltd
Priority to CN202111015493.2A priority Critical patent/CN113642563A/en
Publication of CN113642563A publication Critical patent/CN113642563A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The invention relates to the field of artificial intelligence, and discloses a medicine re-checking method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring and identifying a medicine package image and a prescription image of a medicine to be detected; respectively obtaining and matching first medicine name information and second medicine name information; if the matching fails, the first phonetic-shape code and the second phonetic-shape code are obtained by respectively converting the first phonetic-shape code and the second phonetic-shape code into the form of the phonetic-shape code; calculating the similarity between the first phonographic code and at least one second phonographic code; judging whether the similarity greater than a preset similarity threshold exists or not; and if the matching is successful or exists, generating a medication report according to the information of the medicine to be detected. The method carries out fuzzy matching by converting the medicine names and the medicine names in the prescription list into the sound-shape codes, avoids the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly written characters in the character recognition process, and can be applied to intelligent diagnosis and treatment and remote consultation.

Description

Drug use rechecking method, device, equipment and storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a medicine application rechecking method, a device, equipment and a storage medium.
Background
With the development of the urbanization process in China, the urban population also greatly increases, and the ever-increasing medical health service requirements of people still cause certain pressure on the operation of various hospitals. Particularly, in the working post where medicines are dispensed frequently, such as a pharmacy and a nurse station, under high pressure, the medicine dispensing standard is strictly executed, and the medicine dispensing error is strictly prevented, so that higher requirements are put forward for pharmacists and nurses. The current medical treatment flow and scene of patients are generally the following: the user visits a doctor, the doctor diagnoses, then a prescription is made, and the user goes to a hospital pharmacy or a third-party pharmacy according to the prescription to dispense medicines, get the medicines and then take the medicines. During the process from taking medicine to taking medicine, the inspection and rechecking stages of the medicine are lacked. In the real life scene, because artificial error, a lot of times of mismatching medicines in the pharmacy occur, and the patient uses wrong medicines unknowingly, so that serious medical accidents occur. In order to solve the safety of medication and avoid manual errors, a technical rechecking method is adopted to enhance the medicine inspection before medication and guide the medication taking notice, medication flow and the like. The safety of the medicine taking of the patient is guaranteed.
The existing methods for rechecking medicines are mainly two, one scheme is that the working intensity of medical staff such as pharmacist and nurse is reduced by increasing human hands, the scheme is strong in subjective factor, error is easy to occur, and medicine distribution efficiency is reduced, the other scheme is that the rechecking is performed by using an identification technology such as ocr technology, but recognition by using ocr technology may have characters missing, missing or wrongly-written characters, so that the recognition accuracy of the general names of medicines is influenced, and recognition errors are caused.
Disclosure of Invention
The invention mainly aims to solve the technical problem of low rechecking accuracy caused by missing characters, missing characters or wrongly written characters in the identification process of the traditional medicine rechecking.
The invention provides a drug use rechecking method in a first aspect, which comprises the following steps:
acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal; identifying the medicine package image and the prescription order image through a preset image detection algorithm to respectively obtain to-be-detected medicine information and at least one prescription order medicine information, wherein the to-be-detected medicine information comprises first medicine name information, and the prescription order medicine information comprises second medicine name information; matching the first drug name information with at least one second drug name information; if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes, and a first sound-shape code and at least one second sound-shape code are obtained; calculating the editing distance between the first pictophonetic code and each second pictophonetic code, and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance; judging whether the similarity greater than a preset similarity threshold exists or not; if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal; and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
Optionally, in a first implementation manner of the first aspect of the present invention, the identifying the medicine package image and the prescription order image through a preset image detection algorithm, and respectively obtaining the information of the medicine to be detected and the information of at least one prescription order medicine includes: carrying out edge detection on the medicine package image by adopting a canny edge detection operator to obtain an edge image of the medicine package image; carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image; carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area; and performing character recognition on the character area and the prescription order image through an Optical Character Recognition (OCR) technology to obtain the medicine information to be detected and at least one prescription order medicine information.
Optionally, in a second implementation manner of the first aspect of the present invention, the converting the first medicine name information and the second medicine name information into a form of a phonographic code, respectively, and obtaining the first phonographic code and the at least one second phonographic code includes: performing word segmentation processing on the first medicine name information and the second medicine name information respectively to obtain corresponding first medicine characters and second medicine characters; acquiring a sound code mapping rule and a shape code mapping rule; converting the first medicine character and the second medicine character through the sound code mapping rule to respectively obtain a corresponding first sound code and a corresponding second sound code, and converting the first medicine character and the second medicine character through the shape code mapping rule to respectively obtain a corresponding first shape code and a corresponding second shape code; and splicing the first phonon code and the first shape code, and correspondingly splicing a second phonon code corresponding to the second medicine character and a corresponding second shape code to obtain a corresponding first phonon-shape code and at least one second phonon-shape code.
Optionally, in a third implementation manner of the first aspect of the present invention, the calculating an edit distance between the first pictophonetic code and each of the second pictophonetic codes, and calculating a similarity between the first pictophonetic code and each of the second pictophonetic codes according to the edit distance includes: calculating the editing distance between the first phonographic code and each second phonographic code; constructing a corresponding editing distance matrix according to the editing distance; taking the value of the lowest right corner in the edit distance matrix as the corresponding shortest edit distance; and calculating the similarity between the first sound-shape code and the corresponding second sound-shape code according to a preset similarity formula and the shortest editing distance.
Optionally, in a fourth implementation manner of the first aspect of the present invention, after the determining that there is no similarity greater than the preset similarity threshold, the method further includes: acquiring the drug names of a local platform drug library, and performing de-duplication processing and index reconstruction processing on the acquired drug names to obtain a drug name set; converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set; matching the first sound-shape code and the second sound-shape code with each third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape codes matched with the first sound-shape code and the second sound-shape code respectively are the same medicine or not; if so, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal; and if not, generating a first early warning signal and sending the first early warning signal to the user terminal.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the prescription information further includes a theoretical usage amount; after the matching is successful or the similarity greater than a preset similarity threshold exists, the method further comprises the following steps: carrying out weight detection on the medicine to be detected to obtain weight information of the medicine to be detected, and calculating the actual purchase quantity of the medicine to be detected according to the weight information; judging whether the actual purchase amount is abnormal or not according to the theoretical usage amount; and if so, generating a second early warning signal and sending the second early warning signal to the user terminal.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the generating a medication report according to the information of the drug to be detected, and sending the medication report to the user terminal includes: acquiring a medication report template, wherein the medication report template comprises a medication report main body and a placeholder arranged at a preset position in the medication report main body; determining the information type of the drug information to be checked, and corresponding the drug information to be checked to the placeholder according to the corresponding relation between the preset information type and the placeholder; replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report; and sending the medication report to the user terminal.
The second aspect of the present invention provides a drug administration rechecking device, comprising:
the acquisition module is used for acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal; the identification module is used for identifying the medicine package image and the prescription order image through a preset image detection algorithm to respectively obtain medicine information to be detected and at least one prescription order medicine information, wherein the medicine information to be detected comprises first medicine name information, and the prescription order medicine information comprises second medicine name information; the matching module is used for matching the first medicine name information with at least one piece of second medicine name information; the conversion module is used for respectively converting the first medicine name information and the second medicine name information into a form of a sound-shape code when matching fails, so as to obtain a first sound-shape code and at least one second sound-shape code; the calculation module is used for calculating the editing distance between the first pictophonetic code and each second pictophonetic code and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance; the judging module is used for judging whether the similarity greater than a preset similarity threshold exists or not; the early warning module is used for generating a first early warning signal when the similarity larger than a preset similarity threshold does not exist, and sending the first early warning signal to the user terminal; and the medication report module is used for generating a medication report according to the information of the medicine to be detected when the matching is successful or the similarity greater than the preset similarity threshold exists, and sending the medication report to the user terminal.
Optionally, in a first implementation manner of the second aspect of the present invention, the identification module is specifically configured to: carrying out edge detection on the medicine package image by adopting a canny edge detection operator to obtain an edge image of the medicine package image; carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image; carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area; and performing character recognition on the character area and the prescription order image through an Optical Character Recognition (OCR) technology to obtain the medicine information to be detected and at least one prescription order medicine information.
Optionally, in a second implementation manner of the second aspect of the present invention, the conversion module is specifically configured to: performing word segmentation processing on the first medicine name information and the second medicine name information respectively to obtain corresponding first medicine characters and second medicine characters; acquiring a sound code mapping rule and a shape code mapping rule; converting the first medicine character and the second medicine character through the sound code mapping rule to respectively obtain a corresponding first sound code and a corresponding second sound code, and converting the first medicine character and the second medicine character through the shape code mapping rule to respectively obtain a corresponding first shape code and a corresponding second shape code; and splicing the first phonon code and the first shape code, and correspondingly splicing a second phonon code corresponding to the second medicine character and a corresponding second shape code to obtain a corresponding first phonon-shape code and at least one second phonon-shape code.
Optionally, in a third implementation manner of the second aspect of the present invention, the calculation module is specifically configured to: calculating the editing distance between the first phonographic code and each second phonographic code; constructing a corresponding editing distance matrix according to the editing distance; taking the value of the lowest right corner in the edit distance matrix as the corresponding shortest edit distance; and calculating the similarity between the first sound-shape code and the corresponding second sound-shape code according to a preset similarity formula and the shortest editing distance.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the medication rechecking device further includes a second matching module, where the second matching module specifically includes: acquiring the drug names of a local platform drug library, and performing de-duplication processing and index reconstruction processing on the acquired drug names to obtain a drug name set; converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set; matching the first sound-shape code and the second sound-shape code with each third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape codes matched with the first sound-shape code and the second sound-shape code respectively are the same medicine or not; if so, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal; and if not, generating a first early warning signal and sending the first early warning signal to the user terminal.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the prescription information further includes a theoretical usage amount; the medicine use rechecking device further comprises a weighing module, and the weighing module is specifically used for: carrying out weight detection on the medicine to be detected to obtain weight information of the medicine to be detected, and calculating the actual purchase quantity of the medicine to be detected according to the weight information; judging whether the actual purchase amount is abnormal or not according to the theoretical usage amount; and if so, generating a second early warning signal and sending the second early warning signal to the user terminal.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the medication reporting module is specifically configured to: acquiring a medication report template, wherein the medication report template comprises a medication report main body and a placeholder arranged at a preset position in the medication report main body; determining the information type of the drug information to be checked, and corresponding the drug information to be checked to the placeholder according to the corresponding relation between the preset information type and the placeholder; replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report; and sending the medication report to the user terminal.
The third aspect of the present invention provides a medication rechecking apparatus, comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor invokes the instructions in the memory to cause the medication rechecking device to perform the steps of the medication rechecking method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the above-described method of drug rehabilitation.
According to the technical scheme, a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal, are acquired; identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information; matching the first drug name information with at least one second drug name information; if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code; calculating the editing distance between the first phonographic code and the at least one second phonographic code, and calculating the similarity between the first phonographic code and the at least one second phonographic code according to the editing distance; judging whether the similarity greater than a preset similarity threshold exists or not; if the warning signal does not exist, generating a warning signal, and sending the warning signal to the user terminal; and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal. When the medicine name identified by the optical character recognition OCR cannot be matched with the prescription list, the medicine name and the medicine name in the prescription list are converted into the sound-shape codes for fuzzy matching, so that the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly-written characters in the character identification process is solved.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a drug review method in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of a second embodiment of a method for drug review in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a third embodiment of a drug review method in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a fourth embodiment of a method for drug review in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of a fifth embodiment of a method for drug rehabilitation according to the embodiments of the present invention;
FIG. 6 is a schematic diagram of one embodiment of a drug rehabilitation device in accordance with an embodiment of the present invention;
FIG. 7 is a schematic view of another embodiment of a drug rehabilitation device in accordance with an embodiment of the present invention;
fig. 8 is a schematic diagram of an embodiment of a drug rehabilitation device in an embodiment of the present invention.
Detailed Description
According to the technical scheme, a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal, are acquired; identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information; matching the first drug name information with at least one second drug name information; if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code; calculating the editing distance between the first phonographic code and the at least one second phonographic code, and calculating the similarity between the first phonographic code and the at least one second phonographic code according to the editing distance; judging whether the similarity greater than a preset similarity threshold exists or not; if the warning signal does not exist, generating a warning signal, and sending the warning signal to the user terminal; and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal. When the medicine name identified by the optical character recognition OCR cannot be matched with the prescription list, the medicine name and the medicine name in the prescription list are converted into the sound-shape codes for fuzzy matching, so that the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly-written characters in the character identification process is solved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For understanding, the following describes a specific process of an embodiment of the present invention, and with reference to fig. 1, a first embodiment of a drug review method in an embodiment of the present invention includes:
101. acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
it is to be understood that the execution subject of the present invention may be a drug administration review device, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
It is emphasized that to ensure the privacy and security of the data, the medication package image may be stored in a blockchain node.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In this embodiment, the package image and the prescription image of the drug to be checked refer to images acquired by shooting the drug to be checked and the prescription issued by the doctor by the user through the camera device, and it can be understood that the package image and the prescription image corresponding to the drug to be rechecked are obtained, so that the automatic recheck of the drug is realized based on the package image in the following.
In this embodiment, in order to improve the accuracy of the image detection algorithm in identifying the image material uploaded by the user, corresponding requirements can be made on the resolution, the image size, the image file specification and the like of the image material, an image specification standard corresponding to the medicine package image can be preset, after the user uploads the medicine package image and the prescription sheet image of the medicine to be detected, whether the uploaded image material meets the requirements or not is judged, if not, a secondary uploading prompt is returned, and the user terminal is notified to shoot and upload the image material again.
102. Identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information;
in this embodiment, the medicine package image and the prescription order image are character-recognized mainly by an optical character recognition ocr technique in an image detection algorithm to obtain information of the medicine to be detected and information of the prescription order medicine, where the information of the medicine to be detected mainly includes medicine name information, lot number, expiration date, usage description, and the like, and the information of the prescription order medicine mainly includes medicine name information, specification, dose, medication route, frequency, total amount, and the like.
In this embodiment, corresponding to the medicine package image, since the packages of different medicines are different, the areas where the medicine information of the medicine to be detected is located are also different, the character areas in the medicine package need to be determined through an image detection algorithm, and then the characters in the character areas are identified through an optical character identification ocr technology. For the prescription list image, since the text areas are all within the preset text area, the optical character recognition ocr technology can directly recognize the text areas.
103. Matching the first drug name information with at least one second drug name information;
in practical applications, a disease generally requires a plurality of drugs to be used simultaneously, and a prescription issued by a doctor after diagnosis of a patient generally contains a plurality of drugs, so that at least one prescription information or a plurality of information, namely at least one second drug name information, exists in an image of the prescription.
In this embodiment, the first medicine name information and the second medicine name information are directly matched, whether the characters are the same or not is judged, if the characters are the same, the medicine taken by the user is the same as the characters on the prescription, the rechecking is passed, and a more accurate medicine taking prompt report is given according to other information of the medicine to be detected and personal information of the patient, such as age, sex, comprehensive medicine property, pharmacology and other rear-end big data.
104. If the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code;
in this embodiment, the pictophonetic code is a Chinese character encoding method, and the encoding converts a Chinese character into an 11-bit letter-number sequence, and retains the pronunciation and font characteristics of the Chinese character to some extent. The method can well solve the problem that the medicine name identified by using the OCR may have wrongly written characters, missing characters or multiple characters.
In practical application, the whole phonetic-shape code is divided into two parts, wherein the first part is a phonetic code part and mainly covers the content of vowels, initials, complementary codes and tones; the second part is a character shape code which comprises a structure bit, a four-corner code, an attached code of the four-corner code and a stroke digit of the Chinese character.
In this embodiment, the chinese characters are converted into a series of character sequences by means of a mapping table, and for a word, each character of the word is converted into a phonetic type code, and then a phonetic type code list is formed. For example, the conversion of the word drug into a phonetic type code is [ '9I 442441279', 'H2032606609' ]. Calculating the similarity of the two character strings becomes calculating the similarity of the phonetic codes of the two character strings. For example, the character string corresponding to the word segmentation of ABC medicine s6 is ABC9I442441279H20326066096, and the sub-character strings included therein are "a", "B", "C", "9I 442441279", "H2032606609", "s", "6".
105. Calculating the editing distance between the first pictophonetic code and each second pictophonetic code, and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance;
in practical application, an editing distance algorithm, also called Levenshtein distance, represents the minimum editing times required for converting a character string into another character string, namely, replacing one character in the character string with another character or inserting a deleted character, the minimum editing times between a pair of character strings is calculated to be the core of the editing distance, the editing distance of two phonographic codes is calculated through the editing distance algorithm, and then the similarity of the two phonographic codes is determined, wherein the closer the editing distance is, the higher the similarity of the two phonographic codes is.
106. Judging whether the similarity greater than a preset similarity threshold exists or not;
107. if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal;
108. and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
In the embodiment, the reason that the precise matching by directly matching the medicine name and the fuzzy matching by converting the medicine name into the sound-shape code for re-matching are included is that the calculation resources are saved, and the reason that the two matching are performed instead of directly performing the fuzzy matching is that if the two matching are successful, more accurate medication prompt reports are given directly according to other information of the medicine to be detected and the personal information of the patient, such as age, sex, the medicine property of the comprehensive medicine, the pharmacology and other rear-end big data. If the two-time matching is unsuccessful, the fact that the medicine to be detected is not the medicine in the prescription list can be indirectly indicated, an early warning signal is generated and sent to the user terminal to remind the user that the medicine taken by the user is wrong, and serious medical accidents caused by the fact that the patient uses wrong medicines unknowingly are avoided.
In the embodiment, a medicine package image and a prescription image of a medicine to be detected uploaded by a user terminal are acquired; identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information; matching the first drug name information with at least one second drug name information; if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code; calculating the editing distance between the first phonographic code and the at least one second phonographic code, and calculating the similarity between the first phonographic code and the at least one second phonographic code according to the editing distance; judging whether the similarity greater than a preset similarity threshold exists or not; if the warning signal does not exist, generating a warning signal, and sending the warning signal to the user terminal; and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal. When the medicine name identified by the optical character recognition OCR cannot be matched with the prescription list, the medicine name and the medicine name in the prescription list are converted into the sound-shape codes for fuzzy matching, so that the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly-written characters in the character identification process is solved.
Referring to fig. 2, a second embodiment of the drug review method according to the embodiment of the present invention includes:
201. acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
202. detecting the edge of the medicine package image by adopting a canny edge detection operator to obtain an edge image of the medicine package image;
in practical application, generally, a medicine package is a medicine box, in this embodiment, first, a medicine package image needs to be detected and segmented, which mainly includes edge detection, contour extraction, and calculation of a medicine box center point and a medicine box rotation angle; the edge detection adopts a Canny operator to carry out primary edge detection on the medicine box through Gaussian filtering, gradient calculation, edge non-maximum inhibition, double-threshold edge point determination, edge point connection and edge point generation.
203. Carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image;
in this embodiment, contour extraction adopts Hough linear detection to obtain a rectangular contour of the medicine box, and finally, a center point of the medicine box and a rotation angle of the medicine box are calculated according to the obtained contour to obtain a regular medicine box pattern.
204. Carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area;
in this embodiment, it is ensured that a picture of a drug name with a correct angle can be obtained by rotating the picture of the drug box, the character position on the drug box is preliminarily extracted by performing corrosion expansion processing on the image, the extracted character region is inspected by using the MSER algorithm to specifically divide the character part, and the position of the drug name is determined by using the characteristics of the drug name.
205. Performing character recognition on the character area and the prescription order image through an Optical Character Recognition (OCR) technology to obtain to-be-detected medicine information and at least one prescription order medicine information, wherein the to-be-detected medicine information comprises first medicine name information, and the prescription order medicine information comprises second medicine name information;
in this embodiment, the character color recognition provides a pre-processing for binarization, if the character color is black, the binarization operation is directly performed, if the character color is white, the image is inverted and the binarization operation is performed, and the binarization algorithm adopts Otsu's method to distinguish the character from the character background; the method comprises the steps of segmenting a text by adopting a projection method to obtain a single character, identifying a character picture by adopting an optical character identification ocr technology to obtain information of the medicine to be detected, and directly identifying the region by adopting an optical character identification ocr technology for the prescription single image because the character region is in a preset character region.
206. Matching the first drug name information with at least one second drug name information;
207. if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code;
208. calculating the editing distance between the first pictophonetic code and each second pictophonetic code, and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance;
209. judging whether the similarity greater than a preset similarity threshold exists or not;
210. if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal;
211. and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
The embodiment describes in detail the process of identifying a drug package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a drug to be detected and information of at least one prescription order drug, and performs edge detection on the drug package image by using a canny edge detection operator to obtain an edge image of the drug package image; carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image; carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area; and performing character recognition on the character area and the prescription order image by an Optical Character Recognition (OCR) technology to obtain the information of the medicine to be detected and the information of at least one prescription order medicine. The embodiment can well identify the medicine name on the medicine package, the medicine name position is determined by applying corrosion expansion operation and MSER algorithm, the medicine name position is determined, the medicine name is determined by OCR identification, and the identification result is more accurate.
Referring to fig. 3, a third embodiment of the drug review method according to the embodiment of the present invention includes:
301. acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
302. identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information;
303. matching the first drug name information with at least one second drug name information;
304. if the matching fails, performing word segmentation processing on the first medicine name information and the second medicine name information respectively to obtain corresponding first medicine characters and second medicine characters;
305. acquiring a sound code mapping rule and a shape code mapping rule;
306. converting the first medicine character and the second medicine character through a sound code mapping rule to respectively obtain a corresponding first sound code and a corresponding second sound code, and converting the first medicine character and the second medicine character through a shape code mapping rule to respectively obtain a corresponding first shape code and a corresponding second shape code;
307. splicing the first phonon code and the first font code, and correspondingly splicing a second phonon code corresponding to a second medicine character and a corresponding second font code to obtain a corresponding first font code and at least one second font code;
in this embodiment, after completing the word segmentation of the first medicine name information and the second medicine name information, the chinese character in each word segmentation is converted into the pictophonetic code, and the non-chinese character in each word segmentation does not perform the pictophonetic code conversion but retains the original character. Through the conversion process, each participle is converted into a character string which does not contain Chinese characters.
In this embodiment, the phono-graphic code includes 12 bits: 2-bit initial consonant, 2-bit vowel, 5-bit four-corner coding, 1-bit structure code and 2-bit stroke number. The mapping rule of the shape code comprises: the mapping rules of Chinese characters to pinyin, strokes, structures and four-corner codes comprise the mapping rules of initials, finals and structures to numerical codes. As shown in table 1 below, table 1 below is a mapping rule from an initial consonant and a vowel to a numeric code:
TABLE 1
a 01 ai 07 ie 13 un 19
o 02 ei 08 ve 14 vn 20
e 03 ui 09 er 15 ang 21
i 04 ao 10 an 16 eng 22
u 05 ou 11 en 17 ing 23
v 06 iu 12 in 18 ong 24
In this embodiment, the chinese characters are converted into a series of character sequences by means of a mapping table, and for a word, each character of the word is converted into a phonetic type code, and then a phonetic type code list is formed. For example, the conversion of the word drug into a phonetic type code is [ '9I 442441279', 'H2032606609' ]. Calculating the similarity of the two character strings becomes calculating the similarity of the phonetic codes of the two character strings. For example, the character string corresponding to the word segmentation of ABC medicine s6 is ABC9I442441279H20326066096, and the sub-character strings included therein are "a", "B", "C", "9I 442441279", "H2032606609", "s", "6".
308. Calculating the editing distance between the first phonographic codes and each second phonographic code;
309. constructing a corresponding editing distance matrix according to the editing distance;
310. taking the value of the lowest right corner in the editing distance matrix as the corresponding shortest editing distance;
311. calculating the similarity between the first phonographic code and the corresponding second phonographic code according to a preset similarity formula and the shortest editing distance;
in the embodiment, based on the sound-shape code mapping rule of a single Chinese character, the first medicine name information a and the second medicine name information b are respectively mapped to obtain a first sound-shape code ssca: { ssc1, ssc 2.. sscp } and a second sound-shape code sscb: { ssc1, ssc 2.. sscq }, wherein p and q respectively represent the number of Chinese characters a and b; and taking a, b, ssca, sscb and n as the input of an edit distance algorithm, constructing an edit distance matrix to obtain an edit distance d between a and b, and calculating the similarity of the two phono configurational codes through a similarity formula.
312. Judging whether the similarity greater than a preset similarity threshold exists or not;
313. if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal;
314. and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
The embodiment describes the process of fuzzy matching through the sound-shape code form in detail on the basis of the previous embodiment, and obtains corresponding medicine characters respectively by inputting the face image in the first image frame into the face image quality evaluation model and by performing word segmentation processing on the first medicine name information and the second medicine name information respectively; acquiring a sound code mapping rule and a shape code mapping rule, and converting the medicine characters into corresponding sound codes and shape codes through the sound code mapping rule and the shape code mapping rule; and splicing the sound codes and the shape codes to obtain corresponding first sound-shape codes and at least one second sound-shape code, and calculating the similarity of the names of the medicines by calculating the editing distance between the sound-shape codes. In the embodiment, the multi-branch task evaluation is performed through the image quality evaluation model, and comprehensive scoring is performed after various scoring values are obtained, so that the evaluation precision can be improved. In the embodiment, the medicine names and the medicine names in the prescription list are converted into the sound-shape codes for fuzzy matching, so that the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly-written characters in the character recognition process is solved.
Referring to fig. 4, a fourth embodiment of the drug-taking rechecking method according to the embodiment of the present invention includes:
401. acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
402. identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information;
403. matching the first drug name information with at least one second drug name information;
404. if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code;
405. calculating the editing distance between the first pictophonetic code and each second pictophonetic code, and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance;
406. judging whether the similarity greater than a preset similarity threshold exists or not;
407. if the similarity larger than the preset similarity threshold does not exist, acquiring the drug names of the local platform drug library, and performing de-duplication processing and index reconstruction processing on the acquired drug names to obtain a drug name set;
408. converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set;
409. matching the first sound-shape code and the second sound-shape code with each third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape codes matched with the first sound-shape code and the second sound-shape code are the same medicine or not;
410. if the medicines are not the same, generating a first early warning signal, and sending the first early warning signal to the user terminal;
in this embodiment, since the names of the drugs may be multiple, and the names of the drugs corresponding to the first pictophonetic code and the second pictophonetic code are not the common names of the drugs, but may be the same drug, after performing two times of compliance verification, the first pictophonetic code and the second pictophonetic code may be matched with the third pictophonetic code in the third pictophonetic code set by the names of the drugs in the local platform drug library, and the different names of the drugs are stored in the local platform drug library and assigned to one type, and by determining whether the third pictophonetic code matched with the first pictophonetic code and the second pictophonetic code is the same type, it is determined whether the drug to be detected is the same as the prescription single drug, and by precise matching and two times of fuzzy matching, the accuracy of rechecking detection is improved.
411. If the same medicine is successfully matched or the similarity greater than the preset similarity threshold exists, carrying out weight detection on the medicine to be detected to obtain weight information of the medicine to be detected, and calculating the actual purchase quantity of the medicine to be detected according to the weight information;
412. judging whether the actual purchase amount is abnormal or not according to the theoretical use amount;
in this embodiment, after the precise matching and the fuzzy matching of the drug to be detected are successful, the weight of the drug to be detected can be detected, and the drug information including the unit weight of the drug can be obtained according to the matching result, so as to infer the actual purchase amount of the drug to be detected; meanwhile, instruction information of the drug to be detected can be obtained, and the theoretical usage amount of the insurance premium drug can be calculated according to the instruction information, for example, the instruction information includes a treatment course usage amount (box/count) and a treatment course duration (month), the theoretical usage amount of a preset period (for example, 1 year) can be calculated according to the treatment course usage amount and the treatment course duration, for example, in the instruction information of trastuzumab for injection (herceptin, an injection for treating metastatic breast cancer overexpressed by HER 2), 1 dosage of each treatment course, 1 month of each treatment course, and 12 months of 1 year, the theoretical usage amount of trastuzumab for injection is the theoretical usage amount which is 12 dosage of treatment course ═ 12/treatment course duration ═ 12 (counts). Then, comparing the theoretical usage amount with the actual purchase amount, judging whether the actual purchase amount is abnormal according to the theoretical usage amount, and if the actual purchase amount is not larger than the theoretical usage amount (or the actual purchase amount is not larger than a preset multiple of the theoretical usage amount), considering that the actual purchase amount is normal; if the actual purchase amount is greater than the theoretical usage amount (or the actual purchase amount is greater than a predetermined multiple of the theoretical usage amount), the actual purchase amount may be considered to be abnormal.
413. If so, generating a second early warning signal and sending the second early warning signal to the user terminal;
in this embodiment, when the actual purchase amount is determined to be abnormal, a second warning signal may be generated so as to be distinguished from the first warning signal, when the user terminal receives the first warning signal, it indicates that the type of the medicine is abnormal, and when the user receives the second warning signal, it indicates that the purchase amount of the medicine is abnormal.
414. And if not, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
On the basis of the previous embodiment, the method is additionally provided with a process of further fuzzy matching by taking a local platform drug library as a middle matching path, and a drug name set is obtained by obtaining the drug names of the local platform drug library, and performing duplication removing processing and index reconstruction processing; converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set; and matching the first sound-shape code and the second sound-shape code with a third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape code matched with the first sound-shape code and the second sound-shape code is the same medicine or not. Further fuzzy matching is carried out based on the local platform medicine library, and the problem of low rechecking accuracy caused by various medicine names or missing characters, missing characters or wrongly written characters in the character recognition process can be solved.
Referring to fig. 5, a fifth embodiment of the drug review method according to the present invention includes:
501. acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
502. identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information;
503. matching the first drug name information with at least one second drug name information;
504. if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code;
505. calculating the editing distance between the first pictophonetic code and each second pictophonetic code, and calculating the similarity between the first pictophonetic code and each second pictophonetic code according to the editing distance;
506. judging whether the similarity greater than a preset similarity threshold exists or not;
507. if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal;
508. if the matching is successful or the similarity greater than the preset similarity threshold exists, acquiring a medication report template, wherein the medication report template comprises a medication report main body and a placeholder arranged at a preset position in the medication report main body;
509. determining the information type of the drug information to be checked, and corresponding the drug information to be checked with the placeholder according to the corresponding relation between the preset information type and the placeholder;
in this embodiment, the information type of the medicine information includes, for example, age, sex, drug property of the integrated medicine, big data at the back end of pharmacology, and the medicine information represents the information type through the tag, and the tag corresponds to and replaces the corresponding placeholder type, so that the medicine information can be filled in the medication template to generate the medication report.
510. Replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report;
511. and sending the medication report to the user terminal.
The embodiment describes in detail a process of generating a medication report according to information of a to-be-detected drug and sending the medication report to the user terminal on the basis of the previous embodiment, and obtains a medication report template, wherein the medication report template includes a medication report main body and a placeholder arranged at a preset position in the medication report main body; determining the information type of the drug information to be checked, and corresponding the drug information to be checked to the placeholder according to the corresponding relation between the preset information type and the placeholder; replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report; and sending the medication report to the user terminal. The method generates the medication report in the manner of the placeholder, can improve the generation efficiency of the medication report, and improves the user experience.
With reference to fig. 6, the method for drug rehabilitation in the embodiment of the present invention is described above, and a drug rehabilitation device in the embodiment of the present invention is described below, where an embodiment of the device for drug rehabilitation in the embodiment of the present invention includes:
the acquiring module 601 is used for acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
the identification module 602 is configured to identify the medicine package image and the prescription order image through a preset image detection algorithm, and obtain information of a medicine to be detected and at least one prescription order medicine respectively, where the information of the medicine to be detected includes first medicine name information, and the prescription order medicine information includes second medicine name information;
a matching module 603, configured to match the first drug name information with at least one second drug name information;
a conversion module 604, configured to, when matching fails, convert the first medicine name information and the second medicine name information into a form of a phono-configurational code, respectively, to obtain a first phono-configurational code and at least one second phono-configurational code;
a calculating module 605, configured to calculate an editing distance between the first pictophonetic code and each of the second pictophonetic codes, and calculate a similarity between the first pictophonetic code and each of the second pictophonetic codes according to the editing distance;
a determining module 606, configured to determine whether a similarity greater than a preset similarity threshold exists;
the early warning module 607 is configured to generate a first early warning signal when there is no similarity greater than a preset similarity threshold, and send the first early warning signal to the user terminal;
and the medication report module 608 is configured to, when matching is successful or a similarity greater than a preset similarity threshold exists, generate a medication report according to the information of the to-be-detected drug, and send the medication report to the user terminal.
It is emphasized that the surveillance video may be stored in a node of a blockchain in order to ensure privacy and security of the data.
In the embodiment of the invention, the medicine rechecking device runs the medicine rechecking method, and acquires the medicine package image and the prescription image of the medicine to be detected uploaded by the user terminal; identifying a medicine package image and a prescription order image through a preset image detection algorithm to respectively obtain information of a medicine to be detected and at least one prescription order medicine, wherein the information of the medicine to be detected comprises first medicine name information, and the information of the prescription order medicine comprises second medicine name information; matching the first drug name information with at least one second drug name information; if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes to obtain a first sound-shape code and at least one second sound-shape code; calculating the editing distance between the first phonographic code and the at least one second phonographic code, and calculating the similarity between the first phonographic code and the at least one second phonographic code according to the editing distance; judging whether the similarity greater than a preset similarity threshold exists or not; if the first warning signal does not exist, generating a first warning signal, and sending the first warning signal to the user terminal; and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal. When the medicine name identified by the optical character recognition OCR cannot be matched with the prescription list, the medicine name and the medicine name in the prescription list are converted into the sound-shape codes for fuzzy matching, so that the problem of low rechecking accuracy caused by various medicine names or missing, missing or wrongly-written characters in the character identification process is solved.
Referring to fig. 7, a second embodiment of the apparatus for drug review according to the present invention comprises:
the acquiring module 601 is used for acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
the identification module 602 is configured to identify the medicine package image and the prescription order image through a preset image detection algorithm, and obtain information of a medicine to be detected and at least one prescription order medicine respectively, where the information of the medicine to be detected includes first medicine name information, and the prescription order medicine information includes second medicine name information;
a matching module 603, configured to match the first drug name information with at least one second drug name information;
a conversion module 604, configured to, when matching fails, convert the first medicine name information and the second medicine name information into a form of a phono-configurational code, respectively, to obtain a first phono-configurational code and at least one second phono-configurational code;
a calculating module 605, configured to calculate an editing distance between the first pictophonetic code and each of the second pictophonetic codes, and calculate a similarity between the first pictophonetic code and each of the second pictophonetic codes according to the editing distance;
a determining module 606, configured to determine whether a similarity greater than a preset similarity threshold exists;
the early warning module 607 is configured to generate a first early warning signal when there is no similarity greater than a preset similarity threshold, and send the first early warning signal to the user terminal;
and the medication report module 608 is configured to, when matching is successful or a similarity greater than a preset similarity threshold exists, generate a medication report according to the information of the to-be-detected drug, and send the medication report to the user terminal.
Optionally, the identification module 602 is specifically configured to: detecting the edge of the medicine package image by adopting a canny edge detection operator to obtain an edge image of the medicine package image; carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image; carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area; and performing character recognition on the character area and the prescription order image through an Optical Character Recognition (OCR) technology to obtain the medicine information to be detected and at least one prescription order medicine information.
Optionally, the conversion module 604 is specifically configured to: performing word segmentation processing on the first medicine name information and the second medicine name information respectively to obtain corresponding first medicine characters and second medicine characters; acquiring a sound code mapping rule and a shape code mapping rule; converting the first medicine character and the second medicine character through the sound code mapping rule to respectively obtain a corresponding first sound code and a corresponding second sound code, and converting the first medicine character and the second medicine character through the shape code mapping rule to respectively obtain a corresponding first shape code and a corresponding second shape code; and splicing the first phonon code and the first shape code, and correspondingly splicing a second phonon code corresponding to the second medicine character and a corresponding second shape code to obtain a corresponding first phonon-shape code and at least one second phonon-shape code.
Optionally, the calculating module 605 is specifically configured to: calculating the editing distance between the first phonographic code and each second phonographic code; constructing a corresponding editing distance matrix according to the editing distance; taking the value of the lowest right corner in the edit distance matrix as the corresponding shortest edit distance; and calculating the similarity between the first sound-shape code and the corresponding second sound-shape code according to a preset similarity formula and the shortest editing distance.
The medication rechecking device further includes a second matching module 609, where the second matching module 609 specifically includes: acquiring the drug names of a local platform drug library, and performing de-duplication processing and index reconstruction processing on the acquired drug names to obtain a drug name set; converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set; matching the first sound-shape code and the second sound-shape code with each third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape codes matched with the first sound-shape code and the second sound-shape code respectively are the same medicine or not; if so, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal; and if not, generating a first early warning signal and sending the first early warning signal to the user terminal.
Wherein the prescription single drug information comprises theoretical usage amount; the medication rechecking device further comprises a weighing module 610, wherein the weighing module 610 is specifically used for: carrying out weight detection on the medicine to be detected to obtain weight information of the medicine to be detected, and calculating the actual purchase quantity of the medicine to be detected according to the weight information; judging whether the actual purchase amount is abnormal or not according to the theoretical usage amount; and if so, generating a second early warning signal and sending the second early warning signal to the user terminal.
Optionally, the medication administration reporting module 608 is specifically configured to: acquiring a medication report template, wherein the medication report template comprises a medication report main body and a placeholder arranged at a preset position in the medication report main body; determining the information type of the drug information to be checked, and corresponding the drug information to be checked to the placeholder according to the corresponding relation between the preset information type and the placeholder; replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report; and sending the medication report to the user terminal.
On the basis of the previous embodiment, the specific functions of each module and the unit composition of part of the modules are described in detail, through a model generated by the newly added module and a feature extraction network, when the name of a medicine identified by optical character recognition OCR cannot be matched with a prescription, fuzzy matching is performed by converting the name of the medicine and the name of the medicine in the prescription into a sound-shape code, so that the problem of low rechecking accuracy caused by various names of the medicine or missing, missing or wrongly written characters in the character identification process is solved, meanwhile, the medicine is weighed, whether the quantity of the medicine taken by a user is abnormal or not is judged, and the medicine taken by the user is further rechecked.
Fig. 6 and 7 describe the traditional Chinese medicine re-check device in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the medicine re-check device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 8 is a schematic structural diagram of a drug administration device according to an embodiment of the present invention, where the drug administration device 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing an application 833 or data 832. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the medication review device 800. Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the drug administration check device 800 to implement the steps of the drug administration check method described above.
Drug rehabilitation device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the illustrated configuration of the drug rehabilitation device of fig. 8 is not intended to be limiting of the drug rehabilitation devices provided herein, and may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the medication re-check method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for drug rehabilitation, comprising:
acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
identifying the medicine package image and the prescription order image through a preset image detection algorithm to respectively obtain to-be-detected medicine information and at least one prescription order medicine information, wherein the to-be-detected medicine information comprises first medicine name information, and the prescription order medicine information comprises second medicine name information;
matching the first drug name information with at least one second drug name information;
if the matching fails, the first medicine name information and the second medicine name information are respectively converted into the form of the sound-shape codes, and a first sound-shape code and at least one second sound-shape code are obtained;
calculating the editing distance between the first phonographic codes and each second phonographic code, and calculating the similarity between the first phonographic codes and each second phonographic code according to the editing distance;
judging whether the similarity greater than a preset similarity threshold exists or not;
if the similarity which is larger than a preset similarity threshold does not exist, generating a first early warning signal, and sending the first early warning signal to the user terminal;
and if the matching is successful or the similarity greater than the preset similarity threshold exists, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal.
2. The medication rechecking method of claim 1, wherein the identifying the drug package image and the prescription order image through a preset image detection algorithm to obtain the information of the drug to be detected and the information of at least one prescription order drug respectively comprises:
carrying out edge detection on the medicine package image by adopting a canny edge detection operator to obtain an edge image of the medicine package image;
carrying out linear detection on the edge image through a Hough linear detection algorithm to obtain a medicine box rectangular frame of the medicine package image;
carrying out corrosion expansion treatment on the rectangular frame of the medicine box to obtain a character area;
and performing character recognition on the character area and the prescription order image through an Optical Character Recognition (OCR) technology to obtain the medicine information to be detected and at least one prescription order medicine information.
3. The medication rechecking method of claim 1, wherein the converting the first medicine name information and the second medicine name information into a form of a phonographic code, respectively, to obtain a first phonographic code and at least one second phonographic code comprises:
performing word segmentation processing on the first medicine name information and the second medicine name information respectively to obtain corresponding first medicine characters and second medicine characters;
acquiring a sound code mapping rule and a shape code mapping rule;
converting the first medicine character and the second medicine character through the sound code mapping rule to respectively obtain a corresponding first sound code and a corresponding second sound code, and converting the first medicine character and the second medicine character through the shape code mapping rule to respectively obtain a corresponding first shape code and a corresponding second shape code;
and splicing the first phonon code and the first shape code, and correspondingly splicing a second phonon code corresponding to the second medicine character and a corresponding second shape code to obtain a corresponding first phonon-shape code and at least one second phonon-shape code.
4. The method for drug rehabilitation according to claim 3, wherein the calculating of the edit distance between the first phonographic code and each of the second phonographic codes and the calculating of the similarity between the first phonographic code and all the second phonographic codes according to the edit distance comprises:
calculating the editing distance between the first phonographic code and each second phonographic code;
constructing a corresponding editing distance matrix according to the editing distance;
taking the value of the lowest right corner in the edit distance matrix as the corresponding shortest edit distance;
and calculating the similarity between the first sound-shape code and the corresponding second sound-shape code according to a preset similarity formula and the shortest editing distance.
5. The method for drug review as claimed in any one of claims 1-4, further comprising, after the absence of a similarity greater than a predetermined similarity threshold:
acquiring the drug names of a local platform drug library, and performing de-duplication processing and index reconstruction processing on the acquired drug names to obtain a drug name set;
converting the medicine names in the medicine name set into a sound-shape code form to obtain a third sound-shape code set;
matching the first sound-shape code and the second sound-shape code with each third sound-shape code in a third sound-shape code set respectively, and judging whether the third sound-shape codes matched with the first sound-shape code and the second sound-shape code respectively are the same medicine or not;
if so, generating a medication report according to the information of the medicine to be detected, and sending the medication report to the user terminal;
and if not, generating a first early warning signal and sending the first early warning signal to the user terminal.
6. The medication review method of claim 5, wherein the prescription order information further includes a theoretical usage amount;
after the matching is successful or the similarity greater than the preset similarity threshold exists, the method further includes:
carrying out weight detection on the medicine to be detected to obtain weight information of the medicine to be detected, and calculating the actual purchase quantity of the medicine to be detected according to the weight information;
judging whether the actual purchase amount is abnormal or not according to the theoretical usage amount;
and if so, generating a second early warning signal and sending the second early warning signal to the user terminal.
7. The medication rechecking method according to claim 5, wherein the generating a medication report according to the information of the drug to be detected and sending the medication report to the user terminal comprises:
acquiring a medication report template, wherein the medication report template comprises a medication report main body and a placeholder arranged at a preset position in the medication report main body;
determining the information type of the drug information to be checked, and corresponding the drug information to be checked to the placeholder according to the corresponding relation between the preset information type and the placeholder;
replacing placeholders in the medication report template with corresponding information of the medicine to be detected to generate a medication report;
and sending the medication report to the user terminal.
8. A medication rechecking device, comprising:
the acquisition module is used for acquiring a medicine package image and a prescription image of a medicine to be detected, which are uploaded by a user terminal;
the identification module is used for identifying the medicine package image and the prescription order image through a preset image detection algorithm to respectively obtain medicine information to be detected and at least one prescription order medicine information, wherein the medicine information to be detected comprises first medicine name information, and the prescription order medicine information comprises second medicine name information;
the matching module is used for matching the first medicine name information with at least one piece of second medicine name information;
the conversion module is used for respectively converting the first medicine name information and the second medicine name information into a form of a sound-shape code when matching fails, so as to obtain a first sound-shape code and at least one second sound-shape code;
the calculation module is used for calculating the editing distance between the first sound-shape codes and each second sound-shape code and calculating the similarity between the first sound-shape codes and all the second sound-shape codes according to the editing distance;
the judging module is used for judging whether the similarity greater than a preset similarity threshold exists or not;
the early warning module is used for generating a first early warning signal when the similarity larger than a preset similarity threshold does not exist, and sending the first early warning signal to the user terminal;
and the medication report module is used for generating a medication report according to the information of the medicine to be detected when the matching is successful or the similarity greater than the preset similarity threshold exists, and sending the medication report to the user terminal.
9. A medication rechecking apparatus, characterized by comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the medication re-check device to perform the steps of the medication re-check method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for drug re-check according to any one of claims 1-7.
CN202111015493.2A 2021-08-31 2021-08-31 Drug use rechecking method, device, equipment and storage medium Pending CN113642563A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111015493.2A CN113642563A (en) 2021-08-31 2021-08-31 Drug use rechecking method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111015493.2A CN113642563A (en) 2021-08-31 2021-08-31 Drug use rechecking method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113642563A true CN113642563A (en) 2021-11-12

Family

ID=78424664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111015493.2A Pending CN113642563A (en) 2021-08-31 2021-08-31 Drug use rechecking method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113642563A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272941A (en) * 2023-09-21 2023-12-22 北京百度网讯科技有限公司 Data processing method, apparatus, device, computer readable storage medium and product
CN117422360A (en) * 2023-12-19 2024-01-19 深圳市普拉托科技有限公司 Inventory method, device, equipment and storage medium of intelligent tray

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117272941A (en) * 2023-09-21 2023-12-22 北京百度网讯科技有限公司 Data processing method, apparatus, device, computer readable storage medium and product
CN117422360A (en) * 2023-12-19 2024-01-19 深圳市普拉托科技有限公司 Inventory method, device, equipment and storage medium of intelligent tray

Similar Documents

Publication Publication Date Title
US11568970B2 (en) Medical picture archive integration system and methods for use therewith
CN107016438B (en) System based on traditional Chinese medicine syndrome differentiation artificial neural network algorithm model
CN110910976A (en) Medical record detection method, device, equipment and storage medium
Wang et al. An automatic knee osteoarthritis diagnosis method based on deep learning: data from the osteoarthritis initiative
CN113642563A (en) Drug use rechecking method, device, equipment and storage medium
CN114026651A (en) Automatic generation of structured patient data records
Tan et al. Comparison of yolo v3, faster r-cnn, and ssd for real-time pill identification
CN111221979B (en) Medicine knowledge graph construction method and system
CN104951502B (en) Person's handwriting identification facility
EP3596620A1 (en) Interoperable record matching process
CN114912887B (en) Clinical data input method and device based on electronic medical record
CN111191415A (en) Operation classification coding method based on original operation data
CN111985241A (en) Medical information query method, device, electronic equipment and medium
CN111933237A (en) Chronic disease processing method and device and related equipment
CN114550870A (en) Prescription auditing method, device, equipment and medium based on artificial intelligence
CN113782125A (en) Clinic scoring method and device based on artificial intelligence, electronic equipment and medium
CN113724830B (en) Medication risk detection method based on artificial intelligence and related equipment
CN111477289A (en) Method and device for storing and reading detection report
CN113948190A (en) Method and equipment for automatically identifying X-ray skull positive position film cephalogram measurement mark points
CN112861535B (en) Surgical classification coding method and system based on diagnosis and treatment data
CN115083561A (en) Medication education pushing method and system based on patient actual demand as guidance
CN116092698A (en) Prescription auditing method, device, system and storage medium
CN113270201A (en) Medical information data verification method and system and computer readable storage medium
US20150339441A1 (en) Systems and methods for attaching electronic versions of paper documents to associated patient records in electronic health records
CN117012399A (en) Traditional Chinese medicine menstrual tube management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220525

Address after: 518000 China Aviation Center 2901, No. 1018, Huafu Road, Huahang community, Huaqiang North Street, Futian District, Shenzhen, Guangdong Province

Applicant after: Shenzhen Ping An medical and Health Technology Service Co.,Ltd.

Address before: Room 12G, Area H, 666 Beijing East Road, Huangpu District, Shanghai 200001

Applicant before: PING AN MEDICAL AND HEALTHCARE MANAGEMENT Co.,Ltd.