Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oral_prod_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶书衡
oral_prod_api
Commits
9ba70876
Commit
9ba70876
authored
Dec 08, 2021
by
陶书衡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1.1.0 stable
parent
94ed2394
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
286 additions
and
16 deletions
+286
-16
api.cpython-37.pyc
__pycache__/api.cpython-37.pyc
+0
-0
give_color.cpython-37.pyc
__pycache__/give_color.cpython-37.pyc
+0
-0
model.cpython-37.pyc
__pycache__/model.cpython-37.pyc
+0
-0
api.py
api.py
+10
-2
give_color.py
give_color.py
+226
-0
model.py
model.py
+50
-14
No files found.
__pycache__/api.cpython-37.pyc
View file @
9ba70876
No preview for this file type
__pycache__/give_color.cpython-37.pyc
0 → 100644
View file @
9ba70876
File added
__pycache__/model.cpython-37.pyc
View file @
9ba70876
No preview for this file type
api.py
View file @
9ba70876
...
...
@@ -3,7 +3,7 @@ import copy
import
requests
import
uuid
from
flask
import
Flask
,
request
,
redirect
,
url_for
,
render_template
,
flash
,
jsonify
,
Blueprint
from
give_color
import
get_color
from
model
import
Oral
oral_api
=
Blueprint
(
'oral'
,
__name__
)
...
...
@@ -38,7 +38,15 @@ def recognize():
print
(
''
if
verbose
==
0
else
'verbose out:'
)
oral
=
Oral
(
finding
,
conclusion
,
verbose
=
False
if
verbose
==
0
else
1
)
data
=
oral
.
get_json
()
return
jsonify
({
'success'
:
True
,
'description'
:
{
'data'
:
data
}}),
200
finding_list
,
conclusion_list
,
findind_replaced_word
,
conclusion_replaced_word
,
ImmunohistochemistryContent
,
MolecularResultsContent
=
oral
.
get_entity
()
color_finding
=
get_color
(
finding
,
finding_list
,
findind_replaced_word
,
ImmunohistochemistryContent
,
MolecularResultsContent
)
color_conclusion
=
get_color
(
conclusion
,
conclusion_list
,
conclusion_replaced_word
,
ImmunohistochemistryContent
,
MolecularResultsContent
)
return
jsonify
({
'success'
:
True
,
'description'
:
{
'entity'
:
data
,
'color'
:
{
'finding'
:
color_finding
,
'conclusion'
:
color_conclusion
}}}),
200
except
Exception
as
e
:
print
(
"/n******ERROR SRART******/n"
)
print
(
e
)
...
...
give_color.py
0 → 100644
View file @
9ba70876
This diff is collapsed.
Click to expand it.
model.py
View file @
9ba70876
...
...
@@ -17,12 +17,39 @@ class Oral:
self
.
_Conclusion
=
''
self
.
_Finding
=
''
self
.
inversed
=
False
if
'送检淋巴结'
in
ImagingConclusion
:
self
.
_Conclusion
=
ImagingConclusion
self
.
_Finding
=
ImagingFindings
else
:
self
.
_Conclusion
=
ImagingFindings
self
.
_Finding
=
ImagingConclusion
self
.
inversed
=
True
self
.
conclusion_replaced_word
=
''
self
.
findind_replaced_word
=
''
if
"大于"
in
self
.
_Conclusion
:
self
.
conclusion_replaced_word
=
"大于"
if
"小于"
in
self
.
_Conclusion
:
self
.
conclusion_replaced_word
=
"小于"
if
"大于等于"
in
self
.
_Conclusion
:
self
.
conclusion_replaced_word
=
"大于等于"
if
"小于等于"
in
self
.
_Conclusion
:
self
.
conclusion_replaced_word
=
"小于等于"
if
">"
in
self
.
_Conclusion
:
self
.
conclusion_replaced_word
=
">"
if
"大于"
in
self
.
_Finding
:
self
.
findind_replaced_word
=
"大于"
if
"小于"
in
self
.
_Finding
:
self
.
findind_replaced_word
=
"小于"
if
"大于等于"
in
self
.
_Finding
:
self
.
findind_replaced_word
=
"大于等于"
if
"小于等于"
in
self
.
_Finding
:
self
.
findind_replaced_word
=
"小于等于"
if
">"
in
self
.
_Finding
:
self
.
findind_replaced_word
=
">"
self
.
_Conclusion
=
self
.
_Conclusion
.
strip
(
'"'
)
.
strip
()
\
.
replace
(
"大于"
,
">"
)
.
replace
(
"小于"
,
"<"
)
.
replace
(
"大于等于"
,
"≥"
)
.
replace
(
"小于等于"
,
"≤"
)
.
replace
(
">"
,
">"
)
.
replace
(
...
...
@@ -694,6 +721,21 @@ class Oral:
for
i
in
self
.
_y_pre_o
:
print
(
i
)
def
get_entity
(
self
):
finding_list
=
[]
conclusion_list
=
[]
if
self
.
inversed
==
True
:
for
i
in
self
.
_y_pre
:
finding_list
.
append
({
'tag'
:
i
[
0
],
'words'
:
i
[
1
]})
for
i
in
self
.
_y_pre_o
:
conclusion_list
.
append
({
'tag'
:
i
[
0
],
'words'
:
i
[
1
]})
else
:
for
i
in
self
.
_y_pre_o
:
finding_list
.
append
({
'tag'
:
i
[
0
],
'words'
:
i
[
1
]})
for
i
in
self
.
_y_pre
:
conclusion_list
.
append
({
'tag'
:
i
[
0
],
'words'
:
i
[
1
]})
return
finding_list
,
conclusion_list
,
self
.
findind_replaced_word
,
self
.
conclusion_replaced_word
,
self
.
ImmunohistochemistryContent
,
self
.
MolecularResultsContent
def
print_list_item
(
self
,
l
):
for
i
in
l
:
print
(
i
)
...
...
@@ -735,21 +777,15 @@ class Oral:
##
if
__name__
==
'__main__'
:
Finding
=
"""
" 左颈大块:6*5*4cm,一侧见一腺体3*3*2cm,灰黄分叶,余为脂肪血管。
左I区: 3只直径0.2-1.2cm。
左II区: 3只直径0.5-1.2cm。
左III区: 3只直径0.5-1cm。
左IV区: 3只直径0.5-0.8cm。
右I区:3只直径1-2cm。
右II区: 3只直径1cm。
右III区: 3只直径0.5-0.8cm。
右IV区: 3只直径0.5-0.6cm。
右颈淋巴:7*7*6cm,內见一腺体3*3*2cm,灰黄分叶,余为脂肪血管。"
"1、一带黏膜组织,1.8*0.8*0.5cm。灰黄。(2全)。
2、送检切缘:“前、后、左、右、底”均0.5cm。"
"""
Conclusion
=
"""
"“左颌下腺”慢性涎腺炎
“右颌下腺”慢性涎腺炎
送检淋巴结:“左”“I区”1/3只、“II区”1/3只、“III区”1/3只(肿瘤位于软组织内)及“右”“I区”2/3只(其中1只肿瘤侵犯至包膜外)、“II区”2/3只(肿瘤侵犯至包膜外)有肿瘤转移(+),余及“左IV区”3只、“右”“III区”3只、“IV区”3只均阴性(-)"
"“右口底”黏膜上皮中-重度异常增生及瘤样增生,癌变为鳞状细胞癌,高-中分化,DOI:小于5mm。
送检切缘:“前、后、左、右、底”均阴性(-)。
南院免疫组化结果(I2021-3047):CKH(+),CK5/6(+),P16(-),Ki67(约30-40
%+
),CD31(-),S100(-),EGFR(+),P53(少量+)。"
"""
oral
=
Oral
(
Finding
,
Conclusion
)
...
...
@@ -758,4 +794,4 @@ if __name__ == '__main__':
oral
.
print_y_pred_o
()
print
(
"-----------------"
)
oral
.
get_Info
()
print
(
oral
.
get_json
())
#
print(oral.get_json())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment