-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subtract operator for Date and DateTime. #2600
Add subtract operator for Date and DateTime. #2600
Conversation
Register FhirPath binary subtract operation for Date and DateTime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @almostchristian,
Thank you for your second PR; it's greatly appreciated.
I was surprised to see that the subtraction operation had not been implemented yet, and I'm grateful that you've addressed it.
I only have a few minor naming corrections to suggest during this review.
@@ -141,35 +141,48 @@ private static bool tryParse(string representation, out Date value) | |||
return success; | |||
} | |||
|
|||
public static Date operator -(Date dateValue, Quantity addValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest naming the quantity here as subtractValue
instead of addValue
.
@@ -150,50 +150,63 @@ private static bool tryParse(string representation, out DateTime value) | |||
return success; | |||
} | |||
|
|||
public static DateTime operator -(DateTime dateTimeValue, Quantity addValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest naming the quantity here as subtractValue
instead of addValue
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your contribution, @almostchristian, is greatly appreciated. Thank you for your valuable input!
Description
Related issues
Closes #2599.
Testing
Hl7.FhirPath.R4.Tests.FhirPathEvaluatorTest.TestDateTimeArithmetic
FirelyTeam Checklist