finish getting tests passed
This commit is contained in:
parent
fc8150773c
commit
10589ea559
|
@ -1215,7 +1215,7 @@ public class FHIRPathEngine {
|
|||
return isBoolean(left, true) ? makeBoolean(true) : null;
|
||||
case Implies:
|
||||
Equality v = asBool(left);
|
||||
return v == Equality.False ? null : makeBoolean(true);
|
||||
return v == Equality.False ? makeBoolean(true) : null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -1610,15 +1610,7 @@ public class FHIRPathEngine {
|
|||
}
|
||||
|
||||
private Boolean compareDates(BaseDateTimeType left, BaseDateTimeType right) {
|
||||
// HumanDateTime l = HumanDateTime.fromXml(left.primitiveValue());
|
||||
// HumanDateTime r = HumanDateTime.fromXml(right.primitiveValue());
|
||||
// if (!l.overlaps(r))
|
||||
// return false;
|
||||
// else if (!l.canCompare(r))
|
||||
// return null;
|
||||
// else
|
||||
// return l.sameTime(r);
|
||||
return false;
|
||||
return left.equalsUsingFhirPathRules(right);
|
||||
}
|
||||
|
||||
private Boolean doEquals(Base left, Base right) {
|
||||
|
@ -2130,7 +2122,7 @@ public class FHIRPathEngine {
|
|||
else if (right.size() == 0)
|
||||
return makeNull();
|
||||
else switch (asBool(right)) {
|
||||
case False: return makeBoolean(false);
|
||||
case False: return eq == Equality.Null ? makeNull() : makeBoolean(false);
|
||||
case Null: return makeNull();
|
||||
case True: return makeBoolean(true);
|
||||
}
|
||||
|
|
|
@ -664,7 +664,7 @@
|
|||
<test inputfile="patient-example.xml"><expression>0.0 ~ 0</expression><output type="boolean">true</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 ~ @2012-04-15</expression><output type="boolean">true</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 ~ @2012-04-16</expression><output type="boolean">false</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 ~ @2012-04-15T10:00:00</expression><output type="boolean">true</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 ~ @2012-04-15T10:00:00</expression><output type="boolean">false</output></test>
|
||||
<!-- <test inputfile="patient-example.xml"><expression>name ~ name</expression><output type="boolean">true</output></test> -->
|
||||
<test inputfile="patient-example.xml"><expression>name.take(2).given ~ name.take(2).first().given | name.take(2).last().given</expression><output type="boolean">true</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>name.take(2).given ~ name.take(2).last().given | name.take(2).first().given</expression><output type="boolean">true</output></test>
|
||||
|
@ -686,7 +686,7 @@
|
|||
<test inputfile="patient-example.xml"><expression>0.0 !~ 0</expression><output type="boolean">false</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 !~ @2012-04-15</expression><output type="boolean">false</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 !~ @2012-04-16</expression><output type="boolean">true</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 !~ @2012-04-15T10:00:00</expression><output type="boolean">false</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>@2012-04-15 !~ @2012-04-15T10:00:00</expression><output type="boolean">true</output></test>
|
||||
<!-- <test inputfile="patient-example.xml"><expression>name !~ name</expression><output type="boolean">true</output></test> -->
|
||||
<test inputfile="patient-example.xml"><expression>name.take(2).given !~ name.take(2).first().given | name.take(2).last().given</expression><output type="boolean">false</output></test>
|
||||
<test inputfile="patient-example.xml"><expression>name.take(2).given !~ name.take(2).last().given | name.take(2).first().given</expression><output type="boolean">false</output></test>
|
||||
|
|
|
@ -31,22 +31,32 @@ public class BaseDateTimeTypeTest {
|
|||
assertFalse(compareDateTimes("2001-01-02", "2001-01-03"));
|
||||
// Different instant - Same timezone
|
||||
assertFalse(compareDateTimes("2001-01-02T11:22:33.444Z", "2001-01-02T11:22:33.445Z"));
|
||||
assertFalse(compareDateTimes("2001-01-02T11:22:33.445Z", "2001-01-02T11:22:33.444Z"));
|
||||
|
||||
// FHIRPath tests:
|
||||
assertFalse(compareDateTimes("1974-12-25", "1974-12-25T12:34:00+10:00"));
|
||||
assertFalse(compareDateTimes("1974-12-25T12:34:00+10:00", "1974-12-25"));
|
||||
assertFalse(compareDateTimes("1974-12-25", "1974-12-25T12:34:00-10:00"));
|
||||
assertFalse(compareDateTimes("1974-12-25T12:34:00-10:00", "1974-12-25"));
|
||||
assertFalse(compareDateTimes("1974-12-25", "1974-12-25T12:34:00Z"));
|
||||
assertFalse(compareDateTimes("1974-12-25T12:34:00Z", "1974-12-25"));
|
||||
assertFalse(compareDateTimes("2012-04-15", "2012-04-16"));
|
||||
assertFalse(compareDateTimes("2012-04-16", "2012-04-15"));
|
||||
assertFalse(compareDateTimes("2012-04-15T15:00:00", "2012-04-15T10:00:00"));
|
||||
assertFalse(compareDateTimes("2012-04-15T10:00:00", "2012-04-15T15:00:00"));
|
||||
assertFalse(compareDateTimes("2017-11-05T01:30:00.0-04:00", "2017-11-05T01:15:00.0-05:00"));
|
||||
assertFalse(compareDateTimes("2017-11-05T01:15:00.0-05:00", "2017-11-05T01:30:00.0-04:00"));
|
||||
assertNull(compareDateTimes("1974-12-25", "1974-12-25T12:34:00"));
|
||||
assertNull(compareDateTimes("2012-04-15", "2012-04-15T10:00:00"));
|
||||
assertNull(compareDateTimes("1974-12-25T12:34:00", "1974-12-25"));
|
||||
assertNull(compareDateTimes("2012-04-15T10:00:00", "2012-04-15"));
|
||||
assertNull(compareDateTimes("2012-04-15T15:00:00Z", "2012-04-15T10:00:00"));
|
||||
assertNull(compareDateTimes("2012-04-15T10:00:00", "2012-04-15T15:00:00Z"));
|
||||
assertTrue(compareDateTimes("1974-12-25", "1974-12-25"));
|
||||
assertTrue(compareDateTimes("2012-04-15", "2012-04-15"));
|
||||
assertTrue(compareDateTimes("2012-04-15T15:00:00+02:00", "2012-04-15T16:00:00+03:00"));
|
||||
assertTrue(compareDateTimes("2012-04-15T15:00:00+02:00", "2012-04-15T16:00:00+03:00"));
|
||||
assertTrue(compareDateTimes("2012-04-15T16:00:00+03:00", "2012-04-15T15:00:00+02:00"));
|
||||
assertTrue(compareDateTimes("2017-11-05T01:30:00.0-04:00", "2017-11-05T00:30:00.0-05:00"));
|
||||
assertTrue(compareDateTimes("2017-11-05T00:30:00.0-05:00", "2017-11-05T01:30:00.0-04:00"));
|
||||
|
||||
assertFalse(compareDateTimes("2016-12-02T13:00:00Z", "2016-11-02T10:00:00")); // no timezone, but cannot be the same time
|
||||
assertNull(compareDateTimes("2016-12-02T13:00:00Z", "2016-12-02T10:00:00")); // no timezone, might be the same time
|
||||
|
|
|
@ -413,7 +413,7 @@
|
|||
}
|
||||
},
|
||||
"message-infinite-loop.xml" : {
|
||||
"errorCount": 33
|
||||
"errorCount": 34
|
||||
},
|
||||
"slice-profile-and-local-patient.xml" : {
|
||||
"errorCount": 0,
|
||||
|
|
Loading…
Reference in New Issue