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: python/README.md
+232-6Lines changed: 232 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,56 @@
1
-
# FHIRPathMappingLanguage - fpml python package
1
+
# fpml (FHIRPathMappingLanguage)
2
+
3
+
The FHIRPath Mapping Language (FPML) is a data DSL designed to convert data from QuestionnaireResponse (and not only) to any FHIR Resource.
4
+
5
+
For more details visit the [FHIRPathMappingLanguage specification](https://github.com/beda-software/FHIRPathMappingLanguage/tree/main?tab=readme-ov-file#specification).
2
6
3
7
## Installation
4
8
9
+
You can install the package from PyPI using the following command:
10
+
5
11
```bash
6
12
pip install fpml
7
13
```
8
14
9
-
## Usage
15
+
## API Reference
16
+
17
+
### resolve_template
18
+
19
+
The `resolve_template` function processes a given template with a specified FHIR resource, optionally applying a context and additional processing options.
10
20
11
21
```python
12
22
from fpml import resolve_template
13
23
24
+
result = resolve_template(
25
+
resource,
26
+
template,
27
+
context=None,
28
+
fp_options=None,
29
+
strict=False
30
+
)
31
+
```
32
+
33
+
### Arguments:
34
+
35
+
- resource (Resource): The input FHIR resource to process.
36
+
- template (Any): The template describing the transformation.
37
+
- context (Optional[Context], optional): Additional context data. Defaults to None.
38
+
- fp_options (Optional[FPOptions], optional): Options for controlling FHIRPath evaluation. Defaults to None.
39
+
- strict (bool, optional): Whether to enforce strict mode. Defaults to False. See more details on [strict mode](https://github.com/beda-software/FHIRPathMappingLanguage/tree/main?tab=readme-ov-file#strict-mode).
40
+
41
+
### Returns:
14
42
43
+
- Any: The processed output based on the template.
44
+
45
+
### Raises:
46
+
47
+
- FPMLValidationError: If validation of the template or resource fails.
48
+
49
+
## Usage
50
+
51
+
For the following QuestionnaireResponse resource:
52
+
53
+
```python
15
54
resource = {
16
55
"resourceType": "QuestionnaireResponse",
17
56
"status": "completed",
@@ -26,32 +65,219 @@ resource = {
26
65
}
27
66
]
28
67
}
68
+
```
69
+
70
+
71
+
Here's an example demonstrating how to use the `resolve_template` function:
0 commit comments