@openfn/language-fhir-ndr-et 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ast.json ADDED
@@ -0,0 +1,588 @@
1
+ {
2
+ "operations": [
3
+ {
4
+ "name": "create",
5
+ "params": {},
6
+ "docs": {
7
+ "description": "Creates a new resource with a server assigned resourceType.\nThe resource object doesn't need resourceType or id",
8
+ "tags": [
9
+ {
10
+ "title": "public",
11
+ "description": null,
12
+ "type": null
13
+ },
14
+ {
15
+ "title": "function",
16
+ "description": null,
17
+ "name": null
18
+ },
19
+ {
20
+ "title": "example",
21
+ "description": "create('Patient', {\n name: [\n {\n use: 'official',\n family: 'La Paradisio',\n given: ['Josephine', 'Nessa'],\n },\n ],\n});",
22
+ "caption": "Create a new patient"
23
+ },
24
+ {
25
+ "title": "param",
26
+ "description": "The resource type to create",
27
+ "type": {
28
+ "type": "NameExpression",
29
+ "name": "FhirResourceTypes"
30
+ },
31
+ "name": "resourceType"
32
+ },
33
+ {
34
+ "title": "param",
35
+ "description": "The resource to create",
36
+ "type": {
37
+ "type": "NameExpression",
38
+ "name": "FhirResource"
39
+ },
40
+ "name": "resource"
41
+ },
42
+ {
43
+ "title": "param",
44
+ "description": "(Optional) FHIR parameters to control and configure resource creation. You can specify a version ie r4 here.",
45
+ "type": {
46
+ "type": "NameExpression",
47
+ "name": "object"
48
+ },
49
+ "name": "params"
50
+ },
51
+ {
52
+ "title": "param",
53
+ "description": "(Optional) callback function",
54
+ "type": {
55
+ "type": "NameExpression",
56
+ "name": "function"
57
+ },
58
+ "name": "callback"
59
+ },
60
+ {
61
+ "title": "returns",
62
+ "description": null,
63
+ "type": {
64
+ "type": "NameExpression",
65
+ "name": "Operation"
66
+ }
67
+ },
68
+ {
69
+ "title": "state",
70
+ "description": "{FHIRHttpState}"
71
+ }
72
+ ]
73
+ },
74
+ "valid": false
75
+ }
76
+ ],
77
+ "exports": [],
78
+ "common": [
79
+ {
80
+ "name": "fn",
81
+ "params": [
82
+ "func"
83
+ ],
84
+ "docs": {
85
+ "description": "Creates a custom step (or operation) for more flexible job writing.",
86
+ "tags": [
87
+ {
88
+ "title": "public",
89
+ "description": null,
90
+ "type": null
91
+ },
92
+ {
93
+ "title": "function",
94
+ "description": null,
95
+ "name": null
96
+ },
97
+ {
98
+ "title": "example",
99
+ "description": "fn(state => {\n // do some things to state\n return state;\n});"
100
+ },
101
+ {
102
+ "title": "param",
103
+ "description": "is the function",
104
+ "type": {
105
+ "type": "NameExpression",
106
+ "name": "Function"
107
+ },
108
+ "name": "func"
109
+ },
110
+ {
111
+ "title": "returns",
112
+ "description": null,
113
+ "type": {
114
+ "type": "NameExpression",
115
+ "name": "Operation"
116
+ }
117
+ }
118
+ ]
119
+ },
120
+ "valid": true
121
+ },
122
+ {
123
+ "name": "sourceValue",
124
+ "params": [
125
+ "path"
126
+ ],
127
+ "docs": {
128
+ "description": "Picks out a single value from source data.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
129
+ "tags": [
130
+ {
131
+ "title": "public",
132
+ "description": null,
133
+ "type": null
134
+ },
135
+ {
136
+ "title": "function",
137
+ "description": null,
138
+ "name": null
139
+ },
140
+ {
141
+ "title": "example",
142
+ "description": "sourceValue('$.key')"
143
+ },
144
+ {
145
+ "title": "param",
146
+ "description": "JSONPath referencing a point in `state`.",
147
+ "type": {
148
+ "type": "NameExpression",
149
+ "name": "String"
150
+ },
151
+ "name": "path"
152
+ },
153
+ {
154
+ "title": "returns",
155
+ "description": null,
156
+ "type": {
157
+ "type": "NameExpression",
158
+ "name": "Operation"
159
+ }
160
+ }
161
+ ]
162
+ },
163
+ "valid": true
164
+ },
165
+ {
166
+ "name": "dataPath",
167
+ "params": [
168
+ "path"
169
+ ],
170
+ "docs": {
171
+ "description": "Ensures a path points at the data.",
172
+ "tags": [
173
+ {
174
+ "title": "public",
175
+ "description": null,
176
+ "type": null
177
+ },
178
+ {
179
+ "title": "function",
180
+ "description": null,
181
+ "name": null
182
+ },
183
+ {
184
+ "title": "example",
185
+ "description": "dataPath('key')"
186
+ },
187
+ {
188
+ "title": "param",
189
+ "description": "JSONPath referencing a point in `data`.",
190
+ "type": {
191
+ "type": "NameExpression",
192
+ "name": "string"
193
+ },
194
+ "name": "path"
195
+ },
196
+ {
197
+ "title": "returns",
198
+ "description": null,
199
+ "type": {
200
+ "type": "NameExpression",
201
+ "name": "string"
202
+ }
203
+ }
204
+ ]
205
+ },
206
+ "valid": true
207
+ },
208
+ {
209
+ "name": "dataValue",
210
+ "params": [
211
+ "path"
212
+ ],
213
+ "docs": {
214
+ "description": "Picks out a single value from the source data object—usually `state.data`.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
215
+ "tags": [
216
+ {
217
+ "title": "public",
218
+ "description": null,
219
+ "type": null
220
+ },
221
+ {
222
+ "title": "function",
223
+ "description": null,
224
+ "name": null
225
+ },
226
+ {
227
+ "title": "example",
228
+ "description": "dataValue('key')"
229
+ },
230
+ {
231
+ "title": "param",
232
+ "description": "JSONPath referencing a point in `data`.",
233
+ "type": {
234
+ "type": "NameExpression",
235
+ "name": "String"
236
+ },
237
+ "name": "path"
238
+ },
239
+ {
240
+ "title": "returns",
241
+ "description": null,
242
+ "type": {
243
+ "type": "NameExpression",
244
+ "name": "Operation"
245
+ }
246
+ }
247
+ ]
248
+ },
249
+ "valid": true
250
+ },
251
+ {
252
+ "name": "lastReferenceValue",
253
+ "params": [
254
+ "path"
255
+ ],
256
+ "docs": {
257
+ "description": "Picks out the last reference value from source data.",
258
+ "tags": [
259
+ {
260
+ "title": "public",
261
+ "description": null,
262
+ "type": null
263
+ },
264
+ {
265
+ "title": "function",
266
+ "description": null,
267
+ "name": null
268
+ },
269
+ {
270
+ "title": "example",
271
+ "description": "lastReferenceValue('key')"
272
+ },
273
+ {
274
+ "title": "param",
275
+ "description": "JSONPath referencing a point in `references`.",
276
+ "type": {
277
+ "type": "NameExpression",
278
+ "name": "String"
279
+ },
280
+ "name": "path"
281
+ },
282
+ {
283
+ "title": "returns",
284
+ "description": null,
285
+ "type": {
286
+ "type": "NameExpression",
287
+ "name": "Operation"
288
+ }
289
+ }
290
+ ]
291
+ },
292
+ "valid": true
293
+ },
294
+ {
295
+ "name": "each",
296
+ "params": [
297
+ "dataSource",
298
+ "operation"
299
+ ],
300
+ "docs": {
301
+ "description": "Scopes an array of data based on a JSONPath.\nUseful when the source data has `n` items you would like to map to\nan operation.\nThe operation will receive a slice of the data based of each item\nof the JSONPath provided.\n\nIt also ensures the results of an operation make their way back into\nthe state's references.",
302
+ "tags": [
303
+ {
304
+ "title": "public",
305
+ "description": null,
306
+ "type": null
307
+ },
308
+ {
309
+ "title": "function",
310
+ "description": null,
311
+ "name": null
312
+ },
313
+ {
314
+ "title": "example",
315
+ "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
316
+ },
317
+ {
318
+ "title": "param",
319
+ "description": "JSONPath referencing a point in `state`.",
320
+ "type": {
321
+ "type": "NameExpression",
322
+ "name": "DataSource"
323
+ },
324
+ "name": "dataSource"
325
+ },
326
+ {
327
+ "title": "param",
328
+ "description": "The operation needed to be repeated.",
329
+ "type": {
330
+ "type": "NameExpression",
331
+ "name": "Operation"
332
+ },
333
+ "name": "operation"
334
+ },
335
+ {
336
+ "title": "returns",
337
+ "description": null,
338
+ "type": {
339
+ "type": "NameExpression",
340
+ "name": "Operation"
341
+ }
342
+ }
343
+ ]
344
+ },
345
+ "valid": true
346
+ },
347
+ {
348
+ "name": "field",
349
+ "params": [
350
+ "key",
351
+ "value"
352
+ ],
353
+ "docs": {
354
+ "description": "Returns a key, value pair in an array.",
355
+ "tags": [
356
+ {
357
+ "title": "public",
358
+ "description": null,
359
+ "type": null
360
+ },
361
+ {
362
+ "title": "function",
363
+ "description": null,
364
+ "name": null
365
+ },
366
+ {
367
+ "title": "example",
368
+ "description": "field('destination_field_name__c', 'value')"
369
+ },
370
+ {
371
+ "title": "param",
372
+ "description": "Name of the field",
373
+ "type": {
374
+ "type": "NameExpression",
375
+ "name": "string"
376
+ },
377
+ "name": "key"
378
+ },
379
+ {
380
+ "title": "param",
381
+ "description": "The value itself or a sourceable operation.",
382
+ "type": {
383
+ "type": "NameExpression",
384
+ "name": "Value"
385
+ },
386
+ "name": "value"
387
+ },
388
+ {
389
+ "title": "returns",
390
+ "description": null,
391
+ "type": {
392
+ "type": "NameExpression",
393
+ "name": "Field"
394
+ }
395
+ }
396
+ ]
397
+ },
398
+ "valid": true
399
+ },
400
+ {
401
+ "name": "fields",
402
+ "params": [
403
+ "fields"
404
+ ],
405
+ "docs": {
406
+ "description": "Zips key value pairs into an object.",
407
+ "tags": [
408
+ {
409
+ "title": "public",
410
+ "description": null,
411
+ "type": null
412
+ },
413
+ {
414
+ "title": "function",
415
+ "description": null,
416
+ "name": null
417
+ },
418
+ {
419
+ "title": "example",
420
+ "description": "fields(list_of_fields)"
421
+ },
422
+ {
423
+ "title": "param",
424
+ "description": "a list of fields",
425
+ "type": {
426
+ "type": "NameExpression",
427
+ "name": "Fields"
428
+ },
429
+ "name": "fields"
430
+ },
431
+ {
432
+ "title": "returns",
433
+ "description": null,
434
+ "type": {
435
+ "type": "NameExpression",
436
+ "name": "Object"
437
+ }
438
+ }
439
+ ]
440
+ },
441
+ "valid": true
442
+ },
443
+ {
444
+ "name": "merge",
445
+ "params": [
446
+ "dataSource",
447
+ "fields"
448
+ ],
449
+ "docs": {
450
+ "description": "Merges fields into each item in an array.",
451
+ "tags": [
452
+ {
453
+ "title": "public",
454
+ "description": null,
455
+ "type": null
456
+ },
457
+ {
458
+ "title": "example",
459
+ "description": "merge(\n \"$.books[*]\",\n fields(\n field( \"publisher\", sourceValue(\"$.publisher\") )\n )\n)"
460
+ },
461
+ {
462
+ "title": "function",
463
+ "description": null,
464
+ "name": null
465
+ },
466
+ {
467
+ "title": "public",
468
+ "description": null,
469
+ "type": null
470
+ },
471
+ {
472
+ "title": "param",
473
+ "description": null,
474
+ "type": {
475
+ "type": "NameExpression",
476
+ "name": "DataSource"
477
+ },
478
+ "name": "dataSource"
479
+ },
480
+ {
481
+ "title": "param",
482
+ "description": "Group of fields to merge in.",
483
+ "type": {
484
+ "type": "NameExpression",
485
+ "name": "Object"
486
+ },
487
+ "name": "fields"
488
+ },
489
+ {
490
+ "title": "returns",
491
+ "description": null,
492
+ "type": {
493
+ "type": "NameExpression",
494
+ "name": "DataSource"
495
+ }
496
+ }
497
+ ]
498
+ },
499
+ "valid": true
500
+ },
501
+ {
502
+ "name": "cursor",
503
+ "params": [
504
+ "value",
505
+ "options"
506
+ ],
507
+ "docs": {
508
+ "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones\nare not yet supported.\nYou can provide a formatter to customise the final cursor value, which is useful for normalising\ndifferent inputs. The custom formatter runs after natural language date conversion.\nSee the usage guide at {@link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
509
+ "tags": [
510
+ {
511
+ "title": "public",
512
+ "description": null,
513
+ "type": null
514
+ },
515
+ {
516
+ "title": "function",
517
+ "description": null,
518
+ "name": null
519
+ },
520
+ {
521
+ "title": "example",
522
+ "description": "cursor($.cursor, { defaultValue: 'today' })",
523
+ "caption": "Use a cursor from state if present, or else use the default value"
524
+ },
525
+ {
526
+ "title": "example",
527
+ "description": "cursor(22)",
528
+ "caption": "Use a pagination cursor"
529
+ },
530
+ {
531
+ "title": "param",
532
+ "description": "the cursor value. Usually an ISO date, natural language date, or page number",
533
+ "type": {
534
+ "type": "NameExpression",
535
+ "name": "any"
536
+ },
537
+ "name": "value"
538
+ },
539
+ {
540
+ "title": "param",
541
+ "description": "options to control the cursor.",
542
+ "type": {
543
+ "type": "NameExpression",
544
+ "name": "object"
545
+ },
546
+ "name": "options"
547
+ },
548
+ {
549
+ "title": "param",
550
+ "description": "set the cursor key. Will persist through the whole run.",
551
+ "type": {
552
+ "type": "NameExpression",
553
+ "name": "string"
554
+ },
555
+ "name": "options.key"
556
+ },
557
+ {
558
+ "title": "param",
559
+ "description": "the value to use if value is falsy",
560
+ "type": {
561
+ "type": "NameExpression",
562
+ "name": "any"
563
+ },
564
+ "name": "options.defaultValue"
565
+ },
566
+ {
567
+ "title": "param",
568
+ "description": "custom formatter for the final cursor value",
569
+ "type": {
570
+ "type": "NameExpression",
571
+ "name": "Function"
572
+ },
573
+ "name": "options.format"
574
+ },
575
+ {
576
+ "title": "returns",
577
+ "description": null,
578
+ "type": {
579
+ "type": "NameExpression",
580
+ "name": "Operation"
581
+ }
582
+ }
583
+ ]
584
+ },
585
+ "valid": false
586
+ }
587
+ ]
588
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "properties": {
4
+ "baseUrl": {
5
+ "title": "Base URL",
6
+ "anyOf": [
7
+ {
8
+ "type": "string"
9
+ },
10
+ {
11
+ "type": "null"
12
+ }
13
+ ],
14
+ "description": "The base URL (http://www.example.com)",
15
+ "format": "uri",
16
+ "minLength": 1,
17
+ "examples": ["https://example.com"]
18
+ },
19
+ "username": {
20
+ "title": "Username",
21
+ "type": "string",
22
+ "description": "Username",
23
+ "examples": ["test@openfn.org"]
24
+ },
25
+ "password": {
26
+ "title": "Password",
27
+ "type": "string",
28
+ "description": "Password",
29
+ "writeOnly": true,
30
+ "examples": ["@some(!)Str0ngp4ss0w0rd"]
31
+ }
32
+ },
33
+ "type": "object",
34
+ "additionalProperties": true,
35
+ "required": ["password", "username"]
36
+ }