@openfn/language-fhir-ndr-et 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -13,6 +13,9 @@ We **strongly** recommend not editing generated source files by hand! Better to
13
13
  update the spec, mappings, or code generation rules. Otherwise your changes will
14
14
  be lost.
15
15
 
16
+ Unlike most adaptors, types are checked-in (because they are largely
17
+ autogenerated). A custom dts build is used.
18
+
16
19
  View the [docs site](https://docs.openfn.org/adaptors/packages/fhir-ndr-et-docs)
17
20
  for full technical documentation.
18
21
 
package/ast.json CHANGED
@@ -298,7 +298,7 @@
298
298
  "operation"
299
299
  ],
300
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.",
301
+ "description": "Iterates over an array of items and invokes an operation upon each one, where the state\nobject is _scoped_ so that state.data is the item under iteration.\nThe rest of the state object is untouched and can be referenced as usual.\nYou can pass an array directly, or use lazy state or a JSONPath string to\nreference a slice of state.",
302
302
  "tags": [
303
303
  {
304
304
  "title": "public",
@@ -312,7 +312,18 @@
312
312
  },
313
313
  {
314
314
  "title": "example",
315
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
315
+ "description": "each(\n $.data,\n // Inside the callback operation, `$.data` is scoped to the item under iteration\n insert(\"patient\", {\n patient_name: $.data.properties.case_name,\n patient_id: $.data.case_id,\n })\n);",
316
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
317
+ },
318
+ {
319
+ "title": "example",
320
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
321
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
322
+ },
323
+ {
324
+ "title": "example",
325
+ "description": "each(\n \"$.data[*]\",\n insert(\"patient\", (state) => ({\n patient_name: state.data.properties.case_name,\n patient_id: state.data.case_id,\n }))\n);",
326
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
316
327
  },
317
328
  {
318
329
  "title": "param",
package/dist/index.cjs CHANGED
@@ -36,7 +36,6 @@ __export(src_exports, {
36
36
  field: () => import_language_common.field,
37
37
  fields: () => import_language_common.fields,
38
38
  fn: () => import_language_common.fn,
39
- getBuilderName: () => getBuilderName,
40
39
  lastReferenceValue: () => import_language_common.lastReferenceValue,
41
40
  merge: () => import_language_common.merge,
42
41
  sourceValue: () => import_language_common.sourceValue,
@@ -55,7 +54,6 @@ __export(Adaptor_exports, {
55
54
  field: () => import_language_common.field,
56
55
  fields: () => import_language_common.fields,
57
56
  fn: () => import_language_common.fn,
58
- getBuilderName: () => getBuilderName,
59
57
  lastReferenceValue: () => import_language_common.lastReferenceValue,
60
58
  merge: () => import_language_common.merge,
61
59
  sourceValue: () => import_language_common.sourceValue
@@ -26658,7 +26656,6 @@ var src_default = Adaptor_exports;
26658
26656
  field,
26659
26657
  fields,
26660
26658
  fn,
26661
- getBuilderName,
26662
26659
  lastReferenceValue,
26663
26660
  merge,
26664
26661
  sourceValue,
package/dist/index.js CHANGED
@@ -15,7 +15,6 @@ __export(Adaptor_exports, {
15
15
  field: () => field,
16
16
  fields: () => fields,
17
17
  fn: () => fn,
18
- getBuilderName: () => getBuilderName,
19
18
  lastReferenceValue: () => lastReferenceValue,
20
19
  merge: () => merge,
21
20
  sourceValue: () => sourceValue
@@ -26629,7 +26628,6 @@ export {
26629
26628
  field,
26630
26629
  fields,
26631
26630
  fn,
26632
- getBuilderName,
26633
26631
  lastReferenceValue,
26634
26632
  merge,
26635
26633
  sourceValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-fhir-ndr-et",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "OpenFn fhir adaptor for NDR HIV in Ehtiopia",
5
5
  "type": "module",
6
6
  "exports": {
@@ -28,14 +28,14 @@
28
28
  "configuration-schema.json"
29
29
  ],
30
30
  "dependencies": {
31
- "@openfn/language-fhir": "^5.0.2",
31
+ "@openfn/language-fhir": "^5.0.3",
32
32
  "@types/fhir": "^0.0.41",
33
33
  "ast-types": "^0.14.2",
34
34
  "lodash": "^4.17.21",
35
35
  "recast": "^0.23.9",
36
36
  "typescript": "4.8.4",
37
37
  "yauzl": "^3.1.3",
38
- "@openfn/language-common": "2.1.0"
38
+ "@openfn/language-common": "2.1.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "assertion-error": "2.0.0",
@@ -52,14 +52,14 @@
52
52
  "types": "types/index.d.ts",
53
53
  "main": "dist/index.cjs",
54
54
  "scripts": {
55
- "build": "pnpm clean && pnpm build-adaptor fhir-ndr-et",
55
+ "build": "pnpm clean && pnpm build-adaptor fhir-ndr-et src ast docs",
56
56
  "build:src": "esno build/build.ts",
57
57
  "build:adaptor": "pnpm build-adaptor fhir-ndr-et",
58
58
  "build:schema": "esno build/generate-schema.ts",
59
59
  "load-schema": "esno build/fetch-schema.ts",
60
60
  "test": "mocha --experimental-specifier-resolution=node --no-warnings",
61
61
  "test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
62
- "clean": "rimraf dist types docs",
62
+ "clean": "rimraf dist docs",
63
63
  "pack": "pnpm pack --pack-destination ../../dist",
64
64
  "lint": "eslint src"
65
65
  }
@@ -1,3 +1,2 @@
1
- export function getBuilderName(resourceName: any): any;
2
1
  export function create(resourceType: FhirResourceTypes, resource: FhirResource, params: object, callback?: Function): Operation;
3
2
  export { dataPath, dataValue, cursor, each, field, fields, fn, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";