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

Rule apply patient export #4892

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
55305ad
Force Verify tests
tadgh May 3, 2023
71edea3
fix ITs (#4809)
fil512 May 3, 2023
5855ea9
Fix migrator error on Oracle (#4814)
jamesagnew May 4, 2023
2821201
Update clinical reasoning version (#4816)
barhodes May 4, 2023
b33263d
Opening the care-gaps endpoint for GET. (#4823)
chalmarm May 5, 2023
9af24ad
added version to mdm golden resource tag (#4820)
longma1 May 5, 2023
f97da3b
Update the changelog for 4697 to be more descriptive (#4827)
JPercival May 5, 2023
609bc53
Fixes a bug with tags. (#4813)
tadgh May 5, 2023
a8e823a
fix migration issue (#4830)
fil512 May 6, 2023
5212009
Create correct version enum
tadgh May 7, 2023
ab070ef
Remove superfluous migration
tadgh May 7, 2023
5fa92dc
fixing test (#4835)
TipzCM May 8, 2023
d63dc07
email subscription, throw NullPointerException (#4790)
samguntersmilecdr May 10, 2023
37bfbf0
Add docs for CR operations (#4855)
barhodes May 11, 2023
9d9df27
Add documentation for $care-gaps operation. (#4862)
chalmarm May 11, 2023
22c9a18
4853 validation does not error when display is not the same as the di…
StevenXLi May 11, 2023
99f58f5
fixing patient everything operator (#4845)
TipzCM May 11, 2023
c3ccfb3
fix link
tadgh May 12, 2023
1891a19
Move image file
tadgh May 12, 2023
f464113
Bundle resources containing over 100 references to the same Organizat…
lukedegruchy May 12, 2023
e8cc02f
added warn message and test (#4848)
longma1 May 12, 2023
681a21c
Issue 4804 full table scan on mpi link during mdm clear (#4805)
jmarchionatto May 12, 2023
30eea1b
Fix erroneous batch 2 $export 75% complete count when the job is COMP…
lukedegruchy May 12, 2023
cf8935e
disable wars (#4877)
fil512 May 14, 2023
2973b65
4868 fix paging hapi (#4870)
TipzCM May 15, 2023
0303120
Test, fix, and changelog
michaelabuckley May 15, 2023
680dcc0
4875-binary-access-write-doest-trigger-STORAGE-BINARY-ASSIGN-BLOB-ID-…
jmarchionatto May 15, 2023
35f7b52
Better partition resolution
michaelabuckley May 15, 2023
dd56b13
Add checks based on rule applier
tadgh May 15, 2023
0a8e516
Fix ordering failure due to hash set
tadgh May 15, 2023
cf19036
Allow empty auth interceptor
tadgh May 15, 2023
75e28ba
Fix batch job (bulk export) processed record count (#4879)
michaelabuckley May 15, 2023
3c788c1
Fix up operation type on invocation
tadgh May 15, 2023
835d6d2
Throw 404 when requesting $export of non-existent Group or Patient (#…
michaelabuckley May 15, 2023
9d9dc9a
Add more tests, make hack implementation for patient instance level o…
tadgh May 15, 2023
7d0813f
Tighten test name
tadgh May 15, 2023
879e5c9
Merge branch 'rel_6_6' into rule-apply-patient-export
tadgh May 16, 2023
792e755
Changelog
tadgh May 16, 2023
f60f6aa
Default method
tadgh May 16, 2023
b989710
remove dead method
tadgh May 16, 2023
c20eab6
Remove dead autowire
tadgh May 16, 2023
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
Prev Previous commit
Next Next commit
Bundle resources containing over 100 references to the same Organizat…
…ion will fail with HAPI-2207 (#4871)

* Add failing unit test.

* Fix JpaId Long equality comparison to use ! equals() instead of !=, which fails for different instances of the same Long value.

* Add changelog.
  • Loading branch information
lukedegruchy authored May 12, 2023
commit f46411363345e83894cf3b3342e726172a7a3207
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 4872
title: "POSTing a Bundle with over 100 references to the same resource will fail with HAPI-2207 'Multiple resources match'.
This has been fixed."
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
Expand Down Expand Up @@ -4113,6 +4114,41 @@ public void testTransactionWithInlineMatchUrlMultipleMatches() throws Exception

}

@Test
public void testOrganizationOver100ReferencesFromBundleNoMultipleResourcesMatchError() throws IOException {
myStorageSettings.setAllowInlineMatchUrlReferences(true);

// The bug involves a invalid Long equality comparison, so we need a generated organization ID much larger than 1.
IntStream.range(0, 150).forEach(myint -> {
Patient patient = new Patient();
patient.addIdentifier().setSystem("https://www.ghh.org/identifiers").setValue("condreftestpatid1");
myPatientDao.create(patient, mySrd);
});

final Organization organization = new Organization();
organization.addIdentifier().setSystem("https://github.com/synthetichealth/synthea")
.setValue("9395b8cb-702c-3c5d-926e-1c3524fd6560");
organization.setName("PCP1401");
myOrganizationDao.create(organization, mySrd);

// This bundle needs to have over 100 resources, each referring to the same organization above.
// If there are 100 or less, then TransactionProcessor.preFetchConditionalUrls() will work off the same Long instance for the Organization JpaId
// and the Long == Long equality comparison will work
final InputStream resourceAsStream = getClass().getResourceAsStream("/bundle-refers-to-same-organization.json");
assertNotNull(resourceAsStream);
final String input = IOUtils.toString(resourceAsStream, StandardCharsets.UTF_8);
final Bundle bundle = myFhirContext.newJsonParser().parseResource(Bundle.class, input);

try {
mySystemDao.transaction(mySrd, bundle);
} catch (PreconditionFailedException thePreconditionFailedException) {
if (thePreconditionFailedException.getMessage().contains(Msg.code(2207))) {
fail("This test has failed with HAPI-2207, exactly the condition we aim to prevent");
}
// else let the Exception bubble up
}
}

@Test
public void testTransactionWithInlineMatchUrlNoMatches() throws Exception {
myStorageSettings.setAllowInlineMatchUrlReferences(true);
Expand Down
Loading