Skip to content
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

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

almostchristian
Copy link
Contributor

Description

  • Add subtract operator for Date and DateTime
  • Register FhirPath binary subtract operation for Date and DateTime.

Related issues

Closes #2599.

Testing

Hl7.FhirPath.R4.Tests.FhirPathEvaluatorTest.TestDateTimeArithmetic

FirelyTeam Checklist

  • Update the title of the PR to be succinct and less than 50 characters
  • Mark the PR with the label breaking change when this PR introduces breaking changes

Register FhirPath binary subtract operation for Date and DateTime.
Copy link
Member

@marcovisserFurore marcovisserFurore left a 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)
Copy link
Member

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)
Copy link
Member

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.

Copy link
Member

@marcovisserFurore marcovisserFurore left a 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!

@marcovisserFurore marcovisserFurore merged commit 4e6dcca into FirelyTeam:develop Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement FhirPath subtraction operations for dateTime and date in the default symbol table
2 participants