Address review comments
This commit is contained in:
parent
c7de85339c
commit
1f37cdd8cf
|
@ -1258,7 +1258,7 @@ public enum Pointcut {
|
|||
|
||||
/**
|
||||
* <b>Storage Hook:</b>
|
||||
* Invoked when a resource delete operation is about to fail due to referential integrity conflicts.
|
||||
* Invoked when a resource delete operation is about to fail due to referential integrity hcts.
|
||||
* <p>
|
||||
* Hooks will have access to the list of resources that have references to the resource being deleted.
|
||||
* </p>
|
||||
|
|
|
@ -149,12 +149,12 @@ ca.uhn.fhir.jpa.dao.predicate.PredicateBuilderReference.invalidResourceType=Inva
|
|||
|
||||
ca.uhn.fhir.jpa.dao.index.IdHelperService.nonUniqueForcedId=Non-unique ID specified, can not process request
|
||||
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.missingPartitionIdOrName=Partition must have an ID and a Name
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.cantCreatePartition0=Can not create a partition with ID 0 (this is a reserved value)
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.unknownPartitionId=No partition exists with ID {0}
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.invalidName=Partition name "{0}" is not valid
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.cantCreateDuplicatePartitionName=Partition name "{0}" is already defined
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.cantDeleteDefaultPartition=Can not delete default partition
|
||||
ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.cantRenameDefaultPartition=Can not rename default partition
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.missingPartitionIdOrName=Partition must have an ID and a Name
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.cantCreatePartition0=Can not create a partition with ID 0 (this is a reserved value)
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.unknownPartitionId=No partition exists with ID {0}
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.invalidName=Partition name "{0}" is not valid
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.cantCreateDuplicatePartitionName=Partition name "{0}" is already defined
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.cantDeleteDefaultPartition=Can not delete default partition
|
||||
ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.cantRenameDefaultPartition=Can not rename default partition
|
||||
|
||||
ca.uhn.fhir.rest.server.interceptor.partition.RequestTenantPartitionInterceptor.unknownTenantName=Unknown tenant: {0}
|
||||
|
|
|
@ -73,7 +73,7 @@ The criteria for determining the partition will depend on your use case. For exa
|
|||
|
||||
* If you are implementing multi-tenancy the partition might be determined by using the [Request Tenant ID](/docs/server_plain/multitenancy.html). It could also be determined by looking at request headers, or the authorized user/session context, etc.
|
||||
|
||||
* If you are implementing segmented data partitioning, the partition might be determined by examining the actpartitionInterceptorHeadersual resource being created, by the identity of the sending system, etc.
|
||||
* If you are implementing segmented data partitioning, the partition might be determined by examining the actual resource being created, by the identity of the sending system, etc.
|
||||
|
||||
## Identify Partition for Read (Optional)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**This page is a work in progress. It is not yet comprehensive.**
|
||||
|
||||
It contains a description of the tables within the HAPI FHIR JPA database. Note that columns are shown using Java datatypes as opposed to SQL datatypes, because the exact SQL datatype used will vary depending on the underlying database platform.
|
||||
It contains a description of the tables within the HAPI FHIR JPA database. Note that columns are shown using Java datatypes as opposed to SQL datatypes, because the exact SQL datatype used will vary depending on the underlying database platform. The schema creation scripts can be used to determine the underlying column types.
|
||||
|
||||
# Background: Persistent IDs (PIDs)
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ import ca.uhn.fhir.jpa.entity.Search;
|
|||
import ca.uhn.fhir.jpa.graphql.JpaStorageServices;
|
||||
import ca.uhn.fhir.jpa.interceptor.JpaConsentContextServices;
|
||||
import ca.uhn.fhir.jpa.model.sched.ISchedulerService;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionConfigSvc;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
|
||||
import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperService;
|
||||
import ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl;
|
||||
import ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl;
|
||||
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
|
||||
import ca.uhn.fhir.jpa.partition.RequestPartitionHelperService;
|
||||
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
|
||||
|
@ -241,8 +241,8 @@ public abstract class BaseConfig {
|
|||
|
||||
@Bean
|
||||
@Lazy
|
||||
public IPartitionConfigSvc partitionConfigSvc() {
|
||||
return new PartitionConfigSvcImpl();
|
||||
public IPartitionLookupSvc partitionConfigSvc() {
|
||||
return new PartitionLookupSvcImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -33,5 +33,5 @@ public interface IResourceIndexedCompositeStringUniqueDao extends JpaRepository<
|
|||
ResourceIndexedCompositeStringUnique findByQueryString(@Param("str") String theQueryString);
|
||||
|
||||
@Query("SELECT r FROM ResourceIndexedCompositeStringUnique r WHERE r.myResourceId = :resId")
|
||||
List<ResourceIndexedCompositeStringUnique> findAllForResourceId(@Param("resId") Long theResourceId);
|
||||
List<ResourceIndexedCompositeStringUnique> findAllForResourceIdForUnitTest(@Param("resId") Long theResourceId);
|
||||
}
|
||||
|
|
|
@ -304,20 +304,7 @@ public class IdHelperService {
|
|||
.map(t -> t.getIdPartAsLong())
|
||||
.collect(Collectors.toList());
|
||||
if (!pids.isEmpty()) {
|
||||
Collection<Object[]> lookup;
|
||||
if (theRequestPartitionId != null) {
|
||||
if (theRequestPartitionId.getPartitionId() != null) {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePidInPartition(pids, theRequestPartitionId.getPartitionId());
|
||||
} else {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePidInPartitionNull(pids);
|
||||
}
|
||||
} else {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePid(pids);
|
||||
}
|
||||
lookup
|
||||
.stream()
|
||||
.map(t -> new ResourceLookup((String) t[0], (Long) t[1], (Date) t[2]))
|
||||
.forEach(retVal::add);
|
||||
resolvePids(theRequestPartitionId, pids, retVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,6 +359,23 @@ public class IdHelperService {
|
|||
return retVal;
|
||||
}
|
||||
|
||||
private void resolvePids(RequestPartitionId theRequestPartitionId, List<Long> thePidsToResolve, List<IResourceLookup> theTarget) {
|
||||
Collection<Object[]> lookup;
|
||||
if (theRequestPartitionId != null) {
|
||||
if (theRequestPartitionId.getPartitionId() != null) {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePidInPartition(thePidsToResolve, theRequestPartitionId.getPartitionId());
|
||||
} else {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePidInPartitionNull(thePidsToResolve);
|
||||
}
|
||||
} else {
|
||||
lookup = myResourceTableDao.findLookupFieldsByResourcePid(thePidsToResolve);
|
||||
}
|
||||
lookup
|
||||
.stream()
|
||||
.map(t -> new ResourceLookup((String) t[0], (Long) t[1], (Date) t[2]))
|
||||
.forEach(theTarget::add);
|
||||
}
|
||||
|
||||
public void clearCache() {
|
||||
myPersistentIdCache.invalidateAll();
|
||||
myResourceLookupCache.invalidateAll();
|
||||
|
|
|
@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.partition;
|
|||
|
||||
import ca.uhn.fhir.jpa.entity.PartitionEntity;
|
||||
|
||||
public interface IPartitionConfigSvc {
|
||||
public interface IPartitionLookupSvc {
|
||||
|
||||
/**
|
||||
* This is mostly here for unit test purposes. Regular code is not expected to call this method directly.
|
|
@ -44,13 +44,13 @@ import java.util.regex.Pattern;
|
|||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
|
||||
public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
||||
public class PartitionLookupSvcImpl implements IPartitionLookupSvc {
|
||||
|
||||
public static final int DEFAULT_PERSISTED_PARTITION_ID = 0;
|
||||
public static final String DEFAULT_PERSISTED_PARTITION_NAME = "DEFAULT";
|
||||
private static final String DEFAULT_PERSISTED_PARTITION_DESC = "Default partition";
|
||||
private static final Pattern PARTITION_NAME_VALID_PATTERN = Pattern.compile("[a-zA-Z0-9_-]+");
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(PartitionConfigSvcImpl.class);
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(PartitionLookupSvcImpl.class);
|
||||
|
||||
@Autowired
|
||||
private PlatformTransactionManager myTxManager;
|
||||
|
@ -115,7 +115,7 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
validatePartitionNameDoesntAlreadyExist(thePartition.getName());
|
||||
|
||||
if (thePartition.getId() == DEFAULT_PERSISTED_PARTITION_ID) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessage(PartitionConfigSvcImpl.class, "cantCreatePartition0");
|
||||
String msg = myFhirCtx.getLocalizer().getMessage(PartitionLookupSvcImpl.class, "cantCreatePartition0");
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
|
||||
Optional<PartitionEntity> existingPartitionOpt = myPartitionDao.findById(thePartition.getId());
|
||||
if (existingPartitionOpt.isPresent() == false) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "unknownPartitionId", thePartition.getId());
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "unknownPartitionId", thePartition.getId());
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
|
||||
if (DEFAULT_PERSISTED_PARTITION_ID == thePartition.getId()) {
|
||||
if (!DEFAULT_PERSISTED_PARTITION_NAME.equals(thePartition.getName())) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "cantRenameDefaultPartition");
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "cantRenameDefaultPartition");
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
}
|
||||
|
@ -161,13 +161,13 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
Validate.notNull(thePartitionId);
|
||||
|
||||
if (DEFAULT_PERSISTED_PARTITION_ID == thePartitionId) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "cantDeleteDefaultPartition");
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "cantDeleteDefaultPartition");
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
|
||||
Optional<PartitionEntity> partition = myPartitionDao.findById(thePartitionId);
|
||||
if (!partition.isPresent()) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "unknownPartitionId", thePartitionId);
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "unknownPartitionId", thePartitionId);
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
|
||||
|
@ -178,19 +178,19 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
|
||||
private void validatePartitionNameDoesntAlreadyExist(String theName) {
|
||||
if (myPartitionDao.findForName(theName).isPresent()) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "cantCreateDuplicatePartitionName", theName);
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "cantCreateDuplicatePartitionName", theName);
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateHaveValidPartitionIdAndName(PartitionEntity thePartition) {
|
||||
if (thePartition.getId() == null || isBlank(thePartition.getName())) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessage(PartitionConfigSvcImpl.class, "missingPartitionIdOrName");
|
||||
String msg = myFhirCtx.getLocalizer().getMessage(PartitionLookupSvcImpl.class, "missingPartitionIdOrName");
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
|
||||
if (!PARTITION_NAME_VALID_PATTERN.matcher(thePartition.getName()).matches()) {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "invalidName", thePartition.getName());
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "invalidName", thePartition.getName());
|
||||
throw new InvalidRequestException(msg);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
return myTxTemplate.execute(t -> myPartitionDao
|
||||
.findForName(theName)
|
||||
.orElseThrow(() -> {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "invalidName", theName);
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "invalidName", theName);
|
||||
return new IllegalArgumentException(msg);
|
||||
}));
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ public class PartitionConfigSvcImpl implements IPartitionConfigSvc {
|
|||
return myTxTemplate.execute(t -> myPartitionDao
|
||||
.findById(theId)
|
||||
.orElseThrow(() -> {
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionConfigSvcImpl.class, "unknownPartitionId", theId);
|
||||
String msg = myFhirCtx.getLocalizer().getMessageSanitized(PartitionLookupSvcImpl.class, "unknownPartitionId", theId);
|
||||
return new IllegalArgumentException(msg);
|
||||
}));
|
||||
}
|
|
@ -47,7 +47,7 @@ public class PartitionManagementProvider {
|
|||
@Autowired
|
||||
private FhirContext myCtx;
|
||||
@Autowired
|
||||
private IPartitionConfigSvc myPartitionConfigSvc;
|
||||
private IPartitionLookupSvc myPartitionConfigSvc;
|
||||
|
||||
/**
|
||||
* Add Partition:
|
||||
|
|
|
@ -52,7 +52,7 @@ public class RequestPartitionHelperService implements IRequestPartitionHelperSer
|
|||
@Autowired
|
||||
private IInterceptorBroadcaster myInterceptorBroadcaster;
|
||||
@Autowired
|
||||
private IPartitionConfigSvc myPartitionConfigSvc;
|
||||
private IPartitionLookupSvc myPartitionConfigSvc;
|
||||
@Autowired
|
||||
private FhirContext myFhirContext;
|
||||
@Autowired
|
||||
|
|
|
@ -6,7 +6,7 @@ import ca.uhn.fhir.interceptor.api.Pointcut;
|
|||
import ca.uhn.fhir.interceptor.executor.InterceptorService;
|
||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionConfigSvc;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
|
||||
import ca.uhn.fhir.test.BaseTest;
|
||||
import ca.uhn.fhir.jpa.bulk.IBulkDataExportSvc;
|
||||
import ca.uhn.fhir.jpa.entity.TermConcept;
|
||||
|
@ -110,7 +110,7 @@ public abstract class BaseJpaTest extends BaseTest {
|
|||
@Autowired
|
||||
protected ISearchCacheSvc mySearchCacheSvc;
|
||||
@Autowired
|
||||
protected IPartitionConfigSvc myPartitionConfigSvc;
|
||||
protected IPartitionLookupSvc myPartitionConfigSvc;
|
||||
|
||||
@After
|
||||
public void afterPerformCleanup() {
|
||||
|
|
|
@ -30,7 +30,7 @@ import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
|||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamString;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionConfigSvc;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
|
||||
import ca.uhn.fhir.jpa.provider.r4.JpaSystemProviderR4;
|
||||
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
||||
import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc;
|
||||
|
@ -103,7 +103,7 @@ public abstract class BaseJpaR4Test extends BaseJpaTest {
|
|||
private static IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> ourValueSetDao;
|
||||
|
||||
@Autowired
|
||||
protected IPartitionConfigSvc myPartitionConfigSvc;
|
||||
protected IPartitionLookupSvc myPartitionConfigSvc;
|
||||
@Autowired
|
||||
protected ITermReadSvc myHapiTerminologySvc;
|
||||
@Autowired
|
||||
|
|
|
@ -7,7 +7,7 @@ import ca.uhn.fhir.interceptor.model.RequestPartitionId;
|
|||
import ca.uhn.fhir.jpa.entity.PartitionEntity;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import ca.uhn.fhir.jpa.model.entity.*;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionConfigSvc;
|
||||
import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParamConstants;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
|
@ -76,7 +76,7 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
private int myPartitionId2;
|
||||
private boolean myHaveDroppedForcedIdUniqueConstraint;
|
||||
@Autowired
|
||||
private IPartitionConfigSvc myPartitionConfigSvc;
|
||||
private IPartitionLookupSvc myPartitionConfigSvc;
|
||||
|
||||
@After
|
||||
public void after() {
|
||||
|
@ -365,12 +365,11 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
createRequestId();
|
||||
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
|
||||
Organization org = new Organization();
|
||||
org.setName("org");
|
||||
IIdType orgId = myOrganizationDao.create(org).getId().toUnqualifiedVersionless();
|
||||
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
Patient p = new Patient();
|
||||
p.getMeta().addTag("http://system", "code", "diisplay");
|
||||
p.addName().setFamily("FAM");
|
||||
|
@ -436,7 +435,7 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
assertEquals(myPartitionDate, presents.get(0).getPartitionId().getPartitionDate());
|
||||
|
||||
// HFJ_IDX_CMP_STRING_UNIQ
|
||||
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAllForResourceId(patientId);
|
||||
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAllForResourceIdForUnitTest(patientId);
|
||||
assertEquals(1, uniques.size());
|
||||
assertEquals(myPartitionId, uniques.get(0).getPartitionId().getPartitionId().intValue());
|
||||
assertEquals(myPartitionDate, uniques.get(0).getPartitionId().getPartitionDate());
|
||||
|
@ -450,12 +449,11 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
createRequestId();
|
||||
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
|
||||
Organization org = new Organization();
|
||||
org.setName("org");
|
||||
IIdType orgId = myOrganizationDao.create(org).getId().toUnqualifiedVersionless();
|
||||
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
Patient p = new Patient();
|
||||
p.getMeta().addTag("http://system", "code", "diisplay");
|
||||
p.addName().setFamily("FAM");
|
||||
|
@ -521,7 +519,7 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
assertEquals(myPartitionDate, presents.get(0).getPartitionId().getPartitionDate());
|
||||
|
||||
// HFJ_IDX_CMP_STRING_UNIQ
|
||||
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAllForResourceId(patientId);
|
||||
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAllForResourceIdForUnitTest(patientId);
|
||||
assertEquals(1, uniques.size());
|
||||
assertEquals(null, uniques.get(0).getPartitionId().getPartitionId());
|
||||
assertEquals(myPartitionDate, uniques.get(0).getPartitionId().getPartitionDate());
|
||||
|
@ -533,13 +531,12 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
@Test
|
||||
public void testCreate_ForcedId_WithPartition() {
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
|
||||
Organization org = new Organization();
|
||||
org.setId("org");
|
||||
org.setName("org");
|
||||
IIdType orgId = myOrganizationDao.update(org).getId().toUnqualifiedVersionless();
|
||||
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
Patient p = new Patient();
|
||||
p.setId("pat");
|
||||
p.getManagingOrganization().setReferenceElement(orgId);
|
||||
|
@ -560,13 +557,12 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
@Test
|
||||
public void testCreate_ForcedId_NoPartition() {
|
||||
addCreateNoPartition();
|
||||
addCreateNoPartition();
|
||||
|
||||
Organization org = new Organization();
|
||||
org.setId("org");
|
||||
org.setName("org");
|
||||
IIdType orgId = myOrganizationDao.update(org).getId().toUnqualifiedVersionless();
|
||||
|
||||
addCreateNoPartition();
|
||||
Patient p = new Patient();
|
||||
p.setId("pat");
|
||||
p.getManagingOrganization().setReferenceElement(orgId);
|
||||
|
@ -585,13 +581,12 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
@Test
|
||||
public void testCreate_ForcedId_DefaultPartition() {
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
|
||||
Organization org = new Organization();
|
||||
org.setId("org");
|
||||
org.setName("org");
|
||||
IIdType orgId = myOrganizationDao.update(org).getId().toUnqualifiedVersionless();
|
||||
|
||||
addCreateNoPartitionId(myPartitionDate);
|
||||
Patient p = new Patient();
|
||||
p.setId("pat");
|
||||
p.getManagingOrganization().setReferenceElement(orgId);
|
||||
|
@ -613,10 +608,10 @@ public class PartitioningR4Test extends BaseJpaR4SystemTest {
|
|||
@Test
|
||||
public void testUpdateResourceWithPartition() {
|
||||
createRequestId();
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
|
||||
// Create a resource
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
addCreatePartition(myPartitionId, myPartitionDate);
|
||||
Patient p = new Patient();
|
||||
p.getMeta().addTag("http://system", "code", "diisplay");
|
||||
p.setActive(true);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class PartitionManagementProviderTest {
|
|||
@ClassRule
|
||||
public static RestfulServerRule ourServerRule = new RestfulServerRule(ourCtx);
|
||||
@MockBean
|
||||
private IPartitionConfigSvc myPartitionConfigSvc;
|
||||
private IPartitionLookupSvc myPartitionConfigSvc;
|
||||
@Autowired
|
||||
private PartitionManagementProvider myPartitionManagementProvider;
|
||||
private IGenericClient myClient;
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.jpa.partition.PartitionConfigSvcImpl.DEFAULT_PERSISTED_PARTITION_NAME;
|
||||
import static ca.uhn.fhir.jpa.partition.PartitionLookupSvcImpl.DEFAULT_PERSISTED_PARTITION_NAME;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
|
|
@ -67,7 +67,7 @@ public class DaoSubscriptionMatcherTest {
|
|||
public static class MyConfig {
|
||||
|
||||
@Bean
|
||||
public PartitionSettings partitionConfig() {
|
||||
public PartitionSettings partitionSettings() {
|
||||
return new PartitionSettings();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.springframework.test.context.TestPropertySource;
|
|||
public class TestSubscriptionConfig {
|
||||
|
||||
@Bean
|
||||
public PartitionSettings partitionConfig() {
|
||||
public PartitionSettings partitionSettings() {
|
||||
return new PartitionSettings();
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SubscriptionSubmitInterceptorLoaderTest {
|
|||
}
|
||||
|
||||
@Bean
|
||||
public PartitionSettings partitionConfig() {
|
||||
public PartitionSettings partitionSettings() {
|
||||
return new PartitionSettings();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue