当前位置:网站首页>Read PDF Text and write excel operation
Read PDF Text and write excel operation
2022-06-28 09:54:00 【Pert-】
import pdfplumber
import fitz
from PIL import Image
from aip import AipOcr
import re
import threading
import xlwt
import numpy as np
import pandas as pd
## extract pdf The text of the document is written into the physical examination report .txt in
# pdf_name='pdf/ Xiaoshi General Manager - Aikang report -20220614.pdf'
# f=open(' Medical Examination Report .txt','w',encoding="utf-8")
# pdf=pdfplumber.open(pdf_name)
# page_count = len(pdf.pages)
# print(page_count) # Get pages
# extra_list=[22,23,25,34,35]
# need_imglist=[x for x in range(8,21)]
# need_imglist.extend(extra_list)
# for index,page in enumerate(pdf.pages):
# # print('---------- The first [%d] page ----------' % page.page_number)
# # # Get all text information of the current page , Include text in table
# if index in need_imglist:
# f.write(str(page.extract_text()))
# # print(page.extract_text())
# f.close()
# pdf.close()
f=open(' Medical Examination Report .txt','r',encoding='utf-8')
content=''.join(f.readlines())
f.close()
### General inspection
a={}
### height
a[' height ']=re.findall('⾝⾼\s+([0-9,.]+)',content)[0]
## weight
a[' weight ']=re.findall(' weight \s+([0-9,.]+)',content)[0]
# ### Body mass index
a[' Body mass index ']=re.findall(' Body mass index \s+([0-9,.]+)',content)[0]
# ### systolic pressure
a[' systolic pressure ']=re.findall(' systolic pressure \s+([0-9,.]+)',content)[0]
# ### diastolic pressure
a[' diastolic pressure ']=re.findall(' diastolic pressure \s+([0-9,.]+)',content)[0]
print(a)
print('\n')
# ### internal medicine
b={}
### medical history
b[' medical history ']=re.findall(' medical history (.*)\n family history ',content)[0]
### family history
b[' family history ']=re.findall(' family history (.*)',content)[0]
# ### heart rate
b[' heart rate ']=re.findall('⼼ rate \s+(\d+)',content)[0]
# ###⼼ Law
b['⼼ Law ']=re.findall('⼼ Law \s+(.*)',content)[0]
### heart sounds
b[' heart sounds ']=re.findall('⼼⾳\s+(.*)',content)[0]
### Auscultation of the lungs
b[' Auscultation of the lungs ']=re.findall(' Auscultation of the lungs \s+(.*)',content)[0]
### Palpation of the liver
b[' Palpation of the liver ']=re.findall(' Palpation of the liver \s+(.*)',content)[0]
### Palpation of spleen
b[' Palpation of spleen ']=re.findall(' Palpation of spleen \s+(.*)',content)[0]
### Renal percussion
b[' Renal percussion ']=re.findall(' Renal percussion \s+(.*)',content)[0]
### Internal medicine others
b[' Internal medicine others ']=re.findall(' Internal medicine others \s+(.*)',content)[0]
### Preliminary idea ⻅
b[' Preliminary idea ⻅']=''.join(re.findall(' Internal medicine others .+?\n(.+) Preliminary idea ⻅\s+(.+?) Surgery ',content,re.S)[0])
print(b)
print('\n')
### Surgery
c={}
### The skin
c[' The skin ']=re.findall('⽪ skin (.*)',content)[0]
### Superficial lymph nodes
c[' Superficial lymph nodes ']=re.findall(' Superficial lymph nodes (.*)',content)[0]
# ### thyroid ( Surgery )
c[' thyroid ( Surgery )']=re.findall(' thyroid \( Surgery \)(.*)',content)[0]
# ### Spine
c[' Spine ']=re.findall(' Spine (.*)',content)[0]
# ### The joints of the limbs
c[' The joints of the limbs ']=re.findall(' The joints of the limbs (.*)',content)[0]
# ### Surgery, others
c[' Surgery, others ']=re.findall(' Surgery, others (.*)',content)[0]
### Preliminary comments
c[' Preliminary comments ']=re.findall(' Preliminary idea ⻅(.*)\n Department of gynaecology ',content)[0]
print(c)
print('\n')
d={}
### History of surgery
d['⼿ Art History ']=re.findall(' Company \n⼿ Art History (.*)',content)[0]
### vulva
d[' vulva ']=re.findall(' vulva (.*)',content)[0]
### Vagina
d[' Vagina ']=re.findall(' Vagina (.*)',content)[0]
### Cervical
d[' Cervical ']=re.findall(' Cervical (.*)',content)[0]
### uterus
d[' uterus ']=re.findall('⼦ The Palace (.*)\n The attachment ',content)[0]
### The attachment
d[' The attachment ']=re.findall(' The attachment (.*)\n Other gynecological ',content)[0]
### Other gynecological
d[' Other gynecological ']=re.findall(' Other gynecological (.*)',content)[0]
### Preliminary comments
d[' Preliminary comments ']=''.join(re.findall(' Other gynecological (.*?) Preliminary idea ⻅(.*?) Ophthalmology Department ',content,re.S)[0]).replace('⽆ \n','')
print(d)
print('\n')
e={}
### External eye
e[' External eye ']=re.findall(' External eye (.*)',content)[0]
### Ophthalmology others
e[' Ophthalmology others ']=re.findall(' Ophthalmology others (.*)',content)[0]
### Slit lamp inspection
e[' Slit lamp inspection ']=re.findall(' Slit lamp inspection (.*)',content)[0]
### Ophthalmoscopy
e[' Ophthalmoscopy ']=re.findall(' Ophthalmoscopy (.*)',content)[0]
### Non contact intraocular pressure in the left eye
e[' Non contact intraocular pressure in the left eye ']=re.findall(' Right eye ⾮ Contact intraocular pressure \s+(\d+)',content)[0]
### Non contact intraocular pressure in the right eye
e[' Non contact intraocular pressure in the right eye ']=re.findall(' The left eye ⾮ Contact intraocular pressure \s+(\d+)',content)[0]
### Preliminary comments
e[' Preliminary comments ']=re.findall(' Preliminary idea ⻅(.*)\n⽿ Department of rhinolaryngology ',content)[0]
print(e)
print('\n')
f={}
### Past history
f[' Past history ']=re.findall(' Past history (.*)',content)[0]
### External ear
f[' External ear ']=re.findall(' Outside ⽿(.*)',content)[0]
### External auditory canal
f[' External auditory canal ']=re.findall(' Outside ⽿ Avenue (.*)',content)[0]
### Tympanic membrane
f[' Tympanic membrane ']=re.findall('⿎ membrane (.*)',content)[0]
### nasal cavity
f[' nasal cavity ']=re.findall(' nasal cavity (.*)',content)[0]
### Nasal septum
f[' Nasal septum ']=re.findall(' Nasal septum (.*)',content)[0]
### pharynx
f[' pharynx ']=re.findall(' pharynx (.*)\n tonsil ',content)[0]
### tonsil
f[' tonsil ']=re.findall(' tonsil (.*)',content)[0]
### Otorhinolaryngology and others
f[' Otorhinolaryngology and others ']=re.findall('⽿ Nasopharynx department other (.*)',content)[0]
### Preliminary comments
f[' Preliminary comments ']=re.findall(' Preliminary idea ⻅(.*)\n⾎ routine ',content)[0]
print(f)
print('\n')
g={}
### White blood cell count
g[' White blood cell count ']=re.findall(' Cell count WBC ([\d,.]+)',content)[0]
# ### Red blood cell count
g[' Red blood cell count ']=re.findall(' Red blood cell count RBC ([\d,.]+)',content)[0]
### Hemoglobin
g[' Hemoglobin ']=re.findall('⾎ Red egg ⽩ Hb ([\d,.]+)',content)[0]
# ### Hematocrit
g[' Hematocrit ']=re.findall(' Hematocrit HCT ([\d,.]+)',content)[0]
# ### Mean corpuscular volume
g[' Mean corpuscular volume ']=re.findall(' Mean corpuscular volume MCV ([\d,.]+)',content)[0]
# ### Mean corpuscular hemoglobin content
g[' Mean corpuscular hemoglobin content ']=re.findall(' Mean red blood cells ⾎ Red egg ⽩ content MCH ([\d,.]+)',content)[0]
# ### Mean corpuscular hemoglobin concentration
g[' Mean corpuscular hemoglobin concentration ']=re.findall(' Mean red blood cells ⾎ Red egg ⽩ concentration MCHC ([\d,.]+)',content)[0]
# ### Coefficient of variation of red blood cell distribution width
g[' Coefficient of variation of red blood cell distribution width ']=re.findall(' Red blood cell distribution width - Coefficient of variation RDW-CV ([\d,.]+)',content)[0]
# ### Platelet count
g[' Platelet count ']=re.findall('⾎⼩ Plate count PLT ([\d,.]+)',content)[0]
# ### Mean platelet volume
g[' Mean platelet volume ']=re.findall(' Average ⾎⼩ Plate volume MPV ([\d,.]+)',content)[0]
# ### Platelet distribution width
g[' Platelet distribution width ']=re.findall('⾎⼩ Plate distribution width PDW ([\d,.]+)',content)[0]
# ### Percentage of lymphocytes
g[' Percentage of lymphocytes ']=re.findall(' Percentage of lymphocytes ⽐ LYMPH% ([\d,.]+)',content)[0]
# ### Percentage of neutrophils
g[' Percentage of neutrophils ']=re.findall(' Neutrophil percentage ⽐ NEUT% ([\d,.]+)',content)[0]
### Absolute value of lymphocyte
g[' Absolute value of lymphocyte ']=re.findall(' Absolute value of lymphocyte LYMPH ([\d,.]+)',content)[0]
### Absolute neutrophil count
g[' Absolute neutrophil count ']=re.findall(' Absolute neutrophil count NEUT ([\d,.]+)',content)[0]
### Standard deviation of red blood cell distribution width
g[' Standard deviation of red blood cell distribution width ']=re.findall(' Red blood cell distribution width - Standard deviation RDW-SD ([\d,.]+)',content)[0]
### Hematocrit
g[' Hematocrit ']=re.findall('⾎⼩ Plate accretion PCT ([\d,.]+)',content)[0]
### Percentage of monocytes
g[' Percentage of monocytes ']=re.findall('MONO% ([\d,.]+)',content)[0]
### The absolute value of monocytes
g[' The absolute value of monocytes ']=re.findall(' The absolute value of monocytes MONO ([\d,.]+)',content)[0]
### Percentage of eosinophils
g[' Percentage of eosinophils ']=re.findall(' Percentage of eosinophils ⽐ EOS% ([\d,.]+)',content)[0]
### Eosinophil absolute value
g[' Eosinophil absolute value ']=re.findall(' Eosinophil absolute value EOS ([\d,.]+)',content)[0]
### Basophil percentage
g[' Basophil percentage ']=re.findall(' Basophil percentage ⽐ BASO% ([\d,.]+)',content)[0]
### Basophil absolute value
g[' Basophil absolute value ']=re.findall(' Basophil absolute value BASO ([\d,.]+)',content)[0]
## Summary
g[' Summary ']=re.findall(' Basophil absolute value .+9/L(.*?) notes ',content,re.S)[0].replace('⼩ junction ','')
print(g)
print('\n')
h={}
### Specific gravity of urine
h[' Specific gravity of urine ']=re.findall(' urine ⽐ heavy SG ([\d,.]+)',content)[0]
# ### Urine pH
h[' Urine pH ']=re.findall(' Urine pH PH ([\d,.]+)',content)[0]
# ### Urine white blood cells
h[' Urine white blood cells ']=re.findall(' urine ⽩ cells LEU\s(.{2})',content)[0]
# ### Urine nitrite
h[' Urine nitrite ']=re.findall(' Urine nitrite NIT\s(.{2})',content)[0]
### Urine protein
h[' Urine protein ']=re.findall(' Piss eggs ⽩ quality PRO\s(.{2})',content)[0]
### Urine sugar
h[' Urine sugar ']=re.findall(' Urine sugar GLU\s(.{2})',content)[0]
### Uroketone body
h[' Uroketone body ']=re.findall(' Uroketone body KET\s(.{2})',content)[0]
### Urobilinogen
h[' Urobilinogen ']=re.findall(' Urobilinogen URO\s(.{2})',content)[0]
### Urinary bilirubin
h[' Urinary bilirubin ']=re.findall(' Urinary bilirubin BIL\s(.{2})',content)[0]
### Urine occult blood
h[' Urine occult blood ']=re.findall(' Urine concealment ⾎ BLD (\d.)',content)[0]
# ### Urine microscopic examination of red blood cells
h[' Urine microscopic examination of red blood cells ']=re.findall(' Urine microscopic examination of red blood cells RBC (.+?)\s',content)[0]
### Urine microscopic examination of white blood cells
h[' Urine microscopic examination of white blood cells ']=re.findall(' Urine microscopy ⽩ cells \nWBC (.+?)\s',content)[0]
# ### Tube type
h[' Tube type ']=re.findall('CAST (.*?)\s',content)[0]
# ### epithelial cells
h[' epithelial cells ']=re.findall(' On ⽪ cells EC (.+?)\s',content)[0]
# ### Urine ascorbic acid
h[' Urine ascorbic acid ']=re.findall(' Urine resistance is bad ⾎ acid (.*?)\s',content)[0]
# ### Summary
h[' Summary ']=re.findall(' Urine resistance is bad ⾎ acid .*? sex .*? sex .*?\n(.*?) notes ',content,re.S)[0].replace('\n⼩ junction ',' ')
h[' Urinary microalbumin quantitation ']=re.findall(' Urine trace ⽩ egg ⽩ ration U-ALB ([\d,.]*)',content)[0]
# ### carbon 14- Urea breath test
h[' carbon 14- Urea breath test ']=re.findall(' carbon 14- Urea exhales ⽓ test 14C-UBT ([\d,.]*)',content)[0]
print(h)
print('\n')
i={}
### Leucorrhea cleanliness
i[' Leucorrhea cleanliness ']=re.findall('⽩ With cleanliness \s+(.*?)\s',content)[0]
### Moniliform bacteria
i[' Moniliform bacteria ']=re.findall(' Moniliform bacteria \s+(.*?)\s',content)[0]
### trichomonad
i[' trichomonad ']=re.findall(' drop ⾍\s+(.*?)\s',content)[0]
### Cervical TCT
i[' Cervical TCT']=re.findall(' drop ⾍.+? sex .+? sex (.*?)⼩ junction ',content,re.S)[0].replace(' Cervical TCT','').replace(' ','')
### Summary
i[' Summary ']=re.findall(' drop ⾍.+? sex .+? sex .*?⼩ junction (.*?) notes :',content,re.S)[0]
print(i)
print('\n')
#### Laboratory examination
j={}
###HPV16 type
j['HPV16 type ']=re.findall('HPV16 type HPV16 ([\d,.]*)',content)[0]
###HPV18 type
j['HPV18 type ']=re.findall('HPV18 type HPV18 ([\d,.]*)',content)[0]
###HPV31 type
j['HPV31 type ']=re.findall('HPV31 type HPV31 ([\d,.]*)',content)[0]
###HPV33 type
j['HPV33 type ']=re.findall('HPV33 type HPV33 ([\d,.]*)',content)[0]
###HPV35 type
j['HPV35 type ']=re.findall('HPV35 type HPV35 ([\d,.]*)',content)[0]
###HPV39 type
j['HPV39 type ']=re.findall('HPV39 type HPV39 ([\d,.]*)',content)[0]
###HPV45 type
j['HPV45 type ']=re.findall('HPV45 type HPV45 ([\d,.]*)',content)[0]
###HPV51 type
j['HPV51 type ']=re.findall('HPV51 type HPV51 ([\d,.]*)',content)[0]
###HPV52 type
j['HPV52 type ']=re.findall('HPV52 type HPV52 ([\d,.]*)',content)[0]
###HPV53 type
j['HPV53 type ']=re.findall('HPV53 type HPV53 ([\d,.]*)',content)[0]
###HPV56 type
j['HPV56 type ']=re.findall('HPV56 type HPV56 ([\d,.]*)',content)[0]
###HPV58 type
j['HPV58 type ']=re.findall('HPV58 type HPV58 ([\d,.]*)',content)[0]
###HPV59 type
j['HPV59 type ']=re.findall('HPV59 type HPV59 ([\d,.]*)',content)[0]
###HPV66 type
j['HPV66 type ']=re.findall('HPV66 type HPV66 ([\d,.]*)',content)[0]
###HPV68 type
j['HPV68 type ']=re.findall('HPV68 ([\d,.]*)',content)[0]
###HPV6 type
j['HPV6 type ']=re.findall('HPV6 type HPV6 ([\d,.]*)',content)[0]
###HPV11 type
j['HPV11 type ']=re.findall('HPV11 type HPV11 ([\d,.]*)',content)[0]
###HPV43 type
j['HPV43 type ']=re.findall('HPV43 type HPV43 ([\d,.]*)',content)[0]
###HPV42 type
j['HPV42 type ']=re.findall('HPV42 type HPV42 ([\d,.]*)',content)[0]
###HPV44 type
j['HPV44 type ']=re.findall('HPV44 type HPV44 ([\d,.]*)',content)[0]
###HPV40 type
j['HPV40 type ']=re.findall('HPV40 type HPV40 ([\d,.]*)',content)[0]
###HPV26 type
j['HPV26 type ']=re.findall('HPV26 type HPV26 ([\d,.]*)',content)[0]
###HPV55 type
j['HPV55 type ']=re.findall('HPV55 type HPV55 ([\d,.]*)',content)[0]
###HPV61 type
j['HPV61 type ']=re.findall('HPV61 type HPV61 ([\d,.]*)',content)[0]
###HPV81 type
j['HPV81 type ']=re.findall('HPV81 type ([\d,.]*)',content)[0]
###HPV83 type
j['HPV83 type ']=re.findall('HPV83 type HPV83 ([\d,.]*)',content)[0]
###HPV82 type
j['HPV82 type ']=re.findall('HPV82 type HPV82 ([\d,.]*)',content)[0]
### Anti thyroid peroxidase antibody
j[' Anti thyroid peroxidase antibody ']=re.findall(' Antithyroid peroxidase Anti-TP\n([\d,.]*)',content)[0]
### Gastrin 17
j[' Gastrin 17']=re.findall(' Gastrin 17 G-17 ([\d,.]*)',content)[0]
### Alanine aminotransferase
j[' Alanine aminotransferase ']=re.findall(' Alanine aminotransferase ALT ([\d,.]*)',content)[0]
### Aspartate aminotransferase
j[' Aspartate aminotransferase ']=re.findall(' God ⻔ Aspartate aminotransferase AST ([\d,.]*)',content)[0]
###γ- Glutamyltransferase
j['γ- Glutamyltransferase ']=re.findall('γ-⾕ Aminoacyltransferase GGT ([\d,.]*)',content)[0]
### Alkaline phosphatase
j[' Alkaline phosphatase ']=re.findall(' Alkaline phosphatase ALP ([\d,.]*)',content)[0]
### Total bile acid
j[' Total bile acid ']=re.findall(' Total bile acid TBA ([\d,.]*)',content)[0]
### Cholinesterase
j[' Cholinesterase ']=re.findall(' Cholinesterase CHE ([\d,.]*)',content)[0]
### Total bilirubin
j[' Total bilirubin ']=re.findall(' Total bilirubin TBIL ([\d,.]*)',content)[0]
### Direct bilirubin
j[' Direct bilirubin ']=re.findall('DBIL ([\d,.]*)',content)[0]
### Indirect bilirubin
j[' Indirect bilirubin ']=re.findall(' Indirect bilirubin IBIL ([\d,.]*)',content)[0]
### Total protein
j[' Total protein ']=re.findall(' Total egg ⽩ TP ([\d,.]*)',content)[0]
### Albumin
j[' Albumin ']=re.findall('⽩ egg ⽩ ALB ([\d,.]*)',content)[0]
### Globulin
j[' Globulin ']=re.findall(' Balls and eggs ⽩ GLb ([\d,.]*)',content)[0]
### Albumin / Globulin ratio
j[' Albumin / Globulin ratio ']=re.findall('⽩ egg ⽩/ Balls and eggs ⽩⽐ value A/G ([\d,.]*)',content)[0]
### urea
j[' urea ']=re.findall(' urea UREA ([\d,.]*)',content)[0]
### creatinine
j[' creatinine ']=re.findall(' creatinine Cr ([\d,.]*)',content)[0]
### uric acid
j[' uric acid ']=re.findall(' uric acid UA ([\d,.]*)',content)[0]
###β2 Microglobulin
j['β2 Microglobulin ']=re.findall('β2 Microsphere egg ⽩ β2-MG ([\d,.]*)',content)[0]
### Serum cystatin C
j[' Serum cystatin C']=re.findall('⾎ Cystatin C Cys-C ([\d,.]*)',content)[0]
### Fasting blood glucose
j[' Fasting blood glucose ']=re.findall(' An empty stomach ⾎ glucose FBG ([\d,.]*)',content)[0]
### glycosylated hemoglobin
j[' glycosylated hemoglobin ']=re.findall(' Saccharification ⾎ Red egg ⽩ HBA1c ([\d,.]*)',content)[0]
### Insulin
j[' Insulin ']=re.findall(' Insulin INS ([\d,.]*)',content)[0]
###C peptide
j['C peptide ']=re.findall('C- peptide C-P ([\d,.]*)',content)[0]
### Total cholesterol
j[' Total cholesterol ']=re.findall(' Total cholesterol TC ([\d,.]*)',content)[0]
### triglycerides
j[' triglycerides ']=re.findall('⽢ Oleotriene TG ([\d,.]*)',content)[0]
### HDL cholesterol
j[' HDL cholesterol ']=re.findall('⾼ Density fat eggs ⽩ Cholesterol HDL-C ([\d,.]*)',content)[0]
### LDL cholesterol
j[' LDL cholesterol ']=re.findall(' Low density fat egg ⽩ Cholesterol LDL-C ([\d,.]*)',content)[0]
### Apolipoproteins A1
j[' Apolipoproteins A1']=re.findall(' Fatty eggs ⽩A1 Apo-A1 ([\d,.]*)',content)[0]
### Apolipoproteins B
j[' Apolipoproteins B']=re.findall(' Fatty eggs ⽩B Apo-B ([\d,.]*)',content)[0]
### Lipoproteins (a)
j[' Lipoproteins (a)']=re.findall(' Fat eggs ⽩\(a\) LP\(a\) ([\d,.]*)',content)[0]
### Phosphocreatine kinase
j[' Phosphocreatine kinase ']=re.findall(' Phosphocreatine kinase CK ([\d,.]*)',content)[0]
### Phosphocreatine kinase isoenzyme
j[' Phosphocreatine kinase isoenzyme ']=re.findall(' Phosphocreatine kinase is the same as ⼯ enzyme CK-MB ([\d,.]*)',content)[0]
### Lactate dehydrogenase
j[' Lactate dehydrogenase ']=re.findall(' Lactate dehydrogenase LDH ([\d,.]*)',content)[0]
### Hypersensitivity C Reactive protein
j[' Hypersensitivity C Reactive protein ']=re.findall(' Hypersensitivity C Reaction egg ⽩ HS-CRP ([\d,.]*)',content)[0]
### Homocysteine
j[' Homocysteine ']=re.findall(' Homocysteine Hcy ([\d,.]*)',content)[0]
### Whole blood viscosity 1
j[' Whole blood viscosity 1']=re.findall(' whole ⾎ viscosity 1 ([\d,.]*)',content)[0]
### Whole blood viscosity 5
j[' Whole blood viscosity 5']=re.findall(' whole ⾎ viscosity 5 ([\d,.]*)',content)[0]
### Whole blood viscosity 30
j[' Whole blood viscosity 30']=re.findall(' whole ⾎ viscosity 30 ([\d,.]*)',content)[0]
### Whole blood viscosity 200
j[' Whole blood viscosity 200']=re.findall(' whole ⾎ viscosity 200 ([\d,.]*)',content)[0]
### Plasma viscosity
j[' Plasma viscosity ']=re.findall('⾎ Slurry viscosity P Visc. ([\d,.]*)',content)[0]
### esr
j[' esr ']=re.findall('⾎ sink ESR ([\d,.]*)',content)[0]
### Accretion
j[' Accretion ']=re.findall('⾎ sink .*?\n Accretion HCT ([\d,.]*)',content)[0]
### Whole blood high shear relative index
j[' Whole blood high shear relative index ']=re.findall(' whole ⾎⾼ Tangent relative index ([\d,.]*)',content)[0]
### Whole blood low shear relative index
j[' Whole blood low shear relative index ']=re.findall(' whole ⾎ Low shear relative index ([\d,.]*)',content)[0]
### ESR equation K value
j[' ESR equation K value ']=re.findall('⾎ sink ⽅ cheng K value ESR-FK ([\d,.]*)',content)[0]
### Erythrocyte aggregation index
j[' Erythrocyte aggregation index ']=re.findall(' Erythrocyte aggregation index Agrbc ([\d,.]*)',content)[0]
### Whole blood low shear reduction viscosity
j[' Whole blood low shear reduction viscosity ']=re.findall(' whole ⾎ Low shear reduction viscosity ([\d,.]*)',content)[0]
### Whole blood high shear reduction viscosity
j[' Whole blood high shear reduction viscosity ']=re.findall(' whole ⾎⾼ Shear reduction viscosity ([\d,.]*)',content)[0]
### Erythrocyte rigidity index
j[' Erythrocyte rigidity index ']=re.findall(' Erythrocyte rigidity index IR ([\d,.]*)',content)[0]
### Erythrocyte deformability index
j[' Erythrocyte deformability index ']=re.findall(' Erythrocyte deformability index TK ([\d,.]*)',content)[0]
### Rheumatoid factor
j[' Rheumatoid factor ']=re.findall(' class ⻛ Dampness causes ⼦ RF ([\d,.]*)',content)[0]
### Anti streptolysin “0
j[' Anti streptolysin “0']=re.findall(' Antistreptolysin ⾎ plain “O” ASO ([\d,.]*)',content)[0]
###EB Virus resistance - VCAIgA
j['EB Virus resistance - VCAIgA']=re.findall('EB Virus resistance -VCAIgA (.{2})',content)[0]
### Alpha fetoprotein (T-12)
j[' Alpha fetoprotein (T-12)']=re.findall(' A foetus egg ⽩(T-12) AFP ([\d,.]*)',content)[0]
### Carcinoembryonic antigen (T-12)
j[' Carcinoembryonic antigen (T-12)']=re.findall(' Carcinoembryonic antigen (T-12) CEA ([\d,.]*)',content)[0]
### carbohydrate antigen 19-9(T-12)
j[' carbohydrate antigen 19-9(T-12)']=re.findall(' carbohydrate antigen 19-9(T-12) CA19-9 ([\d,.]*)',content)[0]
### carbohydrate antigen 242(T-12)
j[' carbohydrate antigen 242(T-12)']=re.findall(' carbohydrate antigen 242(T-12) CA242 ([\d,.]*)',content)[0]
### carbohydrate antigen 125(T-12)
j[' carbohydrate antigen 125(T-12)']=re.findall(' carbohydrate antigen 125(T-12) CA125 ([\d,.]*)',content)[0]
### carbohydrate antigen 15-3(T-12)
j[' carbohydrate antigen 15-3(T-12)']=re.findall(' carbohydrate antigen 15-3(T-12) CA15-3 ([\d,.]*)',content)[0]
### Cytokeratin 19 fragment (T-12)
j[' Cytokeratin 19 fragment (T-12)']=re.findall(' cells ⻆ egg ⽩19⽚ paragraph (T-1 CYFRA2\n([\d,.]*)',content)[0]
### Neuron specific enolase (T-12)NSE
j[' Neuron specific enolase (T-12)NSE']=re.findall(' Neuron specific enolase \nNSE ([\d,.]*)',content)[0]
### Pepsinogen (T-12)
j[' Pepsinogen (T-12)']=re.findall(' Stomach egg ⽩ Zymogen Ⅰ(T-12) PGⅠ ([\d,.]*)',content)[0]
### Pepsinogen Ⅱ(T-12)
j[' Pepsinogen Ⅱ(T-12)']=re.findall(' Stomach egg ⽩ Zymogen Ⅱ(T-12) PGⅡ ([\d,.]*)',content)[0]
### Human chorionic gonadotropin free β Subunits
j[' Human chorionic gonadotropin free β Subunits ']=re.findall('⼈ Velvet ⽑ Membrane gonadotropin swim free-β-\n([\d,.]*)',content)[0]
### Squamous cell carcinoma associated antigen (T-12)
j[' Squamous cell carcinoma associated antigen (T-12)']=re.findall(' On the scales ⽪ Cell carcinoma related anti - \nSCC ([\d,.]*)',content)[0]
###PGl/PGIl(T-12)
j['PGl/PGIl(T-12)']=re.findall('PGI/PGII\(T-12\) ([\d,.]*)',content)[0]
### Free triiodothyronine
j[' Free triiodothyronine ']=re.findall(' Free triiodothyronine FT3 ([\d,.]*)',content)[0]
### Free thyroxine
j[' Free thyroxine ']=re.findall(' Free thyroxine FT4 ([\d,.]*)',content)[0]
### Triiodothyronine
j[' Triiodothyronine ']=re.findall(' Triiodothyronine T3 ([\d,.]*)',content)[0]
### Thyroxine
j[' Thyroxine ']=re.findall(' Thyroxine T4 ([\d,.]*)',content)[0]
### Thyrotropin
j[' Thyrotropin ']=re.findall(' Thyrotropin TSH ([\d,.]*)',content)[0]
### Anti thyroglobulin antibodies
j[' Anti thyroglobulin antibodies ']=re.findall(' Antithyroid globulin ⽩ antibody TG-Ab (< [\d,.]*)',content)[0]
### progesterone
j[' progesterone ']=re.findall(' progesterone P ([\d,.]*)',content)[0]
### Estradiol
j[' Estradiol ']=re.findall(' female ⼆ alcohol E2 ([\d,.]*)',content)[0]
### Follicle stimulating hormone
j[' Follicle stimulating hormone ']=re.findall(' Follicle stimulating hormone FSH ([\d,.]*)',content)[0]
### Luteinizing hormone
j[' Luteinizing hormone ']=re.findall(' promote ⻩ body ⽣ Hormones LH ([\d,.]*)',content)[0]
### testosterone
j[' testosterone ']=re.findall(' testosterone T ([\d,.]*)',content)[0]
### Prolactin
j[' Prolactin ']=re.findall(' Prolactin PRL ([\d,.]*)',content)[0]
### immunoglobulin A
j[' immunoglobulin A']=re.findall(' Immunoglobulin eggs ⽩A IgA ([\d,.]*)',content)[0]
### immunoglobulin G
j[' immunoglobulin G']=re.findall(' Immunoglobulin eggs ⽩G IgG ([\d,.]*)',content)[0]
### immunoglobulin M
j[' immunoglobulin M']=re.findall(' Immunoglobulin eggs ⽩M IgM ([\d,.]*)',content)[0]
### immunoglobulin E
j[' immunoglobulin E']=re.findall(' Immunoglobulin eggs ⽩E IgE ([\d,.]*)',content)[0]
### complement C3
j[' complement C3']=re.findall(' complement C3 C3 ([\d,.]*)',content)[0]
### complement C4
j[' complement C4']=re.findall(' complement C4.*?C4 ([\d,.]*)',content,re.S)[0]
### serum Ⅲ Type I procollagen
j[' serum Ⅲ Type I procollagen ']=re.findall('⾎ clear Ⅲ Before type 㬵 primary PCⅢ ([\d,.]*)',content)[0]
### serum Ⅳ Type collagen
j[' serum Ⅳ Type collagen ']=re.findall('⾎ clear IV type 㬵 primary CIV ([\d,.]*)',content)[0]
### Serum laminin
j[' Serum laminin ']=re.findall('⾎ Clear the adhesive layer ⽩ LN ([\d,.]*)',content)[0]
### Serum hyaluronic acid
j[' Serum hyaluronic acid ']=re.findall('⾎ Hyaluronic acid HA ([\d,.]*)',content)[0]
### Summary
j[' Summary ']=re.findall('0.00-120.00 ng/mL\n(.*) notes : This result is only responsible for the barcode samples , For clinical reference only .\n⼼ Electrogram room ',content,re.S)[0].replace(' Summary ','')
print(j)
print('\n')
### ECG Room
k={}
### electrocardiogram
k[' electrocardiogram ']=''.join(list(re.findall(' Company \n⼼ Electrogram (.*)',content)[0]))
### Preliminary comments
k[' Preliminary comments ']=re.findall(' Check the item ⽬ The inspection office ⻅ Company \n.*\n Preliminary idea ⻅ (.*?)\n Ultrasonic examination room ',content,re.S)[0]
print(k)
print('\n')
### Ultrasonic room examination
l={}
### liver
l[' liver ']=re.findall(' Ultrasonic examination room Inspector :.*\n Check the item ⽬ The inspection office ⻅ Company \n(.*?)\n gallbladder ',content,re.S)[0].replace('\n liver ','')
### gallbladder
l[' gallbladder ']=re.findall(' gallbladder (.*?)\n pancreas ',content,re.S)[0]
### pancreas
l[' pancreas ']=re.findall(' pancreas (.*?)\n The spleen ',content,re.S)[0]
### The spleen
l[' The spleen ']=re.findall(' The spleen (.*?)\n Aikang Junan ',content,re.S)[0]+re.findall(' The spleen .* Medical examination No \d+\n(.*?)\n Double kidney ',content,re.S)[0]
# ### Double kidney
l[' Double kidney ']=re.findall('( Double kidney morphology .*?)\n⼦ The Palace ',content,re.S)[0].replace('\n Double kidney ','')
# ### uterus
l[' uterus ']=re.findall(' Double kidney morphology .*?\n(⼦ The Palace .*?)\n The attachment ',content,re.S)[0].replace('\n⼦ The Palace ','')
# ### The attachment
l[' The attachment ']=re.findall(' Double kidney morphology .*?\n⼦ The Palace .*?\n( Left attachment .*?)\n Bilateral mammary glands ',content,re.S)[0].replace('\n The attachment ','')
# ### Breast
l[' Breast ']=re.findall('( Bilateral mammary glands .*?)\n thyroid ',content,re.S)[0]
# ### thyroid
l[' thyroid ']=re.findall('( Thyroid morphology ⼤⼩.*?)\n Bilateral common carotid arteries ',content,re.S)[0].replace('\n thyroid ','')
### Carotid artery
l[' Carotid artery ']=re.findall('( Bilateral common carotid arteries .*?)\n The inspection office ⻅',content,re.S)[0]
# ### The heart
l[' The heart ']=re.findall(' Carotid artery .*?\n The inspection office ⻅:\n(.*)\n Bladder ',content,re.S)[0].replace('\n⼼ dirty ','')
# ### Bladder
l[' Bladder ']=re.findall(' Bladder (.*)',content)[0]
# ### Summary
l[' Summary ']=''.join(re.findall(' Bladder .*?(1.*?)\n Aikang Junan .*? Medical examination No .*?\n(.*?) Aikang Junan ',content,re.S)[0]).replace('\n Preliminary idea ⻅ ','')
print(l)
print('\n')
###CT
m={}
m[' Head ']=re.findall('CT room .*? Company (.*?)\n chest CT Scan ',content,re.S)[0]
m[' chest ']=re.findall('( chest CT Scan .*?)\n Preliminary idea ⻅',content,re.S)[0]
m[' Preliminary comments ']=re.findall(' chest CT Scan .*?\n Preliminary idea ⻅(.*?)\n⻣ Density examination room ',content,re.S)[0].replace('\n Preliminary idea ⻅ ','')
print(m)
print('\n')
### bone density
n={}
n[' bone density ']=re.findall('⻣ density (.*?)\n Preliminary idea ⻅ ',content,re.S)[0]
n[' Preliminary comments ']=re.findall('⻣ density .*?\n Preliminary idea ⻅ (.*?) Arteriosclerosis test room ',content,re.S)[0].replace('\n Preliminary idea ⻅ ','')
print(n)
print('\n')
### Arteriosclerosis test room
o={}
o[' Arteriosclerosis test ']=re.findall('( Arteriosclerosis test .*)\n Transcranial Doppler examination room ',content,re.S)[0]
o[' Transcranial Doppler ']=re.findall(' Transcranial Doppler examination room .*? Company \n(.*?) Preliminary idea ⻅ ',content,re.S)[0]
o[' Preliminary comments ']=re.findall(' Transcranial Doppler examination room .*? Company \n.*? Preliminary idea ⻅ (.*?) Then you hide ⾎',content,re.S)[0]
print(o)
print('\n')
# ### Hepatitis B test report
p={}
p[' Hepatitis B virus surface antigen ']=re.findall('⼄ Hepatitis A virus table ⾯ antigen HBsAg (.{2})',content)[0]
p[' Hepatitis B virus surface antibody ']=re.findall('⼄ Hepatitis A virus table ⾯ antibody HBsAb (.{2})',content)[0]
p[' Hepatitis B virus e antigen ']=re.findall('⼄ Hepatitis B virus e antigen HBeAg (.{2})',content)[0]
p[' Hepatitis B virus e antibody ']=re.findall('⼄ Hepatitis B virus e antibody HBeAb (.{2})',content)[0]
p[' Hepatitis B virus core antibody ']=re.findall('⼄ Hepatitis B virus nucleus ⼼ antibody HBcAb (.{2})',content)[0]
p[' Summary ']=re.findall('⼄ Hepatitis B virus nucleus ⼼ antibody HBcAb .*?⼩ junction (.*?) notes ',content,re.S)[0]
print(p)
print('\n')
### teeth
q={}
q[' Oral glands ']=re.findall('⼝ Antral glands .*?\n(1、.*?)1、',content,re.S)[0]
q[' Dentition ']=re.findall('⼝ Antral glands .*?\n1、.*?(1、.*?)1',content,re.S)[0]
q[' lip ']=re.findall('⼝ Antral glands .*?\n1、.*?1、.*?(1.*?)1',content,re.S)[0]
q[' Teeth ']=re.findall('⼝ Antral glands .*?\n1、.*?1、.*?1.*?(1.*?)⽛ Zhou ',content,re.S)[0].replace('\n','')
q[' dental periphery ']='1、⽛ Gingivitis 2、⽛ junction ⽯ 3、⽛ Gingival atrophy :I'
q[' tongue ']='1、 not ⻅ Obviously abnormal '
q[' palate ']='1、 not ⻅ Obviously abnormal '
q[' Oral mucosa ']='1、 not ⻅ Obviously abnormal '
q[' Temporomandibular joint ']='1、 not ⻅ Obviously abnormal '
q[' Other in stomatology ']='1、 not ⻅ Obviously abnormal '
print(q)
### Bone mineral density test results
r={}
r[' Mean bone mineral density ']=re.findall(' Mean bone mineral density 1(.*)',content)[0]
r['T value ']=re.findall('T value \s([\d,\.]+)',content)[0]
r['Z value ']=re.findall('Z value \s([\d,\.]+)',content)[0]
r[' Percentage of peak bone mineral density ']=re.findall(' Percentage of peak bone mineral density (.*)',content)[0]
r[' Chinese osteoporosis standard ']=re.findall(' Chinese osteoporosis standard 2(.*)',content)[0]
r[' Who standards ']=re.findall(' Who standards (.*)',content)[0]
print(r)
import openpyxl as op
wb = op.load_workbook(" Aikang female template .xlsx")
sh=wb["sheet1"]
###sh.cell(1,2,'aaa') It means the actual 1 Xing di 2 Add content to the cells of the column aaa
### General inspection
for x in range(3,8):
sh.cell(x,4,list(a.values())[x-3])
### internal medicine
for x in range(9,19):
sh.cell(x,4,list(b.values())[x-9])
sh.cell(8,2,b[' Preliminary idea ⻅'])
### Surgery
sh.cell(19,2,c[' Preliminary comments '])
for x in range(20,26):
sh.cell(x,4,list(c.values())[x-20])
### Department of gynaecology
sh.cell(26,2,d[' Preliminary comments '])
for x in range(27,34):
sh.cell(x,4,list(d.values())[x-27])
### Ophthalmology Department
sh.cell(34,2,e[' Preliminary comments '])
for x in range(35,41):
sh.cell(x,4,list(e.values())[x-35])
## E.N.T. Department
sh.cell(41,2,f[' Preliminary comments '])
for x in range(42,50):
sh.cell(x,4,list(f.values())[x-42])
## routine blood test
sh.cell(50,2,g[' Summary '])
for x in range(51,74):
sh.cell(x,4,list(g.values())[x-51])
## Urine routine
sh.cell(74,2,h[' Summary '])
for x in range(75,90):
sh.cell(x,4,list(h.values())[x-75])
sh.cell(91,4,h[' Urinary microalbumin quantitation '])
sh.cell(93,4,h[' carbon 14- Urea breath test '])
### Gynecological examination items
sh.cell(94,2,i[' Summary '])
for x in range(94,98):
sh.cell(x,4,list(i.values())[x-94])
### Laboratory examination
for x in range(98,97+len(j)):
sh.cell(x,4,list(j.values())[x-98])
sh.cell(98,2,j[' Summary '])
### electrocardiogram
sh.cell(219,2,k[' Preliminary comments '])
sh.cell(219,4,k[' electrocardiogram '])
### Ultrasonic room examination
sh.cell(221,2,l[' Summary '])
for x in range(221,233):
sh.cell(x,3,list(l.keys())[x-221])
for x in range(221,233):
sh.cell(x,4,list(l.values())[x-221])
###CT
sh.cell(233,2,m[' Preliminary comments '])
sh.cell(233,4,m[' Head '])
sh.cell(234,4,m[' chest '])
### bone density
sh.cell(235,2,n[' Preliminary comments '])
sh.cell(235,4,n[' bone density '])
### Arteriosclerosis test room
sh.cell(236,2,o[' Preliminary comments '])
sh.cell(236,4,o[' Arteriosclerosis test '])
sh.cell(237,4,o[' Transcranial Doppler '])
### teeth
for x in range(238,248):
sh.cell(x,4,list(q.values())[x-238])
### Bone mineral density test results
for x in range(248,254):
sh.cell(x,4,list(r.values())[x-248])
# ### Hepatitis B test report
sh.cell(254,2,p[' Summary '])
for x in range(254,259):
sh.cell(x,4,list(p.values())[x-254])
wb.save(" Aikang female template 2.xlsx")
边栏推荐
- Methods for creating multithreads ---1 creating subclasses of thread class and multithreading principle
- ==And eqauls()
- Redis sentinel cluster main database failure data recovery ideas # yyds dry goods inventory #
- 详解final、finally和finalize
- 满电出发加速品牌焕新,长安电动电气化产品吹响“集结号”
- Function sub file writing
- dotnet 使用 Crossgen2 对 DLL 进行 ReadyToRun 提升启动性能
- 4 methods for exception handling
- Custom exception classes and exercises
- Restful style
猜你喜欢

