Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyvpet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
haoyanbin
pyvpet
Commits
6a0d3ede
Commit
6a0d3ede
authored
May 09, 2024
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
993fab84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
26 deletions
+27
-26
neodata.py
app/controller/neodata.py
+26
-26
search.py
app/controller/search.py
+1
-0
No files found.
app/controller/neodata.py
View file @
6a0d3ede
...
...
@@ -304,40 +304,40 @@ def neo_cate():
@
bp
.
route
(
'/neo_clinical'
)
def
neo_clinical
():
node_matcher
=
NodeMatcher
(
graph
)
#
node_matcher = NodeMatcher(graph)
# clinical_id = dbconn.query(
# sql='SELECT id, `name`, `value`, `qz`, lab_category_id FROM lab_clinical where id > 0'
# )
#
#
clinical_id = dbconn.query(
#
#
sql='SELECT id, `name`, `value`, `qz`, lab_category_id FROM lab_clinical where id > 0'
#
#
)
# sql='SELECT d.id, d.drug_name,a.res FROM drug as d left join api as a on d.drug_name = a.param where d.id > 943'
clinical
=
dbconn
.
query
(
sql
=
'SELECT id, `name`, `value`, `qz`, lab_category_id, clinical_id FROM lab_clinical where id > 0'
)
#
#
sql='SELECT d.id, d.drug_name,a.res FROM drug as d left join api as a on d.drug_name = a.param where d.id > 943'
#
clinical = dbconn.query(
#
sql='SELECT id, `name`, `value`, `qz`, lab_category_id, clinical_id FROM lab_clinical where id > 0'
#
)
category
=
dbconn
.
query
(
sql
=
'SELECT id, parent_id, `name` FROM lab_category where id > 0 and children = 3'
)
#
category = dbconn.query(
#
sql='SELECT id, parent_id, `name` FROM lab_category where id > 0 and children = 3'
#
)
for
val
in
clinical
:
# clinical_id = get_clinical(val['name'])
node_clinical
=
node_matcher
.
match
(
'病症'
,
id
=
val
[
'clinical_id'
])
.
first
()
if
node_clinical
is
None
:
node_clinical
=
Node
(
"病症"
,
id
=
val
[
'clinical_id'
],
name
=
val
[
'name'
])
#
for val in clinical:
#
# clinical_id = get_clinical(val['name'])
#
node_clinical = node_matcher.match('病症', id=val['clinical_id']).first()
#
if node_clinical is None:
#
node_clinical = Node("病症", id=val['clinical_id'], name=val['name'])
for
val2
in
category
:
if
val2
[
'id'
]
==
val
[
'lab_category_id'
]:
node_cate
=
node_matcher
.
match
(
'疾病(三)'
,
id
=
val2
[
'id'
])
.
first
()
if
node_cate
is
None
:
node_cate
=
Node
(
"疾病(三)"
,
id
=
val2
[
'id'
],
name
=
val2
[
'name'
],
parent_id
=
val2
[
'parent_id'
])
#
for val2 in category:
#
if val2['id'] == val['lab_category_id']:
#
node_cate = node_matcher.match('疾病(三)', id=val2['id']).first()
#
if node_cate is None:
#
node_cate = Node("疾病(三)", id=val2['id'], name=val2['name'], parent_id=val2['parent_id'])
# node_clinical = Node("病症", id=val['id'], name=val['name'], value=val['value'], qz=val['qz'], category_id=val['lab_category_id'])
#
# node_clinical = Node("病症", id=val['id'], name=val['name'], value=val['value'], qz=val['qz'], category_id=val['lab_category_id'])
link2
=
Relationship
(
node_clinical
,
'疾病'
,
node_cate
)
link3
=
Relationship
(
node_cate
,
'病症'
,
node_clinical
)
#
link2 = Relationship(node_clinical, '疾病', node_cate)
#
link3 = Relationship(node_cate, '病症', node_clinical)
graph
.
create
(
link2
)
graph
.
create
(
link3
)
#
graph.create(link2)
#
graph.create(link3)
return
'1'
...
...
app/controller/search.py
View file @
6a0d3ede
...
...
@@ -22,6 +22,7 @@ for val_keyword in rows:
@
bp
.
route
(
'/illness_search'
,
methods
=
[
'POST'
,
'GET'
])
def
illness_search
():
print
(
111
)
if
request
.
method
==
'POST'
:
req
=
request
.
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