Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
abbb0b54
There was a problem fetching the pipeline metadata.
Commit
abbb0b54
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
main parser requires redcap calendar
parent
2b59bfff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!52
old import code
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
appointment-import/src/main/java/smash/appointment/parse/Main.java
+15
-0
15 additions, 0 deletions
...nt-import/src/main/java/smash/appointment/parse/Main.java
with
15 additions
and
0 deletions
appointment-import/src/main/java/smash/appointment/parse/Main.java
+
15
−
0
View file @
abbb0b54
package
smash.appointment.parse
;
package
smash.appointment.parse
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.List
;
...
@@ -29,14 +30,17 @@ public class Main {
...
@@ -29,14 +30,17 @@ public class Main {
Option
lihControls
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"LIH controls"
).
longOpt
(
"lih-controls"
).
build
();
Option
lihControls
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"LIH controls"
).
longOpt
(
"lih-controls"
).
build
();
Option
lihMappingControls
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"LIH controls mapping"
).
longOpt
(
"lih-mapping"
).
build
();
Option
lihMappingControls
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"LIH controls mapping"
).
longOpt
(
"lih-mapping"
).
build
();
Option
redCap
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"RedCap appointments"
).
longOpt
(
"red-cap"
).
build
();
Option
redCap
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"RedCap appointments"
).
longOpt
(
"red-cap"
).
build
();
Option
redCapCalendar
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"RedCap calendar sql"
).
longOpt
(
"red-cap-calendar"
).
build
();
Option
duplicates
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"duplicates"
).
longOpt
(
"duplicates"
).
build
();
Option
duplicates
=
Option
.
builder
().
required
().
argName
(
"file"
).
hasArg
().
desc
(
"duplicates"
).
longOpt
(
"duplicates"
).
build
();
options
.
addOption
(
agenda
);
options
.
addOption
(
agenda
);
options
.
addOption
(
subjects
);
options
.
addOption
(
subjects
);
options
.
addOption
(
controls
);
options
.
addOption
(
controls
);
options
.
addOption
(
flyingTeam
);
options
.
addOption
(
flyingTeam
);
options
.
addOption
(
lihControls
);
options
.
addOption
(
lihControls
);
options
.
addOption
(
lihMappingControls
);
options
.
addOption
(
lihMappingControls
);
options
.
addOption
(
redCap
);
options
.
addOption
(
redCap
);
options
.
addOption
(
redCapCalendar
);
options
.
addOption
(
duplicates
);
options
.
addOption
(
duplicates
);
CommandLineParser
parser
=
new
DefaultParser
();
CommandLineParser
parser
=
new
DefaultParser
();
...
@@ -83,6 +87,9 @@ public class Main {
...
@@ -83,6 +87,9 @@ public class Main {
String
redCapFile
=
line
.
getOptionValue
(
"red-cap"
);
String
redCapFile
=
line
.
getOptionValue
(
"red-cap"
);
appointmentDao
.
addAppointments
(
processRedCapAppointments
(
redCapFile
));
appointmentDao
.
addAppointments
(
processRedCapAppointments
(
redCapFile
));
String
redCapCalendarFile
=
line
.
getOptionValue
(
"red-cap-calendar"
);
appointmentDao
.
addAppointments
(
processRedCapCalendar
(
redCapCalendarFile
));
System
.
out
.
println
(
"delete from web_visit_appointment_types;"
);
System
.
out
.
println
(
"delete from web_visit_appointment_types;"
);
System
.
out
.
println
(
"delete from web_appointment_appointment_types;"
);
System
.
out
.
println
(
"delete from web_appointment_appointment_types;"
);
System
.
out
.
println
(
"delete from web_subject_languages;"
);
System
.
out
.
println
(
"delete from web_subject_languages;"
);
...
@@ -110,6 +117,14 @@ public class Main {
...
@@ -110,6 +117,14 @@ public class Main {
}
}
}
}
private
List
<
AppointmentEntry
>
processRedCapCalendar
(
String
redCapCalendarFile
)
throws
FileNotFoundException
,
IOException
{
RedcapCalendarParser
redcapCalendarParser
=
new
RedcapCalendarParser
();
redcapCalendarParser
.
setSubjectDao
(
subjectDao
);
Calendar
date
=
Calendar
.
getInstance
();
date
.
set
(
Calendar
.
HOUR
,
0
);
return
redcapCalendarParser
.
parse
(
redCapCalendarFile
,
date
);
}
private
void
removeDuplicates
(
String
duplicatesFile
)
throws
IOException
{
private
void
removeDuplicates
(
String
duplicatesFile
)
throws
IOException
{
logger
.
info
(
"PROCESSING FILE: "
+
duplicatesFile
);
logger
.
info
(
"PROCESSING FILE: "
+
duplicatesFile
);
DuplicateRemoveParser
parser
=
new
DuplicateRemoveParser
();
DuplicateRemoveParser
parser
=
new
DuplicateRemoveParser
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment