Skip to content

Commit

Permalink
Fix for empty PlanDef id (#3293)
Browse files Browse the repository at this point in the history
* Fix empty plan def id execution

* Fix spotless error
  • Loading branch information
hamza-vd authored May 31, 2024
1 parent f148a3a commit f64baa8
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -756,16 +756,18 @@ constructor(
questionnaireConfig: QuestionnaireConfig,
) {
questionnaireConfig.planDefinitions?.forEach { planId ->
kotlin
.runCatching {
fhirCarePlanGenerator.generateOrUpdateCarePlan(
planDefinitionId = planId,
subject = subject,
data = bundle,
generateCarePlanWithWorkflowApi = questionnaireConfig.generateCarePlanWithWorkflowApi,
)
}
.onFailure { Timber.e(it) }
if (planId.isNotEmpty()) {
kotlin
.runCatching {
fhirCarePlanGenerator.generateOrUpdateCarePlan(
planDefinitionId = planId,
subject = subject,
data = bundle,
generateCarePlanWithWorkflowApi = questionnaireConfig.generateCarePlanWithWorkflowApi,
)
}
.onFailure { Timber.e(it) }
}
}
}

Expand Down

0 comments on commit f64baa8

Please sign in to comment.