Created
June 24, 2021 12:49
-
-
Save mikeacjones/a9eb5a4cbfdf287a3f0c72534654b08a to your computer and use it in GitHub Desktop.
Provides an example of the update function using a pattern matching pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
output application/json | |
--- | |
payload update { | |
case value at .software.name if (value contains "XYZ") -> "XYZ FHIR 2017" | |
case value at .software.version -> "1.0.0" | |
case value at .software.releaseDate -> "2017-03-06T00:00:00Z" | |
case value at .date if(!isEmpty(value)) -> "2017-03-06T00:00:00Z" | |
case value at .version if(!isEmpty(value)) -> "1.0.0" | |
case value at .copyright if(!isEmpty(value)) -> "Copyright XYZ 2017" | |
case value at .*rest -> value map ( | |
$ update { | |
case value at .security.*extension -> value map ( | |
$ update { | |
case value at .*extension -> value map ( | |
$ update { | |
case value at .valueUri -> "https://xyz.com/Interconnect-POC-FHIR/oauth2/token" | |
} | |
) | |
} | |
) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment