Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions app/controllers/de/dnpm/dip/rest/api/UseCaseController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ import de.dnpm.dip.service.{
UsageScope
}
import de.dnpm.dip.connector.{
FakeConnector,
HttpConnector
}
import HttpConnector.QueryParameters
import HttpConnector.QueryParameters._
import de.dnpm.dip.connector.HttpMethod._
import Orchestrator.{
Process,
Expand All @@ -65,6 +66,7 @@ import ValidationService.{
DataAcceptableWithIssues,
FatalIssuesDetected,
UnacceptableIssuesDetected,
Validate
}
import de.dnpm.dip.service.query.{
PatientFilter,
Expand Down Expand Up @@ -172,26 +174,17 @@ with AuthorizationOps[UserPermissions]
mvhService,
queryService
)(
sys.props.getOrElse(HttpConnector.Type.property,"broker") match {

case HttpConnector.Type(typ) =>
HttpConnector(
typ,
{
case LocalControllingInfo.Request(origin,criteria) =>
(
GET, s"/api/$useCasePrefix/peer2peer/local-controlling-info",
criteria match {
case Some(Controlling.Criteria(period)) =>
Map("episode.start" -> Seq(ISO_LOCAL_DATE.format(period.start))) ++
period.endOption.map(ISO_LOCAL_DATE.format).map(Seq(_)).map("episode.end" -> _)
case _ => Map.empty
}
)
HttpConnector {
case LocalControllingInfo.Request(origin,criteria) =>
(
GET, s"/api/$useCasePrefix/peer2peer/local-controlling-info",
criteria match {
case Some(Controlling.Criteria(period)) =>
QueryParameters("episode.start" -> ISO_LOCAL_DATE.format(period.start)) +
("episode.end" -> period.endOption.map(ISO_LOCAL_DATE.format))
case _ => Map.empty
}
)

case _ => FakeConnector[Future]
}
)

Expand Down Expand Up @@ -282,7 +275,7 @@ with AuthorizationOps[UserPermissions]
def validate =
Action.async(patientRecordParser){
req =>
validationService.validate(req.body).map {
(validationService ! Validate(req.body,persist = false)).map {
case Right(DataAcceptableWithIssues(_,report)) => Ok(Json.toJson(report))
case Right(_) => Ok
case Left(UnacceptableIssuesDetected(report)) => UnprocessableEntity(Json.toJson(report))
Expand Down Expand Up @@ -421,7 +414,7 @@ with AuthorizationOps[UserPermissions]
def validationReport(id: Id[Patient]) =
AuthorizedAction(ReadValidationReport).async {
req =>
(validationService.dataQualityReport(id))
(validationService.validationReport(id))
.map(_.map(Hyper(_)))
.map(JsonResult(_,s"Invalid Patient ID ${id.value}"))
}
Expand Down
20 changes: 10 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ libraryDependencies ++= Seq(
"de.dnpm.dip" %% "admin-service-impl" % "1.1.2",
"de.dnpm.dip" %% "catalog-service-api" % "1.1.1",
"de.dnpm.dip" %% "catalog-service-impl" % "1.1.1",
"de.dnpm.dip" %% "service-base" % "1.3.1",
"de.dnpm.dip" %% "mtb-validation-service-api" % "1.1.8",
"de.dnpm.dip" %% "mtb-validation-service-impl" % "1.1.8",
"de.dnpm.dip" %% "mtb-query-service-api" % "1.1.3",
"de.dnpm.dip" %% "mtb-query-service-impl" % "1.1.3",
"de.dnpm.dip" %% "rd-validation-service-api" % "1.1.8",
"de.dnpm.dip" %% "rd-validation-service-impl" % "1.1.8",
"de.dnpm.dip" %% "rd-query-service-api" % "1.1.4",
"de.dnpm.dip" %% "rd-query-service-impl" % "1.1.4",
"de.dnpm.dip" %% "connector-base" % "1.1.3",
"de.dnpm.dip" %% "service-base" % "1.4.0",
"de.dnpm.dip" %% "mtb-validation-service-api" % "1.1.9",
"de.dnpm.dip" %% "mtb-validation-service-impl" % "1.1.9",
"de.dnpm.dip" %% "mtb-query-service-api" % "1.1.4",
"de.dnpm.dip" %% "mtb-query-service-impl" % "1.1.4",
"de.dnpm.dip" %% "rd-validation-service-api" % "1.1.9",
"de.dnpm.dip" %% "rd-validation-service-impl" % "1.1.9",
"de.dnpm.dip" %% "rd-query-service-api" % "1.1.5",
"de.dnpm.dip" %% "rd-query-service-impl" % "1.1.5",
"de.dnpm.dip" %% "connector-base" % "1.2.0",
"de.dnpm.dip" %% "hp-ontology" % "1.2.0",
"de.dnpm.dip" %% "alpha-id-se" % "1.2.0",
"de.dnpm.dip" %% "orphanet-ordo" % "1.2.0",
Expand Down
Loading