|
2 | 2 | * #%L |
3 | 3 | * HAPI FHIR JPA Server |
4 | 4 | * %% |
5 | | - * Copyright (C) 2014 - 2023 Smile CDR, Inc. |
| 5 | + * Copyright (C) 2014 - 2024 Smile CDR, Inc. |
6 | 6 | * %% |
7 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | 8 | * you may not use this file except in compliance with the License. |
|
23 | 23 | import ca.uhn.fhir.context.FhirVersionEnum; |
24 | 24 | import ca.uhn.fhir.context.RuntimeResourceDefinition; |
25 | 25 | import ca.uhn.fhir.i18n.Msg; |
| 26 | +import ca.uhn.fhir.interceptor.model.RequestPartitionId; |
26 | 27 | import ca.uhn.fhir.jpa.api.config.JpaStorageSettings; |
27 | 28 | import ca.uhn.fhir.jpa.api.dao.IDao; |
28 | 29 | import ca.uhn.fhir.jpa.dao.data.IResourceHistoryTableDao; |
|
55 | 56 | import ca.uhn.fhir.parser.LenientErrorHandler; |
56 | 57 | import ca.uhn.fhir.rest.api.Constants; |
57 | 58 | import ca.uhn.fhir.util.MetaUtil; |
| 59 | +import org.apache.commons.collections.CollectionUtils; |
58 | 60 | import org.apache.commons.lang3.Validate; |
59 | 61 | import org.hl7.fhir.instance.model.api.IAnyResource; |
60 | 62 | import org.hl7.fhir.instance.model.api.IBaseCoding; |
@@ -241,7 +243,7 @@ private <R extends IBaseResource> void populateResourcePartitionInformation( |
241 | 243 | myPartitionLookupSvc.getPartitionById(partitionId.getPartitionId()); |
242 | 244 | retVal.setUserData(Constants.RESOURCE_PARTITION_ID, persistedPartition.toRequestPartitionId()); |
243 | 245 | } else { |
244 | | - retVal.setUserData(Constants.RESOURCE_PARTITION_ID, null); |
| 246 | + retVal.setUserData(Constants.RESOURCE_PARTITION_ID, RequestPartitionId.defaultPartition()); |
245 | 247 | } |
246 | 248 | } |
247 | 249 | } |
@@ -394,11 +396,14 @@ private <R extends IResource> R populateResourceMetadataHapi( |
394 | 396 | secLabel.setSystem(nextTag.getSystem()); |
395 | 397 | secLabel.setCode(nextTag.getCode()); |
396 | 398 | secLabel.setDisplay(nextTag.getDisplay()); |
397 | | - // wipmb these technically support userSelected and version |
| 399 | + secLabel.setVersion(nextTag.getVersion()); |
| 400 | + Boolean userSelected = nextTag.getUserSelected(); |
| 401 | + if (userSelected != null) { |
| 402 | + secLabel.setUserSelected(userSelected); |
| 403 | + } |
398 | 404 | securityLabels.add(secLabel); |
399 | 405 | break; |
400 | 406 | case TAG: |
401 | | - // wipmb check xml, etc. |
402 | 407 | Tag e = new Tag(nextTag.getSystem(), nextTag.getCode(), nextTag.getDisplay()); |
403 | 408 | e.setVersion(nextTag.getVersion()); |
404 | 409 | // careful! These are Boolean, not boolean. |
@@ -459,7 +464,7 @@ private <R extends IBaseResource> R populateResourceMetadataRi( |
459 | 464 | res.getMeta().setLastUpdated(theEntity.getUpdatedDate()); |
460 | 465 | IDao.RESOURCE_PID.put(res, theEntity.getResourceId()); |
461 | 466 |
|
462 | | - if (theTagList != null) { |
| 467 | + if (CollectionUtils.isNotEmpty(theTagList)) { |
463 | 468 | res.getMeta().getTag().clear(); |
464 | 469 | res.getMeta().getProfile().clear(); |
465 | 470 | res.getMeta().getSecurity().clear(); |
|
0 commit comments