Class Identifiers
java.lang.Object
org.projecthusky.fhir.emed.ch.common.util.Identifiers
Helper for HAPI
Identifiers.- 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.IdentifierConstructs anIdentifierfrom an OID.static org.hl7.fhir.r4.model.IdentifierConstructs anIdentifierfrom aUUID.static @Nullable org.hl7.fhir.r4.model.IdentifiergetBySystem(List<org.hl7.fhir.r4.model.Identifier> identifiers, String system) Gets a single identifier by its system in a list.static @Nullable StringgetValueBySystem(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.IdentifiersetValueBySystem(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
nullif 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
nullif 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 anIdentifierfrom aUUID.- Parameters:
uuid- The UUID to use as identifier.- Returns:
- the constructed identifier.
-
fromOid
Constructs anIdentifierfrom an OID.- Parameters:
oid- The OID to use as identifier.- Returns:
- the constructed identifier.
-