Matplotlib attribute and annotation

桥接模式(Bridge)

Huawei OSPF single region

Ingersoll Rand panel maintenance IR Ingersoll Rand microcomputer controller maintenance xe-145m
![[ybtoj advanced training guidance] class roll call [string hash]](/img/5b/bbf8fa51d180b50fbbee4bcc278c70.jpg)
[ybtoj advanced training guidance] class roll call [string hash]

Dolphin scheduler uses system time

Unity AssetBundle资源打包与资源加载

mysql打不开,闪退

布隆过滤器 课程研究报告
![QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])](/img/17/57ffb7393b71eddc5ac92ae3944338.jpg)
QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])
随机推荐
Looking at jBPM from jbm3 to jbm5 and activiti
2022-06-27:给出一个长度为n的01串,现在请你找到两个区间, 使得这两个区间中,1的个数相等,0的个数也相等, 这两个区间可以相交,但是不可以完全重叠
Global exception handlers and unified return results
01-分布式系统概述
生成token
Check whether the table contains rows SQL Server 2005 - check whether a table contains rows or not SQL Server 2005
再見!IE瀏覽器,這條路由Edge替IE繼續走下去
满电出发加速品牌焕新,长安电动电气化产品吹响“集结号”
Sword finger offer | linked list transpose
P2394 yyy loves Chemistry I
详解final、finally和finalize
适配器模式(Adapter)
剑指Offer | 链表转置
Summary of MySQL basic knowledge points
为什么 Istio 要使用 SPIRE 做身份认证?
Methods for creating multithreads ---1 creating subclasses of thread class and multithreading principle
1180: fractional line delimitation /p1068 [noip2009 popularization group] fractional line delimitation
通过PyTorch构建的LeNet-5网络对手写数字进行训练和识别
再见!IE浏览器,这条路由Edge替IE继续走下去
ffmpeg录音录像