Skip to content

Commit

Permalink
add support for dateTime #243
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveregger committed Jun 24, 2024
1 parent aff4336 commit 3d5023b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2998,7 +2998,7 @@ private List<Base> opMinus(List<Base> left, List<Base> right, ExpressionNode exp
throw makeExceptionPlural(right.size(), expr, I18nConstants.FHIRPATH_RIGHT_VALUE, "-");
}
// matchbox patch #1655
if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || left.get(0).hasType("Date") || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) {
if (!right.get(0).isPrimitive() && !((left.get(0).isDateTime() || left.get(0).hasType("date") || left.get(0).hasType("dateTime") || "0".equals(left.get(0).primitiveValue()) || left.get(0).hasType("Quantity")) && right.get(0).hasType("Quantity"))) {
throw makeException(expr, I18nConstants.FHIRPATH_RIGHT_VALUE_WRONG_TYPE, "-", right.get(0).fhirType());
}

Expand All @@ -3017,7 +3017,7 @@ private List<Base> opMinus(List<Base> left, List<Base> right, ExpressionNode exp
result.add(qty.copy().setValue(qty.getValue().abs()));
}
// matchbox patch #1655
} else if ((l.isDateTime() || l.hasType("Date")) && r.hasType("Quantity")) {
} else if ((l.isDateTime() || l.hasType("date") || left.get(0).hasType("dateTime")) && r.hasType("Quantity")) {
DateTimeType dl = l instanceof DateTimeType ? (DateTimeType) l : new DateTimeType(l.primitiveValue());
result.add(dateAdd(dl, (Quantity) r, true, expr));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"url": "urn:dateTime",
"valueDate": "2023-09-25T13:19:13.502Z"
"valueDateTime": "2023-09-25T13:19:13.502Z"
}
],
"id": "qrpatientsexeresponse"
Expand Down

0 comments on commit 3d5023b

Please sign in to comment.