Skip to content

Commit

Permalink
♻️ Refactor: Replace Quantity and number types in FhirPathFunction an…
Browse files Browse the repository at this point in the history
…notations with FHIR_DATA_TYPES values
  • Loading branch information
camemre49 committed Feb 11, 2025
1 parent 9caadc5 commit 126c3f2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:sum",
kind = "Method",
returnType = Seq("number"),
inputType = Seq("number")
returnType = Seq(FHIR_DATA_TYPES.DECIMAL),
inputType = Seq(FHIR_DATA_TYPES.DECIMAL)
)
def sum():Seq[FhirPathResult] = {
if(current.exists(!_.isInstanceOf[FhirPathNumber]))
Expand Down Expand Up @@ -83,7 +83,7 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:sum",
kind = "Function",
returnType = Seq("number"),
returnType = Seq(FHIR_DATA_TYPES.DECIMAL),
inputType = Seq()
)
def sum(expr:ExpressionContext):Seq[FhirPathResult] = {
Expand Down Expand Up @@ -130,7 +130,7 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:avg",
kind = "Function",
returnType = Seq("number"),
returnType = Seq(FHIR_DATA_TYPES.DECIMAL),
inputType = Seq()
)
def avg(expr:ExpressionContext):Seq[FhirPathResult] = {
Expand Down Expand Up @@ -163,8 +163,8 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:avg",
kind = "Method",
returnType = Seq("number"),
inputType = Seq("number")
returnType = Seq(FHIR_DATA_TYPES.DECIMAL),
inputType = Seq(FHIR_DATA_TYPES.DECIMAL)
)
def avg():Seq[FhirPathResult] = {
if(current.exists(!_.isInstanceOf[FhirPathNumber]))
Expand Down Expand Up @@ -200,8 +200,8 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:min",
kind = "Method",
returnType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity"),
inputType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity")
returnType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY),
inputType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY)
)
def min():Seq[FhirPathResult] = {
if(current.exists(c => c.isInstanceOf[FhirPathComplex] || c.isInstanceOf[FhirPathBoolean]))
Expand Down Expand Up @@ -248,7 +248,7 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:min",
kind = "Function",
returnType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity"),
returnType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY),
inputType = Seq()
)
def min(expr:ExpressionContext):Seq[FhirPathResult] = {
Expand Down Expand Up @@ -299,7 +299,7 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:max",
kind = "Function",
returnType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity"),
returnType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY),
inputType = Seq()
)
def max(expr:ExpressionContext):Seq[FhirPathResult] = {
Expand Down Expand Up @@ -342,8 +342,8 @@ class FhirPathAggFunctions(context:FhirPathEnvironment, current:Seq[FhirPathResu
detail = "agg",
label = "agg:max",
kind = "Method",
returnType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity"),
inputType = Seq(FHIR_DATA_TYPES.STRING, "number", FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, "quantity")
returnType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY),
inputType = Seq(FHIR_DATA_TYPES.STRING, FHIR_DATA_TYPES.DECIMAL, FHIR_DATA_TYPES.DATETIME, FHIR_DATA_TYPES.TIME, FHIR_DATA_TYPES.QUANTITY)
)
def max():Seq[FhirPathResult] = {
if(current.exists(c => c.isInstanceOf[FhirPathComplex] || c.isInstanceOf[FhirPathBoolean]))
Expand Down
Loading

0 comments on commit 126c3f2

Please sign in to comment.