Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Raphael
histream
Commits
4c470947
Commit
4c470947
authored
Aug 15, 2017
by
R.W.Majeed
Browse files
improved logging
parent
5cf340e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/I2b2Patient.java
View file @
4c470947
...
...
@@ -241,5 +241,10 @@ public class I2b2Patient extends PatientImpl {
}
}
@Override
public
String
toString
(){
return
"I2b2Patient(num="
+
getNum
()+
", id="
+
getId
()+
", dob="
+
getBirthDate
()+
")"
;
}
}
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/PostgresPatientStore.java
View file @
4c470947
...
...
@@ -30,7 +30,6 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Timestamp
;
import
java.time.temporal.ChronoUnit
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Enumeration
;
...
...
@@ -234,18 +233,23 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme
private
void
batchLoad
()
throws
SQLException
{
try
(
ResultSet
rs
=
selectAll
.
executeQuery
()
){
int
count
=
0
;
while
(
rs
.
next
()
){
count
++;
I2b2Patient
patient
=
loadFromResultSet
(
rs
);
// put in numeric patient cache
patientCache
.
put
(
patient
.
getNum
(),
patient
);
}
log
.
info
(
"Loaded patient records: "
+
count
);
}
try
(
ResultSet
rs
=
selectAllIde
.
executeQuery
()
){
I2b2Patient
p
;
ArrayList
<
String
>
ids
=
new
ArrayList
<>(
16
);
// count loaded IDs for logging
int
total_count
=
0
,
project_count
=
0
;
int
num
=
-
1
;
// current patient number
while
(
rs
.
next
()
){
total_count
++;
if
(
num
==
-
1
){
// first patient
num
=
rs
.
getInt
(
1
);
}
else
if
(
num
!=
rs
.
getInt
(
1
)
){
...
...
@@ -274,6 +278,7 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme
if
(
rs
.
getString
(
4
).
equals
(
"A"
)
&&
rs
.
getString
(
5
).
equals
(
projectId
)
){
p
=
getCached
(
num
);
if
(
p
!=
null
){
project_count
++;
p
.
setId
(
id
);
p
.
markDirty
(
false
);
}
...
...
@@ -291,7 +296,11 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme
p
.
mergedIds
=
new
String
[
ids
.
size
()];
p
.
mergedIds
=
ids
.
toArray
(
p
.
mergedIds
);
}
}
}
log
.
info
(
"Loaded "
+
total_count
+
" aliases with "
+
project_count
+
" project specific IDs"
);
if
(
project_count
==
0
&&
total_count
>
0
){
log
.
warning
(
"No project specific patient IDs. Maybe wrong projectId?"
);
}
}
// fill idCache
...
...
Write
Preview
Supports
Markdown
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