-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOP-682: Changed the way how Tasks refer to ActivityDefinitions as de…
…cided and used in kt2 simplifier v0.11.0
- Loading branch information
1 parent
087c596
commit 5919154
Showing
6 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/nl/koppeltaal/spring/boot/starter/smartservice/utils/ExtensionUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package nl.koppeltaal.spring.boot.starter.smartservice.utils; | ||
|
||
import org.hl7.fhir.r4.model.DomainResource; | ||
import org.hl7.fhir.r4.model.Extension; | ||
import org.hl7.fhir.r4.model.Reference; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Optional; | ||
|
||
public class ExtensionUtils { | ||
private static final Logger LOG = LoggerFactory.getLogger(ExtensionUtils.class); | ||
|
||
public static Optional<String> getReferenceValue(DomainResource resource, String extensionSystem) { | ||
Optional<Extension> instantiatesExtension = resource.getExtensionsByUrl(extensionSystem).stream().findFirst(); | ||
|
||
if(instantiatesExtension.isPresent()) { | ||
return Optional.of(((Reference) instantiatesExtension.get().getValue()).getReference()); | ||
} | ||
|
||
LOG.warn("No extension with system [{}] found on [{}]", extensionSystem, ResourceUtils.getReference(resource)); | ||
return Optional.empty(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters