Skip to content

Commit

Permalink
🐛 fix: Fix the bug in applySearchParameterPath for array of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncay NAMLI committed May 20, 2021
1 parent 88824f0 commit f1e92b8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,18 @@ object FHIRUtil {

result match {
case JNothing => Nil
case org.json4s.JsonAST.JArray(arr) => arr
case a:org.json4s.JsonAST.JArray => flattenJArray(a)
case _ => Seq(result)
}
}

private def flattenJArray(a:JArray):Seq[JValue] = {
a.arr.flatMap {
case sa:JArray => flattenJArray(sa)
case o => Seq(o)
}
}

/**
* Extract FHIR reference values from a resource
* @param refPath Path to the reference element e.g. Observation.subject --> subject
Expand Down

0 comments on commit f1e92b8

Please sign in to comment.