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

$apply operation error when specifying practitioner #2240 #2246

Merged
merged 3 commits into from
Apr 14, 2021
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 @@ -158,7 +158,7 @@ public void testSubjectPatient() {
// null, practitionerId, null, null, null, null, null, null);

Response response =
doPost(FHIRMediaType.APPLICATION_FHIR_JSON, false, false, planDefinitionId, subjects, null, null, "Organization/my-org", "user-type", "user-language", "user-task-context", "my-setting", "my-setting-context");
doPost(FHIRMediaType.APPLICATION_FHIR_JSON, false, false, planDefinitionId, subjects, null, "Practitioner/" + practitionerId, "Organization/my-org", "user-type", "user-language", "user-task-context", "my-setting", "my-setting-context");
assertEquals(response.getStatus(), 200);

CarePlan carePlan = response.readEntity(CarePlan.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,16 @@ private CarePlan transform(PlanDefinition planDefinition, List<String> subjects,
if (!altSubjectsRefs.isEmpty()) {
builder.supportingInfo(altSubjectsRefs);
}

}

// Encounter
if (encounter != null) {
builder.encounter(Reference.builder().reference(string(encounter)).build());
}

// Practitioner - the following block is used as there may be a cardinality of 0..* in the future.
List<Reference> careTeam = new ArrayList<>();
// Practitioner maps to a contributor
if (practitioner != null) {
careTeam.add(Reference.builder().reference(string(practitioner)).build());
}

if (!careTeam.isEmpty()) {
builder.careTeam(careTeam);
builder.contributor(Reference.builder().reference(string(practitioner)).build());
tbieste marked this conversation as resolved.
Show resolved Hide resolved
}

// Organization
Expand Down