Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
7
70102 Peace
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Midha, Rohit
70102 Peace
Commits
d1bdb439
Commit
d1bdb439
authored
1 year ago
by
ur23
Browse files
Options
Downloads
Patches
Plain Diff
parsing_mesage_types1.0
parent
fed72bef
No related branches found
No related tags found
1 merge request
!6
Parsing MLLP
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
constants.py
+1
-1
1 addition, 1 deletion
constants.py
main.py
+1
-1
1 addition, 1 deletion
main.py
utils.py
+6
-2
6 additions, 2 deletions
utils.py
with
8 additions
and
4 deletions
constants.py
+
1
−
1
View file @
d1bdb439
...
@@ -3,7 +3,7 @@ MLLP_START_CHAR = b"\x0b"
...
@@ -3,7 +3,7 @@ MLLP_START_CHAR = b"\x0b"
MLLP_END_CHAR
=
b
"
\x1c\x0d
"
MLLP_END_CHAR
=
b
"
\x1c\x0d
"
# Path to load and store the trained Decision Tree model
# Path to load and store the trained Decision Tree model
DT_MODEL_PATH
=
"
model/
dt_model.joblib
"
DT_MODEL_PATH
=
"
dt_model.joblib
"
ON_DISK_DB_PATH
=
"
database.db
"
ON_DISK_DB_PATH
=
"
database.db
"
# Map for AKI Label
# Map for AKI Label
...
...
This diff is collapsed.
Click to expand it.
main.py
+
1
−
1
View file @
d1bdb439
...
@@ -34,7 +34,7 @@ def start_server(host="0.0.0.0", port=8440):
...
@@ -34,7 +34,7 @@ def start_server(host="0.0.0.0", port=8440):
print
(
category
,
mrn
,
data
,
'
\n
'
)
print
(
category
,
mrn
,
data
,
'
\n
'
)
# Create and send ACK message
# Create and send ACK message
ack_message
=
create_acknowledgement
(
message
)
ack_message
=
create_acknowledgement
()
sock
.
sendall
(
ack_message
)
sock
.
sendall
(
ack_message
)
else
:
else
:
print
(
"
No valid MLLP message received.
"
)
print
(
"
No valid MLLP message received.
"
)
...
...
This diff is collapsed.
Click to expand it.
utils.py
+
6
−
2
View file @
d1bdb439
...
@@ -20,7 +20,8 @@ def parse_hl7_message(hl7_data):
...
@@ -20,7 +20,8 @@ def parse_hl7_message(hl7_data):
"""
"""
Parses the HL7 message and returns the parsed message object.
Parses the HL7 message and returns the parsed message object.
"""
"""
message
=
hl7
.
parse
(
hl7_data
.
decode
(
"
utf-8
"
))
hl7_string
=
hl7_data
.
decode
(
"
utf-8
"
).
replace
(
'
\r
'
,
'
\n
'
)
message
=
hl7
.
parse
(
hl7_string
)
return
message
return
message
...
@@ -88,7 +89,10 @@ def populate_test_results_table(db, path):
...
@@ -88,7 +89,10 @@ def populate_test_results_table(db, path):
def
parse_system_message
(
message
):
def
parse_system_message
(
message
):
"""
"""
Parses the HL7 message and returns the parsed message object.
Parses the HL7 message and returns components of respective message type: PAS, LIMS
Args:
- HL7 message object
Returns the category of message, MRN, [AGE, SEX] if PAS category or [DATE_BLOOD_TEST, CREATININE_VALUE] if LIMS
"""
"""
mrn
=
0
mrn
=
0
category
=
''
category
=
''
...
...
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