Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
histream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raphael
histream
Commits
d18591ff
Commit
d18591ff
authored
Jul 29, 2017
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify patient id for visit retrieval and throw error on mismatch
parent
b94854d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
.../main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
+11
-1
No files found.
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
View file @
d18591ff
...
...
@@ -77,6 +77,7 @@ public class PostgresVisitStore extends PostgresExtension<I2b2Visit> implements
//private static char[] map_death_chars = {};
private
Hashtable
<
Integer
,
I2b2Visit
>
visitCache
;
private
Hashtable
<
String
,
I2b2Visit
>
idCache
;
private
boolean
verifyPatientId
;
private
PreparedStatement
insert
;
private
PreparedStatement
insertMapping
;
...
...
@@ -121,6 +122,7 @@ public class PostgresVisitStore extends PostgresExtension<I2b2Visit> implements
this
.
idSourceDefault
=
"HIVE"
;
this
.
idSourceSeparator
=
':'
;
this
.
fetchSize
=
1000
;
this
.
verifyPatientId
=
true
;
}
public
void
open
(
Connection
connection
,
String
projectId
)
throws
SQLException
{
visitCache
=
new
Hashtable
<>();
...
...
@@ -452,11 +454,19 @@ public class PostgresVisitStore extends PostgresExtension<I2b2Visit> implements
// commonly, the item is modified after a call to this method,
// but changes are written later via a call to update.
// (otherwise, the instance would need to know whether to perform INSERT or UPDATE)
}
else
if
(
verifyPatientId
){
// visit already existing
// verify that the patient number from the visit matches with the observation
if
(
visit
.
getPatientNum
()
!=
patient
.
getNum
()
){
// throw exception to abort processing
throw
new
AssertionError
(
"Patient_num mismatch between observation and visit"
,
null
);
}
}
return
visit
;
}
@Override
public
I2b2Visit
createInstance
(
Observation
fact
)
{
public
I2b2Visit
createInstance
(
Observation
fact
){
return
getOrCreateInstance
(
fact
.
getEncounterId
(),
fact
.
getExtension
(
I2b2Patient
.
class
),
fact
.
getSource
());
}
...
...
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