Conversation
Ellerbach
commented
Nov 29, 2021
- Fixing replaceMatches documentation as it was not working and incomplete
- Added a working example of replaceMatches for dates
- Fixing Markdown issues in the files (non respecting Markdown rules)
- Fixing tables in Markdown file
docs/FHIR-anonymization.md
Outdated
|
|
||
| Since the output of FHIR expression is flexible, users should provide expressions with valid output value to avoid unexcepted errors. | ||
|
|
||
| > **[Important]**: |
There was a problem hiding this comment.
We can make these two points as examples for line 573 "users should provide expressions with valid output value to avoid unexcepted errors.", rather than an "Important" tag here.
| |string| `"$this in ('es-AR' \| 'es-ES' \| 'es-UY')": "'es'"`|Data fall in the value set will be mapped to "es".|'es-UY' -> 'es'| | ||
| |string| `"$this.startsWith(\'123\')": "$this.subString(0,2)+\'*\*\*\*\' "` |Mask sensitive string code.|'1230005' -> '123****'| | ||
| |date, dateTime, time|`"$this >= @2010-1-1": "@2010"`|Data fall in a date/time/dateTime range will be mapped to one date/time/dateTime value.| 2016-03-10 -> 2010| | ||
| |date, dateTime, time|`"$this": "$this.toString().replaceMatches('(?<year>[0-9]{2,4})-(?<month>[0-9]{1,2})-(?<day>[0-9]{1,2})', '${year}-${month})'"`|Omit "day" to generalize specific date.|2016-01-01 -> 2016-01| |
There was a problem hiding this comment.
It works if not using toString() here.
There was a problem hiding this comment.
That raises an exception for me saying it can't be datetime can't be cast to .NET string type.
There was a problem hiding this comment.
@sowu880 I tested it again and I still have an exception. That is maybe due to a not perfectly formed date, no idea. Still, with the toString, it does always work fine. Shall we merge this PR?
|
@sowu880 how to have this one green? |
@ranvijaykumar can you help on this cla item? |
