Skip to content

Commit

Permalink
preTheater form added
Browse files Browse the repository at this point in the history
  • Loading branch information
merovingienne committed Jul 10, 2017
1 parent 51cf300 commit f349145
Show file tree
Hide file tree
Showing 7 changed files with 495 additions and 297 deletions.
31 changes: 0 additions & 31 deletions api/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -161,38 +161,7 @@
</exclusions> </exclusions>
</dependency> </dependency>


<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7</version>
<scope>compile</scope>
</dependency>




<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.hsqldb/hsqldb &ndash;&gt;--> <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.hsqldb/hsqldb &ndash;&gt;-->
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ public boolean isOutsideAvailableTimes() {


Interval available = otService.getLocationAvailableTime(location, start.toLocalDate()); Interval available = otService.getLocationAvailableTime(location, start.toLocalDate());
Interval scheduled = Interval.of(start.toInstant(), end.toInstant()); Interval scheduled = Interval.of(start.toInstant(), end.toInstant());
Interval overlap = scheduled.intersection(available); Interval overlap = null;
return !scheduled.equals(overlap); if (available.isConnected(scheduled)){
overlap = scheduled.intersection(available);
return !scheduled.equals(overlap);
}

return true;
} }


public Surgery getSurgery() { public Surgery getSurgery() {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/scheduler/scoreRules.drl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rule "firstComeFirstServed"
$surgery: PlannedSurgery($start : start, start != null, location != null) $surgery: PlannedSurgery($start : start, start != null, location != null)
then then
ZonedDateTime $created = ZonedDateTime.ofInstant($surgery.getSurgery().getDateCreated().toInstant(), ZoneId.systemDefault()); ZonedDateTime $created = ZonedDateTime.ofInstant($surgery.getSurgery().getDateCreated().toInstant(), ZoneId.systemDefault());
int hours = Duration.between($created, $start).toHours(); int hours = (int) Duration.between($created, $start).toHours();


scoreHolder.addSoftConstraintMatch(kcontext, -hours); scoreHolder.addSoftConstraintMatch(kcontext, -hours);
end end
Loading

0 comments on commit f349145

Please sign in to comment.