Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames generateCarePlan's param from patientId to subject #2263

Merged
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
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
Loading