Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
concepts-processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meldb
concepts-processing
Commits
850bd595
Commit
850bd595
authored
5 months ago
by
Jakub Dylag
Browse files
Options
Downloads
Patches
Plain Diff
rename error log columns, moved omop code definitions to parse.py
parent
3c0f4c4a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
base.py
+2
-2
2 additions, 2 deletions
base.py
main.py
+4
-14
4 additions, 14 deletions
main.py
parse.py
+11
-0
11 additions, 0 deletions
parse.py
with
17 additions
and
16 deletions
base.py
+
2
−
2
View file @
850bd595
...
...
@@ -24,8 +24,8 @@ def log_invalid_code(codes, mask, code_type=None, file_path=None, cause=None):
# print("ERROR WITH CODES", file_path, codes[~mask])
errors
=
pd
.
DataFrame
([])
errors
[
"
CO
DE
"
]
=
codes
[
~
mask
].
astype
(
str
)
errors
[
"
CODE_TYPE
"
]
=
code_type
errors
[
"
CO
NCEPT
"
]
=
codes
[
~
mask
].
astype
(
str
)
errors
[
"
VOCABULARY
"
]
=
code_type
errors
[
"
SOURCE
"
]
=
file_path
errors
[
"
CAUSE
"
]
=
cause
...
...
This diff is collapsed.
Click to expand it.
main.py
+
4
−
14
View file @
850bd595
...
...
@@ -17,6 +17,7 @@ from parse import Opcs4_code
from
parse
import
Atc_code
from
parse
import
Med_code
from
parse
import
code_types
from
parse
import
omop_vocab_types
pd
.
set_option
(
'
mode.chained_assignment
'
,
None
)
...
...
@@ -356,20 +357,9 @@ def run_all(mapping_file, target_code_type,
if
output_path
==
"
atlas
"
:
#Export to DB
db_path
=
"
codes/omop_54.sqlite
"
vocab_output
=
"
MELDB
"
vocab_types
=
{
"
read2_code
"
:
"
Read
"
,
"
read3_code
"
:
None
,
"
icd10_code
"
:
"
ICD10CM
"
,
"
snomed_code
"
:
"
SNOMED
"
,
"
opcs4_code
"
:
"
OPCS4
"
,
"
atc_code
"
:
"
ATC
"
,
"
med_code
"
:
None
,
"
cprd_code
"
:
None
,
}
omop_publish_concept_sets
(
out
,
db_path
,
vocab_output
,
vocab_types
[
target_code_type
])
vocab_output
=
"
MELDB
"
#TODO: parameterise output name
omop_publish_concept_sets
(
out
,
db_path
,
vocab_output
,
omop_vocab_types
[
target_code_type
])
else
:
# export as CSV to /output
out
.
to_csv
(
output_path
,
index
=
False
)
...
...
@@ -379,7 +369,7 @@ def run_all(mapping_file, target_code_type,
if
os
.
path
.
exists
(
log_errors_path
):
error_df
=
pd
.
read_csv
(
log_errors_path
)
error_df
=
error_df
.
drop_duplicates
()
#Remove Duplicates from Error file
error_df
=
error_df
.
sort_values
(
by
=
[
"
SOURCE
"
,
"
VOCABULARY
"
,
"
CO
DE
"
])
error_df
=
error_df
.
sort_values
(
by
=
[
"
SOURCE
"
,
"
VOCABULARY
"
,
"
CO
NCEPT
"
])
error_df
.
to_csv
(
log_errors_path
,
index
=
False
)
...
...
This diff is collapsed.
Click to expand it.
parse.py
+
11
−
0
View file @
850bd595
...
...
@@ -354,3 +354,14 @@ code_types = {
"
med_code
"
:
Med_code
,
"
cprd_code
"
:
Cprd_code
,
}
omop_vocab_types
=
{
"
read2_code
"
:
"
Read
"
,
"
read3_code
"
:
None
,
"
icd10_code
"
:
"
ICD10CM
"
,
"
snomed_code
"
:
"
SNOMED
"
,
"
opcs4_code
"
:
"
OPCS4
"
,
"
atc_code
"
:
"
ATC
"
,
"
med_code
"
:
None
,
"
cprd_code
"
:
None
,
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment