Class Identifiers
java.lang.Object
org.projecthusky.fhir.emed.ch.common.util.Identifiers
Helper for HAPI
Identifier
s.- Author:
- Quentin Ligier
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.hl7.fhir.r4.model.Identifier>
findBySystem
(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Finds identifiers by their system in a list.static org.hl7.fhir.r4.model.Identifier
Constructs anIdentifier
from an OID.static org.hl7.fhir.r4.model.Identifier
Constructs anIdentifier
from aUUID
.static @Nullable org.hl7.fhir.r4.model.Identifier
getBySystem
(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Gets a single identifier by its system in a list.static @Nullable String
getValueBySystem
(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Gets the value of a single identifier by its system in a list.static org.hl7.fhir.r4.model.Identifier
setValueBySystem
(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system, String value) Sets the value of a single identifier by its system in a list.
-
Method Details
-
getBySystem
public static @Nullable org.hl7.fhir.r4.model.Identifier getBySystem(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Gets a single identifier by its system in a list.- Parameters:
identifiers
- All identifiers.system
- The system to find.- Returns:
- the first identifier with the given system or
null
if none found.
-
getValueBySystem
public static @Nullable String getValueBySystem(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Gets the value of a single identifier by its system in a list.- Parameters:
identifiers
- All identifiers.system
- The system to find.- Returns:
- the value of first identifier with the given system or
null
if none found.
-
setValueBySystem
public static org.hl7.fhir.r4.model.Identifier setValueBySystem(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system, String value) Sets the value of a single identifier by its system in a list.- Parameters:
identifiers
- All identifiers.system
- The system to find.value
- The value to set- Returns:
- the created/modified Identifier
-
findBySystem
public static List<org.hl7.fhir.r4.model.Identifier> findBySystem(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Finds identifiers by their system in a list.- Parameters:
identifiers
- All identifiers.system
- The system to find.- Returns:
- a list of the identifiers with the given system.
-
fromUuid
Constructs anIdentifier
from aUUID
.- Parameters:
uuid
- The UUID to use as identifier.- Returns:
- the constructed identifier.
-
fromOid
Constructs anIdentifier
from an OID.- Parameters:
oid
- The OID to use as identifier.- Returns:
- the constructed identifier.
-