You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-5Lines changed: 49 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -575,6 +575,13 @@ and other usage in [unit tests](https://github.com/beda-software/FHIRPathMapping
575
575
576
576
## Reference implementation
577
577
578
+
## Strict mode
579
+
580
+
FHIRPath provides a way of accessing the `resource` variables without the percent sign. It potentially leads to the issues made by typos in the variable names.
581
+
582
+
See the particular implementation for details of usage.
583
+
584
+
578
585
### TypeScript
579
586
580
587
TypeScript implementation that supports all the specification is already available [in this repository](https://github.com/beda-software/FHIRPathMappingLanguage/tree/main/ts/server).
@@ -603,12 +610,9 @@ POST /r4/parse-template
603
610
604
611
#### Strict mode
605
612
606
-
FHIRPath provides a way of accessing the `resource` variables without the percent sign. It potentially leads to the issues made by typos in the variable names.
607
-
608
-
There's a runtime flag, called `strict` that is set to `false` by default. If it set to `true`, all accesses to the variables without the percent sign will be rejected and exception will be thrown.
613
+
There's a flag, called `strict` that is set to `false` by default. If it set to `true`, all accesses to the variables without the percent sign will be rejected and exception will be thrown.
609
614
610
-
611
-
The previous example should be re-written as
615
+
The previous example using strict mode:
612
616
613
617
POST /r4/parse-template?strict=true
614
618
@@ -670,3 +674,43 @@ result = resolve_template(resource, template, context)
670
674
print(result)
671
675
# {'resourceType': 'Patient', 'name': 'Name'}
672
676
```
677
+
678
+
#### Strict mode
679
+
680
+
There's a flag, called `strict` that is set to `false` by default. If it set to `true`, all accesses to the variables without the percent sign will be rejected and exception will be thrown.
681
+
682
+
Example:
683
+
684
+
```python
685
+
result = resolve_template(
686
+
resource,
687
+
template,
688
+
context,
689
+
strict=True
690
+
)
691
+
```
692
+
693
+
694
+
695
+
#### User-defined functions
696
+
697
+
There's an ability to pass user-defined functions through fp_options
698
+
699
+
Example:
700
+
701
+
```python
702
+
user_invocation_table = {
703
+
"pow": {
704
+
"fn": lambdainputs, exp=2: [i**exp for i in inputs],
0 commit comments