Skip to main content

$uppercase

$uppercase(string?) -> string
Compact type signature<s-:s>

If string is omitted, the current context value is used.

Browse categories

Source: JSONata

Documentation

Returns a string with all the characters of str converted to uppercase. An error is thrown if str is not a string.

Examples

Basic usage

  • $uppercase("Hello World") => "HELLO WORLD"

Normalize casing for a coded field

Input

This example uses the patient-summary example input. The expression reads sex and converts it to uppercase.

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

$uppercase(sex)

Result

"FEMALE"