Skip to content

Instantly share code, notes, and snippets.

@swoogles
Created September 4, 2014 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swoogles/62ec862a6e09242a5e27 to your computer and use it in GitHub Desktop.
Save swoogles/62ec862a6e09242a5e27 to your computer and use it in GitHub Desktop.
def getMobileUser(id: Int) = Action.async {
val f = Future {
DBAsyncExec {
implicit Connection =>
val user = MobileUser.findById(id)
val flatUser = user match {
case Some(simpleUser) =>
simpleUser
}
Some(PatientViewInfo(
user,
Location.findById(flatUser.primaryLocationIdx
),
Provider.findById(flatUser.primaryProviderIdx),
Location.findByPatron(flatUser.userIdx)
)
)
}
}(Contexts.blockingContext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment