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

Rel 6 2 4 mb #4408

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c6c0952
jm wrong bundle entry url (#4213)
jmarchionatto Oct 28, 2022
bd28730
improved logging (#4217)
fil512 Oct 30, 2022
2ff11d8
Rel 6 1 3 mergeback (#4215)
tadgh Oct 31, 2022
92d7126
pin okio-jvm for kotlin vuln (#4216)
tadgh Oct 31, 2022
6a657d4
Fix UrlUtil.unescape() by not escaping "+" to " " if this is an "appl…
lukedegruchy Oct 31, 2022
a018360
Ks 20221031 migration lock (#4224)
fil512 Nov 1, 2022
f68d905
4207-getpagesoffset-set-to-total-number-of-resources-results-in-incon…
Nov 2, 2022
928ec86
Fix bug with MDM submit
tadgh Nov 3, 2022
eb739e4
fix
tadgh Nov 3, 2022
220bfeb
Version bump
tadgh Nov 3, 2022
3199728
4234 consent in conjunction with versionedapiconverterinterceptor fai…
tadgh Nov 3, 2022
b965347
Allow Batch2 transition from ERRORED to COMPLETE (#4242)
jamesagnew Nov 4, 2022
045ceb3
3685 When bulk exporting, if no resource type param is provided, defa…
KGJ-software Nov 4, 2022
e6b80d3
Add next version
tadgh Nov 4, 2022
a296299
bulk export permanently reusing cached results (#4249)
tadgh Nov 4, 2022
590ddf1
Fix broken test
tadgh Nov 7, 2022
52aa09f
Smile 4892 DocumentReference Attachment url (#4237)
nathandoef Nov 8, 2022
2be9e89
Overlapping SearchParameter with the same code and base are not allow…
Qingyixia Nov 10, 2022
15c74a4
ignore misfires in quartz
tadgh Nov 10, 2022
5e02ea1
Allowing Failures On Index Drops (#4272)
epeartree Nov 10, 2022
9cc8be5
Revert "ignore misfires in quartz"
tadgh Nov 11, 2022
7f67493
Ignore misfires in quartz (#4273)
tadgh Nov 11, 2022
1722812
Reindex Behaviour Issues (#4261)
nathandoef Nov 11, 2022
75cadad
Set official Version
tadgh Nov 11, 2022
cc51bc2
license
tadgh Nov 11, 2022
1bd060e
Fix up numbers
tadgh Nov 11, 2022
434d817
Fix up numbers
tadgh Nov 11, 2022
a2d01fc
Update numbers
tadgh Nov 11, 2022
642afed
wip
tadgh Nov 11, 2022
b9dfd43
fix numbers
tadgh Nov 11, 2022
d08a7a9
Fix test:
tadgh Nov 11, 2022
93ab52c
Fix more tests
tadgh Nov 12, 2022
cef36bd
TEMP FIX FOR BUILD
tadgh Nov 12, 2022
3f46aa1
wip
tadgh Nov 12, 2022
c6e7381
Updating version to: 6.2.1 post release.
markiantorno Nov 12, 2022
2a455c3
Add a whack of logging
tadgh Nov 14, 2022
a2ea7ff
wip
tadgh Nov 15, 2022
138be3d
add implementation
tadgh Nov 15, 2022
c19d17b
wip and test
tadgh Nov 15, 2022
8c896fc
wip
tadgh Nov 15, 2022
92b9270
last-second-fetch
tadgh Nov 15, 2022
483b88b
expose useful method
tadgh Nov 15, 2022
4d37441
remove 10000 limit
Nov 15, 2022
59558db
Strip some logging
tadgh Nov 15, 2022
1a373c8
Fix up logging
tadgh Nov 15, 2022
779867a
Unpublicize method
tadgh Nov 15, 2022
a75ac9b
Fix version
tadgh Nov 15, 2022
e244e7a
Make minor changes
tadgh Nov 15, 2022
15c328d
once again on 6.2.1
tadgh Nov 15, 2022
ea66e37
re-add version enum
tadgh Nov 15, 2022
d2a5eb3
add folder
tadgh Nov 15, 2022
969266b
fix test
tadgh Nov 15, 2022
c25bc8e
DIsable busted test
tadgh Nov 15, 2022
4b2ede2
Disable more broken tests
tadgh Nov 16, 2022
5e67399
Only submit queued chunks
tadgh Nov 16, 2022
df7e3df
Quiet log
tadgh Nov 16, 2022
71d8f80
Fix wrong pinned version
tadgh Nov 16, 2022
2606c4a
Updating version to: 6.2.2 post release.
markiantorno Nov 17, 2022
dddac97
fixes for https://github.com/hapifhir/hapi-fhir/issues/4277 and https…
jkiddo Nov 18, 2022
7b5d303
backport and changelog for 6.2.2
Nov 25, 2022
2cf06e5
Updating version to: 6.2.3 post release.
markiantorno Dec 1, 2022
2ee0cf9
fix https://simpaticois.atlassian.net/browse/SMILE-5781
Dec 14, 2022
1c15ac9
Version bump to 6.2.3-SNAPSHOT
jamesagnew Dec 16, 2022
d60c62c
Merge branch 'rel_6_2' of github.com:jamesagnew/hapi-fhir into rel_6_2
jamesagnew Dec 16, 2022
b8ca063
Auto retry on MDM Clear conflicts (#4398)
jamesagnew Jan 2, 2023
02a4d0a
Update to 6.2.3 again
tadgh Jan 3, 2023
85b8817
Update license dates
tadgh Jan 3, 2023
2dad377
Dont fail on batch2 double delivery (#4400)
jamesagnew Jan 4, 2023
3ba279b
Update docker for release ppipeline
tadgh Jan 4, 2023
9d46faa
Updating version to: 6.2.4 post release.
markiantorno Jan 4, 2023
d578e09
Add test and implementation to fix potential NPE in pre-show resource…
tadgh Dec 22, 2022
1e5993a
Fix up megeback
tadgh Jan 5, 2023
77bf387
update backport info
tadgh Jan 5, 2023
285043d
update backport info
tadgh Jan 5, 2023
81a577c
Updating version to: 6.2.5 post release.
markiantorno Jan 5, 2023
dbebfca
Merge branch 'master' into rel_6_2_4_mb
tadgh Jan 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
jm wrong bundle entry url (#4213)
* Bug test

* here you go

* Generate relative URIs for bundle entry.request.url, as specified

* Point jira issue in changelog

* Adjust tests to fixes

Co-authored-by: juan.marchionatto <[email protected]>
Co-authored-by: Tadgh <[email protected]>
  • Loading branch information
3 people committed Oct 28, 2022
commit c6c095219db3444aa81d4c7b3324d38977a198ff
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,6 @@ public ITransactionTyped<List<IBaseResource>> withResources(List<? extends IBase

return new TransactionExecutable<>(theResources);
}

}

private class UpdateInternal extends BaseSearch<IUpdateExecutable, IUpdateWithQueryTyped, MethodOutcome>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 4210
jira: SMILE-4685
title: "Generating Bundle with resources was setting `entry.request.url` as absolute url when it should be relative. This has been fixed"
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import ca.uhn.fhir.rest.server.exceptions.NotImplementedOperationException;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.CapabilityStatement;
import org.hl7.fhir.dstu3.model.CarePlan;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.PrimitiveType;
import org.hl7.fhir.dstu3.model.StringType;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

Expand Down Expand Up @@ -56,7 +58,27 @@ public void testConformanceContainsIncludesAndRevIncludes() {
assertTrue(searchInclude.stream().map(PrimitiveType::getValue).anyMatch(stringRevIncludes -> stringRevIncludes.equals("Patient:general-practitioner")));
assertEquals(searchInclude.size(), 4);
}
}

@Test
void testTransactionBundleEntryUri() {
CarePlan carePlan = new CarePlan();
carePlan.getText().setDivAsString("A CarePlan");
carePlan.setId("ACarePlan");
ourClient.create().resource(carePlan).execute();

// GET CarePlans from server
Bundle bundle = ourClient.search()
.byUrl(ourServerBase + "/CarePlan")
.returnBundle(Bundle.class).execute();

// Create and populate list of CarePlans
List<CarePlan> carePlans = new ArrayList<>();
bundle.getEntry().forEach(entry -> carePlans.add((CarePlan) entry.getResource()));

// Post CarePlans should not get: HAPI-2006: Unable to perform PUT, URL provided is invalid...
ourClient.transaction().withResources(carePlans).execute();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import ca.uhn.fhir.jpa.dao.data.ISearchDao;
import ca.uhn.fhir.jpa.entity.Search;
import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.util.QueryParameterUtils;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.primitive.InstantDt;
Expand All @@ -17,7 +16,6 @@
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
import ca.uhn.fhir.rest.api.SummaryEnum;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.client.api.IClientInterceptor;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.api.IHttpRequest;
Expand All @@ -30,7 +28,6 @@
import ca.uhn.fhir.rest.param.StringAndListParam;
import ca.uhn.fhir.rest.param.StringOrListParam;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
Expand Down Expand Up @@ -107,7 +104,6 @@
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.Patient;
import org.hl7.fhir.dstu3.model.Period;
import org.hl7.fhir.dstu3.model.Person;
import org.hl7.fhir.dstu3.model.PlanDefinition;
import org.hl7.fhir.dstu3.model.Practitioner;
import org.hl7.fhir.dstu3.model.ProcedureRequest;
Expand Down Expand Up @@ -2354,7 +2350,7 @@ public void testHistoryWithDeletedResource() {
assertEquals(1, ((Patient) history.getEntry().get(0).getResource()).getName().size());

assertEquals(HTTPVerb.DELETE, history.getEntry().get(1).getRequest().getMethodElement().getValue());
assertEquals("http:https://localhost:" + ourPort + "/fhir/context/Patient/" + id.getIdPart() + "/_history/2", history.getEntry().get(1).getRequest().getUrl());
assertEquals("Patient/" + id.getIdPart() + "/_history/2", history.getEntry().get(1).getRequest().getUrl());
assertEquals(null, history.getEntry().get(1).getResource());

assertEquals(id.withVersion("1").getValue(), history.getEntry().get(2).getResource().getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.Bundle.BundleType;
import org.hl7.fhir.r4.model.Bundle.HTTPVerb;
import org.hl7.fhir.r4.model.CarePlan;
import org.hl7.fhir.r4.model.Condition;
import org.hl7.fhir.r4.model.Enumerations.AdministrativeGender;
import org.hl7.fhir.r4.model.OperationOutcome;
Expand Down Expand Up @@ -331,4 +332,25 @@ private List<String> createPatients(int count) {
return ids;
}


@Test
void testTransactionBundleEntryUri() {
CarePlan carePlan = new CarePlan();
carePlan.getText().setDivAsString("A CarePlan");
carePlan.setId("ACarePlan");
myClient.create().resource(carePlan).execute();

// GET CarePlans from server
Bundle bundle = myClient.search()
.byUrl(ourServerBase + "/CarePlan")
.returnBundle(Bundle.class).execute();

// Create and populate list of CarePlans
List<CarePlan> carePlans = new ArrayList<>();
bundle.getEntry().forEach(entry -> carePlans.add((CarePlan) entry.getResource()));

// Post CarePlans should not get: HAPI-2006: Unable to perform PUT, URL provided is invalid...
myClient.transaction().withResources(carePlans).execute();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.jpa.model.util.UcumServiceUtil;
import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.term.ZipCollectionBuilder;
import ca.uhn.fhir.jpa.test.config.TestR4Config;
import ca.uhn.fhir.jpa.util.QueryParameterUtils;
Expand All @@ -25,7 +24,6 @@
import ca.uhn.fhir.rest.api.PreferReturnEnum;
import ca.uhn.fhir.rest.api.SearchTotalModeEnum;
import ca.uhn.fhir.rest.api.SummaryEnum;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.client.apache.ResourceEntity;
import ca.uhn.fhir.rest.client.api.IClientInterceptor;
import ca.uhn.fhir.rest.client.api.IGenericClient;
Expand All @@ -41,7 +39,6 @@
import ca.uhn.fhir.rest.param.StringAndListParam;
import ca.uhn.fhir.rest.param.StringOrListParam;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
Expand Down Expand Up @@ -71,7 +68,6 @@
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.apache.jena.rdf.model.ModelCon;
import org.hamcrest.Matchers;
import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator;
import org.hl7.fhir.instance.model.api.IAnyResource;
Expand Down Expand Up @@ -132,7 +128,6 @@
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Period;
import org.hl7.fhir.r4.model.Person;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.Procedure;
import org.hl7.fhir.r4.model.Quantity;
Expand Down Expand Up @@ -3285,7 +3280,7 @@ public void testHistoryWithDeletedResource() {
assertEquals(1, ((Patient) history.getEntry().get(0).getResource()).getName().size());

assertEquals(HTTPVerb.DELETE, history.getEntry().get(1).getRequest().getMethodElement().getValue());
assertEquals("http:https://localhost:" + ourPort + "/fhir/context/Patient/" + id.getIdPart() + "/_history/2", history.getEntry().get(1).getRequest().getUrl());
assertEquals("Patient/" + id.getIdPart() + "/_history/2", history.getEntry().get(1).getRequest().getUrl());
assertEquals(null, history.getEntry().get(1).getResource());

assertEquals(id.withVersion("1").getValue(), history.getEntry().get(2).getResource().getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.hamcrest.Matchers;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4b.model.Bundle;
import org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4b.model.CarePlan;
import org.hl7.fhir.r4b.model.CodeableConcept;
import org.hl7.fhir.r4b.model.Condition;
import org.hl7.fhir.r4b.model.DateTimeType;
import org.hl7.fhir.r4b.model.MedicationRequest;
import org.hl7.fhir.r4b.model.Observation;
import org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent;
import org.hl7.fhir.r4b.model.OperationOutcome;
import org.hl7.fhir.r4b.model.Organization;
import org.hl7.fhir.r4b.model.Parameters;
import org.hl7.fhir.r4b.model.Patient;
Expand Down Expand Up @@ -464,6 +461,28 @@ public void testEverythingPatientTypeWithTypeAndIdParameter() {
assertThat(ids, Matchers.not(hasItem(o2Id)));
}

@Test
void testTransactionBundleEntryUri() {
CarePlan carePlan = new CarePlan();
carePlan.getText().setDivAsString("A CarePlan");
carePlan.setId("ACarePlan");
myClient.create().resource(carePlan).execute();

// GET CarePlans from server
Bundle bundle = myClient.search()
.byUrl(ourServerBase + "/CarePlan")
.returnBundle(Bundle.class).execute();

// Create and populate list of CarePlans
List<CarePlan> carePlans = new ArrayList<>();
bundle.getEntry().forEach(entry -> carePlans.add((CarePlan) entry.getResource()));

// Post CarePlans should not get: HAPI-2006: Unable to perform PUT, URL provided is invalid...
myClient.transaction().withResources(carePlans).execute();
}



private IIdType createOrganization(String methodName, String s) {
Organization o1 = new Organization();
o1.setName(methodName + s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.CarePlan;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.Condition;
import org.hl7.fhir.r5.model.DateTimeType;
Expand Down Expand Up @@ -481,6 +482,27 @@ public void testEverythingPatientTypeWithTypeAndIdParameter() {
assertThat(ids, Matchers.not(hasItem(o2Id)));
}


@Test
void testTransactionBundleEntryUri() {
CarePlan carePlan = new CarePlan();
carePlan.getText().setDivAsString("A CarePlan");
carePlan.setId("ACarePlan");
myClient.create().resource(carePlan).execute();

// GET CarePlans from server
Bundle bundle = myClient.search()
.byUrl(ourServerBase + "/CarePlan")
.returnBundle(Bundle.class).execute();

// Create and populate list of CarePlans
List<CarePlan> carePlans = new ArrayList<>();
bundle.getEntry().forEach(entry -> carePlans.add((CarePlan) entry.getResource()));

// Post CarePlans should not get: HAPI-2006: Unable to perform PUT, URL provided is invalid...
myClient.transaction().withResources(carePlans).execute();
}

private IIdType createOrganization(String methodName, String s) {
Organization o1 = new Organization();
o1.setName(methodName + s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void addResourcesToBundle(List<IBaseResource> theResult, BundleTypeEnum t
if (httpVerb != null) {
entry.getRequest().getMethodElement().setValueAsString(httpVerb);
if (id != null) {
entry.getRequest().setUrl(id.getValue());
entry.getRequest().setUrl(id.toUnqualified().getValue());
}
}
if ("DELETE".equals(httpVerb)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void addResourcesToBundle(List<IBaseResource> theResult, BundleTypeEnum t
if (httpVerb != null) {
entry.getRequest().getMethodElement().setValueAsString(httpVerb);
if (id != null) {
entry.getRequest().setUrl(id.getValue());
entry.getRequest().setUrl(id.toUnqualified().getValue());
}
}
if ("DELETE".equals(httpVerb)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void addResourcesToBundle(List<IBaseResource> theResult, BundleTypeEnum t
if (httpVerb != null) {
entry.getRequest().getMethodElement().setValueAsString(httpVerb);
if (id != null) {
entry.getRequest().setUrl(id.getValue());
entry.getRequest().setUrl(id.toUnqualified().getValue());
}
}
if ("DELETE".equals(httpVerb)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void addResourcesToBundle(List<IBaseResource> theResult, BundleTypeEnum t
if (httpVerb != null) {
entry.getRequest().getMethodElement().setValueAsString(httpVerb);
if (id != null) {
entry.getRequest().setUrl(id.getValue());
entry.getRequest().setUrl(id.toUnqualified().getValue());
}
}
if ("DELETE".equals(httpVerb)) {
Expand Down