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
0a81fd62
Commit
0a81fd62
authored
Jan 23, 2017
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start element now optional for concepts in datasource xml
parent
2145a3b4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
10 deletions
+29
-10
histream-import/src/main/java/de/sekmi/histream/etl/config/Concept.java
...t/src/main/java/de/sekmi/histream/etl/config/Concept.java
+0
-1
histream-import/src/main/java/de/sekmi/histream/etl/config/DateTimeColumn.java
...ain/java/de/sekmi/histream/etl/config/DateTimeColumn.java
+12
-0
histream-import/src/main/java/de/sekmi/histream/etl/config/PatientTable.java
.../main/java/de/sekmi/histream/etl/config/PatientTable.java
+13
-0
histream-import/src/main/java/de/sekmi/histream/etl/config/Table.java
...ort/src/main/java/de/sekmi/histream/etl/config/Table.java
+3
-1
histream-import/src/test/resources/data/test-1-datasource.xml
...ream-import/src/test/resources/data/test-1-datasource.xml
+1
-8
No files found.
histream-import/src/main/java/de/sekmi/histream/etl/config/Concept.java
View file @
0a81fd62
...
...
@@ -28,7 +28,6 @@ public class Concept{
// TODO: value should contain also type (string,decimal,integer,...)
Column
<?>
value
;
StringColumn
unit
;
@XmlElement
(
required
=
true
)
DateTimeColumn
start
;
DateTimeColumn
end
;
@XmlElement
(
name
=
"modifier"
)
...
...
histream-import/src/main/java/de/sekmi/histream/etl/config/DateTimeColumn.java
View file @
0a81fd62
...
...
@@ -63,4 +63,16 @@ public class DateTimeColumn extends Column<DateTimeAccuracy>{
throw
new
ParseException
(
"Unable to parse date '"
+
input
+
"' in column '"
+
this
.
column
+
"'"
,
e
);
}
}
public
static
final
DateTimeColumn
alwaysNull
(){
DateTimeColumn
c
=
new
DateTimeColumn
(){
@Override
public
DateTimeAccuracy
valueFromString
(
String
input
){
return
null
;}
@Override
public
DateTimeAccuracy
valueOf
(
Object
input
){
return
null
;}
};
c
.
constantValue
=
""
;
c
.
na
=
""
;
return
c
;
}
}
\ No newline at end of file
histream-import/src/main/java/de/sekmi/histream/etl/config/PatientTable.java
View file @
0a81fd62
...
...
@@ -127,5 +127,18 @@ public class PatientTable extends Table<PatientRow> implements ConceptTable{
public
Concept
[]
getConcepts
()
{
return
concepts
;
}
@Override
protected
void
mapRegisterConcept
(
ColumnMap
map
,
Concept
c
)
throws
ParseException
{
if
(
true
){
throw
new
ParseException
(
"Patient table concepts not supported yet"
);
}
if
(
c
.
start
==
null
){
// patient table does not have a default timestamp, facts always need explici timestamps
throw
new
ParseException
(
"Start timestamp required for patient table concept '"
+
c
.
id
+
"'"
);
}
super
.
mapRegisterConcept
(
map
,
c
);
}
}
histream-import/src/main/java/de/sekmi/histream/etl/config/Table.java
View file @
0a81fd62
...
...
@@ -33,7 +33,9 @@ public abstract class Table<T extends FactRow> {
*/
protected
void
mapRegisterConcept
(
ColumnMap
map
,
Concept
c
)
throws
ParseException
{
if
(
c
.
start
==
null
){
throw
new
ParseException
(
"Start timestamp undefined for concept '"
+
c
.
id
+
"'"
);
// concepts without a start column will always have null start dates
// thus, the visit timestamp will be used instead
c
.
start
=
DateTimeColumn
.
alwaysNull
();
}
map
.
registerColumn
(
c
.
start
);
if
(
c
.
end
!=
null
){
...
...
histream-import/src/test/resources/data/test-1-datasource.xml
View file @
0a81fd62
...
...
@@ -86,14 +86,7 @@
<start
column=
"zeitpunkt"
format=
"d.M.u[ H[:m[:s]]]"
na=
""
/>
</concept>
<concept
id=
"bun"
>
<value
column=
"bun\ /,.]+"
na=
""
xsi:type=
"string"
>
<map>
<case
value=
"1"
set-value=
""
set-concept=
"enum1_1"
/>
<case
value=
"2"
set-value=
""
set-concept=
"enum1_2"
/>
<otherwise
action=
"drop-fact"
/>
</map>
</value>
<start
column=
"zeitpunkt"
format=
"d.M.u[ H[:m[:s]]]"
na=
""
/>
<value
column=
"bun\ /,.]+"
na=
""
xsi:type=
"decimal"
/>
</concept>
</mdat>
...
...
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