$startsWith
$startsWith(string?, prefix) -> booleanCompact type signature
<s-s:b>If string is omitted, the current context value is used.
Source: FUME
Documentation
Returns true if str begins with the sequence chars, false otherwise.
Examples
Check an ID prefix
Input
This example uses the patient-summary example input. The expression reads identifiers.memberId and checks its prefix.
Example input
JSON
{
"patientId": "pat-0001",
"name": {
"given": "Avery",
"family": "Reed",
"display": "Avery Reed"
},
"birthDate": "1990-06-12",
"sex": "female",
"primaryCareTeam": {
"organization": "ExampleCare",
"facility": "ExampleCare Clinic",
"practitioner": {
"practitionerId": "prac-4001",
"display": "Jordan Kim"
}
},
"identifiers": {
"memberId": "mbr-3001",
"recordNumber": "rec-5001"
},
"tags": [
"demo",
"fictional"
],
"_xmlTagName": "patientSummary"
}
Expression
$startsWith(identifiers.memberId, "mbr-")
Result
true