Skip to content

Commit

Permalink
✨ feat: Implement Patient-everything operation to retrieve all resour…
Browse files Browse the repository at this point in the history
…ces linked to a patient or all patients
  • Loading branch information
Tuncay Namli committed Oct 25, 2024
1 parent bd3d6bb commit 5d22f83
Show file tree
Hide file tree
Showing 5 changed files with 19,673 additions and 17,944 deletions.
3 changes: 2 additions & 1 deletion onfhir-common/src/main/scala/io/onfhir/api/api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@ package object api {
"http://hl7.org/fhir/OperationDefinition/ValueSet-expand" -> "io.onfhir.operation.ExpandOperationHandler",
"http://hl7.org/fhir/OperationDefinition/Composition-document" -> "io.onfhir.operation.DocumentOperationHandler",
"http://hl7.org/fhir/OperationDefinition/Observation-lastn" -> "io.onfhir.operation.LastNObservationOperationHandler",
"http://onfhir.io/fhir/OperationDefinition/import" -> "io.onfhir.operation.BulkOperationHandler"
"http://onfhir.io/fhir/OperationDefinition/import" -> "io.onfhir.operation.BulkOperationHandler",
"http://hl7.org/fhir/OperationDefinition/Patient-everything" -> "io.onfhir.operation.PatientEverythingOperationHandler"
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,15 @@ class FHIROperationHandler(transactionSession: Option[TransactionSession] = None
Some(s"Cardinality of Parameter '${paramDef.name}' (${values.size}) is not matching with expected (${paramDef.max}) for the operation '${operationConf.name}', it cannot be given as a part of URL!"),
Nil)))
else {
val paramValue = values.map(FHIRApiValidator.parseAndValidatePrimitive(_, paramDef.pType.get).map(FHIRSimpleOperationParam))
val paramValue =
paramDef.pType.get match {
//Due to replacement of '+' sign in queries with empty space
case FHIR_DATA_TYPES.INSTANT | FHIR_DATA_TYPES.DATETIME =>
values.map(_.replace(' ', '+')).map(FHIRApiValidator.parseAndValidatePrimitive(_, paramDef.pType.get).map(FHIRSimpleOperationParam))
case _ =>
values.map(FHIRApiValidator.parseAndValidatePrimitive(_, paramDef.pType.get).map(FHIRSimpleOperationParam))
}

if(paramValue.exists(_.isEmpty))
Right(Seq(OutcomeIssue(
FHIRResponse.SEVERITY_CODES.ERROR, //fatal
Expand Down
Loading

0 comments on commit 5d22f83

Please sign in to comment.