Methods
getIdentifierByResourceAndSystem(resource, system) → {Object|null}
Returns the first identifier it finds with the given system. If no identifier is found, null is returned.
Parameters:
Name | Type | Description |
---|---|---|
resource |
Object | the FHIR resource |
system |
String | the system of the identifier |
Returns:
the identifier
- Type
- Object | null
getIdentifierBySystem(identifier, system) → {Object}
Returns the first identifier with the given system. If you just want to get the identifier value, use getIdentifierValueBySystem. Returns null if any of the parameters is null or undefined.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
Array.<Object> | the identifier Array |
system |
String | the system String |
Returns:
the identifier
- Type
- Object
getIdentifierValueByIdentifierString(identifierString)
Returns the value as String of an identifier String inthe format system|value. Returns null if any of the parameters is null or undefined.
Parameters:
Name | Type | Description |
---|---|---|
identifierString |
String |
getIdentifierValueBySystem(identifiers, system) → {String|null}
Returns the first identifier value it finds with the given system. If no identifier is found, null is returned. Returns "" if any of the parameters is null or undefined.
Parameters:
Name | Type | Description |
---|---|---|
identifiers |
Array | |
system |
String |
Returns:
the identifier value
- Type
- String | null
getStringFromHumanName(humanName, lastNameFirst) → {String}
Extracts the name as a String from a FHIR HumanName. Returns an empty String ("") if any of the parameters is null or undefined.
Parameters:
Name | Type | Description |
---|---|---|
humanName |
Array.<Object> | the HumanNames Array |
lastNameFirst |
Boolean | if true will put the Family-Name first |
Returns:
the human name
- Type
- String
Example
import fhirUtil from "molit-fhir-util";
fhirUtil.getStringFromHumanName(patient.name);
getValueByLoincCode(components, loincCode)
Returns the value that is annotated with the given loinc code from the given Observation components
complying to the obs-variant profile (http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/obs-variant).
Parameters:
Name | Type | Description |
---|---|---|
components |
Array | the components from the obs-variant |
loincCode |
String | the loinc code |
Returns:
- the value or undefined, if the loinc code could not be found within the components