Skip to content

Commit

Permalink
Renames patientId param to subject to:
Browse files Browse the repository at this point in the history
1. clarify the need to send a full reference "type/id" instead of just the ID
2. match the evaluator's name
  • Loading branch information
vitorpamplona committed Oct 14, 2023
1 parent 633b482 commit 2c91a3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ internal constructor(
* from a worker thread or it may throw [BlockingMainThreadException] exception.
*/
@WorkerThread
fun generateCarePlan(planDefinitionId: String, patientId: String): IBaseResource {
return generateCarePlan(planDefinitionId, patientId, encounterId = null)
fun generateCarePlan(planDefinitionId: String, subject: String): IBaseResource {
return generateCarePlan(planDefinitionId, subject, encounterId = null)
}

/**
Expand All @@ -198,14 +198,14 @@ internal constructor(
@WorkerThread
fun generateCarePlan(
planDefinitionId: String,
patientId: String,
subject: String,
encounterId: String?,
): IBaseResource {
return planDefinitionProcessor.apply(
/* id = */ IdType("PlanDefinition", planDefinitionId),
/* canonical = */ null,
/* planDefinition = */ null,
/* subject = */ patientId,
/* subject = */ subject,
/* encounterId = */ encounterId,
/* practitionerId = */ null,
/* organizationId = */ null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class FhirOperatorTest {
assertThat(
fhirOperator.generateCarePlan(
planDefinitionId = "plandefinition-RuleFilters-1.0.0",
patientId = "Reportable",
subject = "Patient/Reportable",
encounterId = "reportable-encounter",
),
)
Expand All @@ -114,7 +114,7 @@ class FhirOperatorTest {
val carePlan =
fhirOperator.generateCarePlan(
planDefinitionId = "MedRequest-Example",
patientId = "Patient/Patient-Example",
subject = "Patient/Patient-Example",
)

println(jsonParser.encodeResourceToString(carePlan))
Expand All @@ -138,7 +138,7 @@ class FhirOperatorTest {
val carePlan =
fhirOperator.generateCarePlan(
planDefinitionId = "Plan-Definition-Example",
patientId = "Patient/Female-Patient-Example",
subject = "Patient/Female-Patient-Example",
)

println(jsonParser.setPrettyPrint(true).encodeResourceToString(carePlan))
Expand Down

0 comments on commit 2c91a3e

Please sign in to comment.