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
b5f81db2
Commit
b5f81db2
authored
Aug 21, 2015
by
R.W.Majeed
Browse files
static createInstance will use supplied id and source information
parent
b2ad31fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
histream-core/src/main/java/de/sekmi/histream/impl/SimplePatientExtension.java
View file @
b5f81db2
...
...
@@ -23,18 +23,29 @@ package de.sekmi.histream.impl;
import
de.sekmi.histream.Extension
;
import
de.sekmi.histream.Observation
;
import
de.sekmi.histream.ext.ExternalSourceType
;
import
de.sekmi.histream.ext.Patient
;
public
class
SimplePatientExtension
implements
Extension
<
PatientImpl
>{
private
final
static
Class
<?>[]
TYPES
=
new
Class
<?>[]{
Patient
.
class
,
PatientImpl
.
class
};
@Override
public
Class
<?>[]
getInstanceTypes
()
{
return
TYPES
;}
@Override
public
PatientImpl
createInstance
(
Object
...
args
)
{
// TODO use string patient id as identification
return
new
PatientImpl
();
if
(
args
.
length
!=
2
||
!(
args
[
0
]
instanceof
String
)
||
!(
args
[
1
]
instanceof
ExternalSourceType
)
){
throw
new
IllegalArgumentException
(
"need String patid, ExternalSourceType source"
);
}
PatientImpl
p
=
new
PatientImpl
();
p
.
setId
((
String
)
args
[
0
]);
ExternalSourceType
s
=
(
ExternalSourceType
)
args
[
1
];
p
.
setSourceId
(
s
.
getSourceId
());
p
.
setSourceTimestamp
(
s
.
getSourceTimestamp
());
return
p
;
}
@Override
...
...
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