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
d3916364
Commit
d3916364
authored
Aug 07, 2017
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rejectPatientChange defaults to previous behaviour (=false)
parent
3c2a644f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
.../main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
+9
-5
No files found.
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/PostgresVisitStore.java
View file @
d3916364
...
...
@@ -77,7 +77,8 @@ 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
;
/** if true, don't allow a change of patient for a given visit. */
private
boolean
rejectPatientChange
;
private
PreparedStatement
insert
;
private
PreparedStatement
insertMapping
;
...
...
@@ -122,7 +123,7 @@ public class PostgresVisitStore extends PostgresExtension<I2b2Visit> implements
this
.
idSourceDefault
=
"HIVE"
;
this
.
idSourceSeparator
=
':'
;
this
.
fetchSize
=
1000
;
this
.
verifyPatientId
=
tru
e
;
this
.
rejectPatientChange
=
fals
e
;
}
public
void
open
(
Connection
connection
,
String
projectId
)
throws
SQLException
{
visitCache
=
new
Hashtable
<>();
...
...
@@ -155,7 +156,11 @@ public class PostgresVisitStore extends PostgresExtension<I2b2Visit> implements
public
int
size
(){
return
visitCache
.
size
();
}
public
void
setRejectPatientChange
(
boolean
rejectPatientChange
){
this
.
rejectPatientChange
=
rejectPatientChange
;
}
private
void
loadMaxEncounterNum
()
throws
SQLException
{
try
(
Statement
s
=
db
.
createStatement
()
){
String
sql
=
"SELECT MAX(encounter_num) FROM visit_dimension"
;
...
...
@@ -454,14 +459,13 @@ 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
){
}
else
if
(
rejectPatientChange
){
// 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
;
}
...
...
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