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
@@ -238,11 +263,20 @@ this template will be mapped into:
238
263
}
239
264
```
240
265
241
-
### Null key retention
266
+
**Explanation:**
267
+
268
+
The expression `"{{ QuestionnaireResponse.repeat(item).where(linkId='1').answer.value.string }}"` resolves to null,
269
+
which is then removed from the `given` array. Since `given` becomes null after removal, it gets removed from the object.
270
+
The resulting empty object is then replaced with null, which is removed from the `name` array.
271
+
Finally, the empty `name` array is replaced with null, causing the entire `name` key to be removed from the final result.
272
+
273
+
274
+
### Nulls retention
242
275
243
276
**Note:** This feature is not mature enough and might change in the future.
244
277
245
278
To preserve the null value in the final result, use `{{+` and `+}}` instead of `{{` and `}}`:
279
+
The null value will be also preserved in the array, it might be useful for primitive extensions.
246
280
247
281
```json
248
282
{
@@ -262,28 +296,25 @@ The result will be:
262
296
263
297
**Note:** This feature is not mature enough and might change in the future.
264
298
265
-
### Automatic array flattening and null removal
299
+
### Automatic array flattening
266
300
267
-
In FHIR resources, arrays of arrays and arrays of nulls are invalid constructions. To simplify writing mappers, there is automatic array flattening.
301
+
In FHIR resources, arrays of arrays are invalid constructions. To simplify writing mappers, there is automatic array flattening.
268
302
269
303
For example:
270
304
271
305
```json
272
306
{
273
307
"list": [
274
308
[
275
-
1, 2, null, 3
309
+
1, 2, 3
276
310
],
277
-
null,
278
311
[
279
-
4, 5, 6, null
312
+
4, 5, 6
280
313
]
281
314
]
282
315
}
283
316
```
284
317
285
-
will be mapped into:
286
-
287
318
```json
288
319
{
289
320
"list": [
@@ -292,7 +323,7 @@ will be mapped into:
292
323
}
293
324
```
294
325
295
-
This is especially useful if there is conditional and iteration logic used.
326
+
Note that since empty arrays, objects, and null values are automatically removed, any null elements created during expression evaluation in arrays will be automatically removed during flattening. This behavior is particularly beneficial when using conditional and iteration logic.
0 commit comments