@openfn/language-fhir-fr 1.0.2 → 1.0.4

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/dist/index.cjs CHANGED
@@ -1,13 +1,9 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
7
  var __commonJS = (cb, mod) => function __require() {
12
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
9
  };
@@ -31,7 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
27
 
32
28
  // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js
33
29
  var require_lodash = __commonJS({
34
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports2, module2) {
30
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports, module2) {
35
31
  (function() {
36
32
  var undefined2;
37
33
  var VERSION = "4.17.21";
@@ -357,7 +353,7 @@ var require_lodash = __commonJS({
357
353
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
358
354
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
359
355
  var root = freeGlobal || freeSelf || Function("return this")();
360
- var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
356
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
361
357
  var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
362
358
  var moduleExports = freeModule && freeModule.exports === freeExports;
363
359
  var freeProcess = moduleExports && freeGlobal.process;
@@ -2161,8 +2157,8 @@ var require_lodash = __commonJS({
2161
2157
  function createBind(func, bitmask, thisArg) {
2162
2158
  var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
2163
2159
  function wrapper() {
2164
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2165
- return fn.apply(isBind ? thisArg : this, arguments);
2160
+ var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2161
+ return fn2.apply(isBind ? thisArg : this, arguments);
2166
2162
  }
2167
2163
  return wrapper;
2168
2164
  }
@@ -2228,8 +2224,8 @@ var require_lodash = __commonJS({
2228
2224
  arity - length
2229
2225
  );
2230
2226
  }
2231
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2232
- return apply(fn, this, args);
2227
+ var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2228
+ return apply(fn2, this, args);
2233
2229
  }
2234
2230
  return wrapper;
2235
2231
  }
@@ -2317,7 +2313,7 @@ var require_lodash = __commonJS({
2317
2313
  arity - length
2318
2314
  );
2319
2315
  }
2320
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
2316
+ var thisBinding = isBind ? thisArg : this, fn2 = isBindKey ? thisBinding[func] : func;
2321
2317
  length = args.length;
2322
2318
  if (argPos) {
2323
2319
  args = reorder(args, argPos);
@@ -2328,9 +2324,9 @@ var require_lodash = __commonJS({
2328
2324
  args.length = ary2;
2329
2325
  }
2330
2326
  if (this && this !== root && this instanceof wrapper) {
2331
- fn = Ctor || createCtor(fn);
2327
+ fn2 = Ctor || createCtor(fn2);
2332
2328
  }
2333
- return fn.apply(thisBinding, args);
2329
+ return fn2.apply(thisBinding, args);
2334
2330
  }
2335
2331
  return wrapper;
2336
2332
  }
@@ -2387,14 +2383,14 @@ var require_lodash = __commonJS({
2387
2383
  function createPartial(func, bitmask, thisArg, partials) {
2388
2384
  var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
2389
2385
  function wrapper() {
2390
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2386
+ var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2391
2387
  while (++leftIndex < leftLength) {
2392
2388
  args[leftIndex] = partials[leftIndex];
2393
2389
  }
2394
2390
  while (argsLength--) {
2395
2391
  args[leftIndex++] = arguments[++argsIndex];
2396
2392
  }
2397
- return apply(fn, isBind ? thisArg : this, args);
2393
+ return apply(fn2, isBind ? thisArg : this, args);
2398
2394
  }
2399
2395
  return wrapper;
2400
2396
  }
@@ -4353,7 +4349,7 @@ var require_lodash = __commonJS({
4353
4349
  });
4354
4350
  return result2;
4355
4351
  }
4356
- var merge = createAssigner(function(object, source, srcIndex) {
4352
+ var merge2 = createAssigner(function(object, source, srcIndex) {
4357
4353
  baseMerge(object, source, srcIndex);
4358
4354
  });
4359
4355
  var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
@@ -5043,7 +5039,7 @@ var require_lodash = __commonJS({
5043
5039
  lodash.matches = matches;
5044
5040
  lodash.matchesProperty = matchesProperty;
5045
5041
  lodash.memoize = memoize;
5046
- lodash.merge = merge;
5042
+ lodash.merge = merge2;
5047
5043
  lodash.mergeWith = mergeWith;
5048
5044
  lodash.method = method;
5049
5045
  lodash.methodOf = methodOf;
@@ -5463,10 +5459,48 @@ var require_lodash = __commonJS({
5463
5459
  } else {
5464
5460
  root._ = _3;
5465
5461
  }
5466
- }).call(exports2);
5462
+ }).call(exports);
5467
5463
  }
5468
5464
  });
5469
5465
 
5466
+ // src/index.js
5467
+ var src_exports = {};
5468
+ __export(src_exports, {
5469
+ b: () => builders_exports,
5470
+ builders: () => builders_exports,
5471
+ cursor: () => import_language_common.cursor,
5472
+ dataPath: () => import_language_common.dataPath,
5473
+ dataValue: () => import_language_common.dataValue,
5474
+ dateFns: () => import_language_common.dateFns,
5475
+ default: () => src_default,
5476
+ each: () => import_language_common.each,
5477
+ field: () => import_language_common.field,
5478
+ fields: () => import_language_common.fields,
5479
+ fn: () => import_language_common.fn,
5480
+ lastReferenceValue: () => import_language_common.lastReferenceValue,
5481
+ merge: () => import_language_common.merge,
5482
+ sourceValue: () => import_language_common.sourceValue,
5483
+ util: () => utils_exports
5484
+ });
5485
+ module.exports = __toCommonJS(src_exports);
5486
+
5487
+ // src/Adaptor.js
5488
+ var Adaptor_exports = {};
5489
+ __export(Adaptor_exports, {
5490
+ cursor: () => import_language_common.cursor,
5491
+ dataPath: () => import_language_common.dataPath,
5492
+ dataValue: () => import_language_common.dataValue,
5493
+ dateFns: () => import_language_common.dateFns,
5494
+ each: () => import_language_common.each,
5495
+ field: () => import_language_common.field,
5496
+ fields: () => import_language_common.fields,
5497
+ fn: () => import_language_common.fn,
5498
+ lastReferenceValue: () => import_language_common.lastReferenceValue,
5499
+ merge: () => import_language_common.merge,
5500
+ sourceValue: () => import_language_common.sourceValue
5501
+ });
5502
+ var import_util = require("@openfn/language-common/util");
5503
+
5470
5504
  // src/utils.js
5471
5505
  var utils_exports = {};
5472
5506
  __export(utils_exports, {
@@ -5483,144 +5517,142 @@ __export(utils_exports, {
5483
5517
  reference: () => reference,
5484
5518
  setSystemMap: () => setSystemMap
5485
5519
  });
5486
- var import_lodash, systemMap, datetimeregex, mapSystems, setSystemMap, identifier, id, addExtension, findExtension, coding, concept, cc, reference, ref, composite;
5487
- var init_utils = __esm({
5488
- "src/utils.js"() {
5489
- import_lodash = __toESM(require_lodash(), 1);
5490
- systemMap = {
5491
- SmartCareID: "http://moh.gov.et/fhir/hiv/identifier/SmartCareID",
5492
- MRN: "http://moh.gov.et/fhir/hiv/identifier/MRN",
5493
- UAN: "http://moh.gov.et/fhir/hiv/identifier/UAN"
5494
- };
5495
- datetimeregex = /([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;
5496
- mapSystems = (obj) => {
5497
- if (Array.isArray(obj)) {
5498
- return obj.map(mapSystems);
5499
- }
5500
- if (obj.system in systemMap) {
5501
- return {
5502
- ...obj,
5503
- system: systemMap[obj.system]
5504
- };
5505
- }
5506
- return obj;
5507
- };
5508
- setSystemMap = (newMappings) => {
5509
- Object.assign(systemMap, newMappings);
5510
- };
5511
- identifier = (input, system) => {
5512
- if (Array.isArray(input)) {
5513
- return input.map((i) => identifier(i, system));
5514
- }
5515
- if (input) {
5516
- if (typeof input === "string") {
5517
- return mapSystems({
5518
- value: input,
5519
- system
5520
- });
5521
- } else if (system) {
5522
- return mapSystems({
5523
- system,
5524
- ...input
5525
- });
5526
- } else {
5527
- return mapSystems(input);
5528
- }
5529
- }
5530
- };
5531
- id = identifier;
5532
- addExtension = (resource, url, value) => {
5533
- const obj = {
5534
- url
5535
- };
5536
- composite(obj, "value", value);
5537
- resource.extension ?? (resource.extension = []);
5538
- resource.extension.push(obj);
5539
- };
5540
- findExtension = (obj, targetUrl, path) => {
5541
- var _a;
5542
- const result = (_a = obj.extension) == null ? void 0 : _a.find((ext) => ext.url === targetUrl);
5543
- if (result && path) {
5544
- return import_lodash.default.get(result, path);
5545
- }
5546
- return result;
5547
- };
5548
- coding = (code, system) => ({ code, system: mapSystems(system) });
5549
- concept = (text, ...codings) => {
5550
- const result = {};
5551
- let incomingCodings = codings;
5552
- if (typeof text === "string") {
5553
- result.text = text;
5554
- } else {
5555
- incomingCodings = [text].concat(codings);
5556
- }
5557
- const c = [];
5558
- for (const item of incomingCodings) {
5559
- if (Array.isArray(item)) {
5560
- c.push(coding(item[0], item[1]));
5561
- } else {
5562
- c.push(item);
5563
- }
5564
- }
5565
- result.coding = c;
5566
- return result;
5567
- };
5568
- cc = concept;
5569
- reference = (ref2, opts) => {
5570
- if (Array.isArray(ref2)) {
5571
- return ref2.map(reference, opts);
5572
- }
5573
- if (ref2.resourceType && ref2.id) {
5574
- return { reference: `${ref2.resourceType}/${ref2.id}` };
5575
- }
5576
- if (ref2.reference) {
5577
- return ref2;
5578
- }
5579
- const result = {};
5580
- if (typeof ref2 === "string") {
5581
- result.reference = ref2;
5582
- }
5583
- if (opts) {
5584
- Object.assign(result, opts);
5585
- }
5586
- return result;
5587
- };
5588
- ref = reference;
5589
- composite = (object, key, value) => {
5590
- const k = [key];
5591
- if (value.coding) {
5592
- k.push("CodeableConcept");
5593
- } else if (value.reference) {
5594
- k.push("Reference");
5595
- } else if (value.id && value.meta && value.resourceType) {
5596
- k.push("Reference");
5597
- value = reference(value);
5598
- } else if (value.start || value.end) {
5599
- k.push("Period");
5600
- } else if (value.dateTime) {
5601
- k.push("DateTime");
5602
- } else if (typeof value === "string") {
5603
- if (datetimeregex.test(value)) {
5604
- k.push("DateTime");
5605
- } else {
5606
- k.push("String");
5607
- }
5608
- } else if (typeof value === "boolean") {
5609
- k.push("Boolean");
5610
- } else if (typeof value === "number") {
5611
- k.push("Integer");
5612
- }
5613
- if (k.length === 2) {
5614
- const finalKey = k.join("");
5615
- object[finalKey] = value;
5616
- } else {
5617
- console.warn(
5618
- `WARNING: Failed to map ${key}: unrecognised data type (see utils.composite)`
5619
- );
5620
- }
5520
+ var import_lodash = __toESM(require_lodash(), 1);
5521
+ var systemMap = {
5522
+ SmartCareID: "http://moh.gov.et/fhir/hiv/identifier/SmartCareID",
5523
+ MRN: "http://moh.gov.et/fhir/hiv/identifier/MRN",
5524
+ UAN: "http://moh.gov.et/fhir/hiv/identifier/UAN"
5525
+ };
5526
+ var datetimeregex = /([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;
5527
+ var mapSystems = (obj) => {
5528
+ if (Array.isArray(obj)) {
5529
+ return obj.map(mapSystems);
5530
+ }
5531
+ if (obj.system in systemMap) {
5532
+ return {
5533
+ ...obj,
5534
+ system: systemMap[obj.system]
5621
5535
  };
5622
5536
  }
5623
- });
5537
+ return obj;
5538
+ };
5539
+ var setSystemMap = (newMappings) => {
5540
+ Object.assign(systemMap, newMappings);
5541
+ };
5542
+ var identifier = (input, system) => {
5543
+ if (Array.isArray(input)) {
5544
+ return input.map((i) => identifier(i, system));
5545
+ }
5546
+ if (input) {
5547
+ if (typeof input === "string") {
5548
+ return mapSystems({
5549
+ value: input,
5550
+ system
5551
+ });
5552
+ } else if (system) {
5553
+ return mapSystems({
5554
+ system,
5555
+ ...input
5556
+ });
5557
+ } else {
5558
+ return mapSystems(input);
5559
+ }
5560
+ }
5561
+ };
5562
+ var id = identifier;
5563
+ var addExtension = (resource, url, value) => {
5564
+ const obj = {
5565
+ url
5566
+ };
5567
+ composite(obj, "value", value);
5568
+ resource.extension ?? (resource.extension = []);
5569
+ resource.extension.push(obj);
5570
+ };
5571
+ var findExtension = (obj, targetUrl, path) => {
5572
+ var _a;
5573
+ const result = (_a = obj.extension) == null ? void 0 : _a.find((ext) => ext.url === targetUrl);
5574
+ if (result && path) {
5575
+ return import_lodash.default.get(result, path);
5576
+ }
5577
+ return result;
5578
+ };
5579
+ var coding = (code, system) => ({ code, system: mapSystems(system) });
5580
+ var concept = (text, ...codings) => {
5581
+ const result = {};
5582
+ let incomingCodings = codings;
5583
+ if (typeof text === "string") {
5584
+ result.text = text;
5585
+ } else {
5586
+ incomingCodings = [text].concat(codings);
5587
+ }
5588
+ const c = [];
5589
+ for (const item of incomingCodings) {
5590
+ if (Array.isArray(item)) {
5591
+ c.push(coding(item[0], item[1]));
5592
+ } else {
5593
+ c.push(item);
5594
+ }
5595
+ }
5596
+ result.coding = c;
5597
+ return result;
5598
+ };
5599
+ var cc = concept;
5600
+ var reference = (ref2, opts) => {
5601
+ if (Array.isArray(ref2)) {
5602
+ return ref2.map(reference, opts);
5603
+ }
5604
+ if (ref2.resourceType && ref2.id) {
5605
+ return { reference: `${ref2.resourceType}/${ref2.id}` };
5606
+ }
5607
+ if (ref2.reference) {
5608
+ return ref2;
5609
+ }
5610
+ const result = {};
5611
+ if (typeof ref2 === "string") {
5612
+ result.reference = ref2;
5613
+ }
5614
+ if (opts) {
5615
+ Object.assign(result, opts);
5616
+ }
5617
+ return result;
5618
+ };
5619
+ var ref = reference;
5620
+ var composite = (object, key, value) => {
5621
+ const k = [key];
5622
+ if (value.coding) {
5623
+ k.push("CodeableConcept");
5624
+ } else if (value.reference) {
5625
+ k.push("Reference");
5626
+ } else if (value.id && value.meta && value.resourceType) {
5627
+ k.push("Reference");
5628
+ value = reference(value);
5629
+ } else if (value.start || value.end) {
5630
+ k.push("Period");
5631
+ } else if (value.dateTime) {
5632
+ k.push("DateTime");
5633
+ } else if (typeof value === "string") {
5634
+ if (datetimeregex.test(value)) {
5635
+ k.push("DateTime");
5636
+ } else {
5637
+ k.push("String");
5638
+ }
5639
+ } else if (typeof value === "boolean") {
5640
+ k.push("Boolean");
5641
+ } else if (typeof value === "number") {
5642
+ k.push("Integer");
5643
+ }
5644
+ if (k.length === 2) {
5645
+ const finalKey = k.join("");
5646
+ object[finalKey] = value;
5647
+ } else {
5648
+ console.warn(
5649
+ `WARNING: Failed to map ${key}: unrecognised data type (see utils.composite)`
5650
+ );
5651
+ }
5652
+ };
5653
+
5654
+ // src/Adaptor.js
5655
+ var import_language_common = require("@openfn/language-common");
5624
5656
 
5625
5657
  // src/builders.js
5626
5658
  var builders_exports = {};
@@ -5643,6 +5675,7 @@ __export(builders_exports, {
5643
5675
  schedule: () => schedule,
5644
5676
  slot: () => slot
5645
5677
  });
5678
+ var import_lodash2 = __toESM(require_lodash(), 1);
5646
5679
  function address(type, props) {
5647
5680
  const mappings = {
5648
5681
  "fr-core-address": address_fr_core_address
@@ -11734,21 +11767,26 @@ function slot_fr_core_slot(props) {
11734
11767
  };
11735
11768
  return resource;
11736
11769
  }
11737
- var import_lodash2;
11738
- var init_builders = __esm({
11739
- "src/builders.js"() {
11740
- init_utils();
11741
- import_lodash2 = __toESM(require_lodash(), 1);
11742
- }
11743
- });
11744
11770
 
11745
11771
  // src/index.js
11746
- exports.__esModule = true;
11747
- exports.b = exports.builders = exports.util = void 0;
11748
- init_builders();
11749
- exports.util = (init_utils(), __toCommonJS(utils_exports));
11750
- exports.builders = (init_builders(), __toCommonJS(builders_exports));
11751
- exports.b = (init_builders(), __toCommonJS(builders_exports));
11772
+ var src_default = Adaptor_exports;
11773
+ // Annotate the CommonJS export names for ESM import in node:
11774
+ 0 && (module.exports = {
11775
+ b,
11776
+ builders,
11777
+ cursor,
11778
+ dataPath,
11779
+ dataValue,
11780
+ dateFns,
11781
+ each,
11782
+ field,
11783
+ fields,
11784
+ fn,
11785
+ lastReferenceValue,
11786
+ merge,
11787
+ sourceValue,
11788
+ util
11789
+ });
11752
11790
  /**
11753
11791
  * @license
11754
11792
  * Lodash <https://lodash.com/>
package/dist/index.js CHANGED
@@ -4,9 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
- };
10
7
  var __commonJS = (cb, mod) => function __require() {
11
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
9
  };
@@ -26,11 +23,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
23
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
24
  mod
28
25
  ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
26
 
31
27
  // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js
32
28
  var require_lodash = __commonJS({
33
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports2, module) {
29
+ "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports, module) {
34
30
  (function() {
35
31
  var undefined2;
36
32
  var VERSION = "4.17.21";
@@ -356,7 +352,7 @@ var require_lodash = __commonJS({
356
352
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
357
353
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
358
354
  var root = freeGlobal || freeSelf || Function("return this")();
359
- var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
355
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
360
356
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
361
357
  var moduleExports = freeModule && freeModule.exports === freeExports;
362
358
  var freeProcess = moduleExports && freeGlobal.process;
@@ -2160,8 +2156,8 @@ var require_lodash = __commonJS({
2160
2156
  function createBind(func, bitmask, thisArg) {
2161
2157
  var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
2162
2158
  function wrapper() {
2163
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2164
- return fn.apply(isBind ? thisArg : this, arguments);
2159
+ var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2160
+ return fn2.apply(isBind ? thisArg : this, arguments);
2165
2161
  }
2166
2162
  return wrapper;
2167
2163
  }
@@ -2227,8 +2223,8 @@ var require_lodash = __commonJS({
2227
2223
  arity - length
2228
2224
  );
2229
2225
  }
2230
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2231
- return apply(fn, this, args);
2226
+ var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2227
+ return apply(fn2, this, args);
2232
2228
  }
2233
2229
  return wrapper;
2234
2230
  }
@@ -2316,7 +2312,7 @@ var require_lodash = __commonJS({
2316
2312
  arity - length
2317
2313
  );
2318
2314
  }
2319
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
2315
+ var thisBinding = isBind ? thisArg : this, fn2 = isBindKey ? thisBinding[func] : func;
2320
2316
  length = args.length;
2321
2317
  if (argPos) {
2322
2318
  args = reorder(args, argPos);
@@ -2327,9 +2323,9 @@ var require_lodash = __commonJS({
2327
2323
  args.length = ary2;
2328
2324
  }
2329
2325
  if (this && this !== root && this instanceof wrapper) {
2330
- fn = Ctor || createCtor(fn);
2326
+ fn2 = Ctor || createCtor(fn2);
2331
2327
  }
2332
- return fn.apply(thisBinding, args);
2328
+ return fn2.apply(thisBinding, args);
2333
2329
  }
2334
2330
  return wrapper;
2335
2331
  }
@@ -2386,14 +2382,14 @@ var require_lodash = __commonJS({
2386
2382
  function createPartial(func, bitmask, thisArg, partials) {
2387
2383
  var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
2388
2384
  function wrapper() {
2389
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
2385
+ var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
2390
2386
  while (++leftIndex < leftLength) {
2391
2387
  args[leftIndex] = partials[leftIndex];
2392
2388
  }
2393
2389
  while (argsLength--) {
2394
2390
  args[leftIndex++] = arguments[++argsIndex];
2395
2391
  }
2396
- return apply(fn, isBind ? thisArg : this, args);
2392
+ return apply(fn2, isBind ? thisArg : this, args);
2397
2393
  }
2398
2394
  return wrapper;
2399
2395
  }
@@ -4352,7 +4348,7 @@ var require_lodash = __commonJS({
4352
4348
  });
4353
4349
  return result2;
4354
4350
  }
4355
- var merge = createAssigner(function(object, source, srcIndex) {
4351
+ var merge2 = createAssigner(function(object, source, srcIndex) {
4356
4352
  baseMerge(object, source, srcIndex);
4357
4353
  });
4358
4354
  var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
@@ -5042,7 +5038,7 @@ var require_lodash = __commonJS({
5042
5038
  lodash.matches = matches;
5043
5039
  lodash.matchesProperty = matchesProperty;
5044
5040
  lodash.memoize = memoize;
5045
- lodash.merge = merge;
5041
+ lodash.merge = merge2;
5046
5042
  lodash.mergeWith = mergeWith;
5047
5043
  lodash.method = method;
5048
5044
  lodash.methodOf = methodOf;
@@ -5462,10 +5458,27 @@ var require_lodash = __commonJS({
5462
5458
  } else {
5463
5459
  root._ = _3;
5464
5460
  }
5465
- }).call(exports2);
5461
+ }).call(exports);
5466
5462
  }
5467
5463
  });
5468
5464
 
5465
+ // src/Adaptor.js
5466
+ var Adaptor_exports = {};
5467
+ __export(Adaptor_exports, {
5468
+ cursor: () => cursor,
5469
+ dataPath: () => dataPath,
5470
+ dataValue: () => dataValue,
5471
+ dateFns: () => dateFns,
5472
+ each: () => each,
5473
+ field: () => field,
5474
+ fields: () => fields,
5475
+ fn: () => fn,
5476
+ lastReferenceValue: () => lastReferenceValue,
5477
+ merge: () => merge,
5478
+ sourceValue: () => sourceValue
5479
+ });
5480
+ import { expandReferences } from "@openfn/language-common/util";
5481
+
5469
5482
  // src/utils.js
5470
5483
  var utils_exports = {};
5471
5484
  __export(utils_exports, {
@@ -5482,144 +5495,154 @@ __export(utils_exports, {
5482
5495
  reference: () => reference,
5483
5496
  setSystemMap: () => setSystemMap
5484
5497
  });
5485
- var import_lodash, systemMap, datetimeregex, mapSystems, setSystemMap, identifier, id, addExtension, findExtension, coding, concept, cc, reference, ref, composite;
5486
- var init_utils = __esm({
5487
- "src/utils.js"() {
5488
- import_lodash = __toESM(require_lodash(), 1);
5489
- systemMap = {
5490
- SmartCareID: "http://moh.gov.et/fhir/hiv/identifier/SmartCareID",
5491
- MRN: "http://moh.gov.et/fhir/hiv/identifier/MRN",
5492
- UAN: "http://moh.gov.et/fhir/hiv/identifier/UAN"
5493
- };
5494
- datetimeregex = /([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;
5495
- mapSystems = (obj) => {
5496
- if (Array.isArray(obj)) {
5497
- return obj.map(mapSystems);
5498
- }
5499
- if (obj.system in systemMap) {
5500
- return {
5501
- ...obj,
5502
- system: systemMap[obj.system]
5503
- };
5504
- }
5505
- return obj;
5506
- };
5507
- setSystemMap = (newMappings) => {
5508
- Object.assign(systemMap, newMappings);
5509
- };
5510
- identifier = (input, system) => {
5511
- if (Array.isArray(input)) {
5512
- return input.map((i) => identifier(i, system));
5513
- }
5514
- if (input) {
5515
- if (typeof input === "string") {
5516
- return mapSystems({
5517
- value: input,
5518
- system
5519
- });
5520
- } else if (system) {
5521
- return mapSystems({
5522
- system,
5523
- ...input
5524
- });
5525
- } else {
5526
- return mapSystems(input);
5527
- }
5528
- }
5529
- };
5530
- id = identifier;
5531
- addExtension = (resource, url, value) => {
5532
- const obj = {
5533
- url
5534
- };
5535
- composite(obj, "value", value);
5536
- resource.extension ?? (resource.extension = []);
5537
- resource.extension.push(obj);
5538
- };
5539
- findExtension = (obj, targetUrl, path) => {
5540
- var _a;
5541
- const result = (_a = obj.extension) == null ? void 0 : _a.find((ext) => ext.url === targetUrl);
5542
- if (result && path) {
5543
- return import_lodash.default.get(result, path);
5544
- }
5545
- return result;
5546
- };
5547
- coding = (code, system) => ({ code, system: mapSystems(system) });
5548
- concept = (text, ...codings) => {
5549
- const result = {};
5550
- let incomingCodings = codings;
5551
- if (typeof text === "string") {
5552
- result.text = text;
5553
- } else {
5554
- incomingCodings = [text].concat(codings);
5555
- }
5556
- const c = [];
5557
- for (const item of incomingCodings) {
5558
- if (Array.isArray(item)) {
5559
- c.push(coding(item[0], item[1]));
5560
- } else {
5561
- c.push(item);
5562
- }
5563
- }
5564
- result.coding = c;
5565
- return result;
5566
- };
5567
- cc = concept;
5568
- reference = (ref2, opts) => {
5569
- if (Array.isArray(ref2)) {
5570
- return ref2.map(reference, opts);
5571
- }
5572
- if (ref2.resourceType && ref2.id) {
5573
- return { reference: `${ref2.resourceType}/${ref2.id}` };
5574
- }
5575
- if (ref2.reference) {
5576
- return ref2;
5577
- }
5578
- const result = {};
5579
- if (typeof ref2 === "string") {
5580
- result.reference = ref2;
5581
- }
5582
- if (opts) {
5583
- Object.assign(result, opts);
5584
- }
5585
- return result;
5586
- };
5587
- ref = reference;
5588
- composite = (object, key, value) => {
5589
- const k = [key];
5590
- if (value.coding) {
5591
- k.push("CodeableConcept");
5592
- } else if (value.reference) {
5593
- k.push("Reference");
5594
- } else if (value.id && value.meta && value.resourceType) {
5595
- k.push("Reference");
5596
- value = reference(value);
5597
- } else if (value.start || value.end) {
5598
- k.push("Period");
5599
- } else if (value.dateTime) {
5600
- k.push("DateTime");
5601
- } else if (typeof value === "string") {
5602
- if (datetimeregex.test(value)) {
5603
- k.push("DateTime");
5604
- } else {
5605
- k.push("String");
5606
- }
5607
- } else if (typeof value === "boolean") {
5608
- k.push("Boolean");
5609
- } else if (typeof value === "number") {
5610
- k.push("Integer");
5611
- }
5612
- if (k.length === 2) {
5613
- const finalKey = k.join("");
5614
- object[finalKey] = value;
5615
- } else {
5616
- console.warn(
5617
- `WARNING: Failed to map ${key}: unrecognised data type (see utils.composite)`
5618
- );
5619
- }
5498
+ var import_lodash = __toESM(require_lodash(), 1);
5499
+ var systemMap = {
5500
+ SmartCareID: "http://moh.gov.et/fhir/hiv/identifier/SmartCareID",
5501
+ MRN: "http://moh.gov.et/fhir/hiv/identifier/MRN",
5502
+ UAN: "http://moh.gov.et/fhir/hiv/identifier/UAN"
5503
+ };
5504
+ var datetimeregex = /([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;
5505
+ var mapSystems = (obj) => {
5506
+ if (Array.isArray(obj)) {
5507
+ return obj.map(mapSystems);
5508
+ }
5509
+ if (obj.system in systemMap) {
5510
+ return {
5511
+ ...obj,
5512
+ system: systemMap[obj.system]
5620
5513
  };
5621
5514
  }
5622
- });
5515
+ return obj;
5516
+ };
5517
+ var setSystemMap = (newMappings) => {
5518
+ Object.assign(systemMap, newMappings);
5519
+ };
5520
+ var identifier = (input, system) => {
5521
+ if (Array.isArray(input)) {
5522
+ return input.map((i) => identifier(i, system));
5523
+ }
5524
+ if (input) {
5525
+ if (typeof input === "string") {
5526
+ return mapSystems({
5527
+ value: input,
5528
+ system
5529
+ });
5530
+ } else if (system) {
5531
+ return mapSystems({
5532
+ system,
5533
+ ...input
5534
+ });
5535
+ } else {
5536
+ return mapSystems(input);
5537
+ }
5538
+ }
5539
+ };
5540
+ var id = identifier;
5541
+ var addExtension = (resource, url, value) => {
5542
+ const obj = {
5543
+ url
5544
+ };
5545
+ composite(obj, "value", value);
5546
+ resource.extension ?? (resource.extension = []);
5547
+ resource.extension.push(obj);
5548
+ };
5549
+ var findExtension = (obj, targetUrl, path) => {
5550
+ var _a;
5551
+ const result = (_a = obj.extension) == null ? void 0 : _a.find((ext) => ext.url === targetUrl);
5552
+ if (result && path) {
5553
+ return import_lodash.default.get(result, path);
5554
+ }
5555
+ return result;
5556
+ };
5557
+ var coding = (code, system) => ({ code, system: mapSystems(system) });
5558
+ var concept = (text, ...codings) => {
5559
+ const result = {};
5560
+ let incomingCodings = codings;
5561
+ if (typeof text === "string") {
5562
+ result.text = text;
5563
+ } else {
5564
+ incomingCodings = [text].concat(codings);
5565
+ }
5566
+ const c = [];
5567
+ for (const item of incomingCodings) {
5568
+ if (Array.isArray(item)) {
5569
+ c.push(coding(item[0], item[1]));
5570
+ } else {
5571
+ c.push(item);
5572
+ }
5573
+ }
5574
+ result.coding = c;
5575
+ return result;
5576
+ };
5577
+ var cc = concept;
5578
+ var reference = (ref2, opts) => {
5579
+ if (Array.isArray(ref2)) {
5580
+ return ref2.map(reference, opts);
5581
+ }
5582
+ if (ref2.resourceType && ref2.id) {
5583
+ return { reference: `${ref2.resourceType}/${ref2.id}` };
5584
+ }
5585
+ if (ref2.reference) {
5586
+ return ref2;
5587
+ }
5588
+ const result = {};
5589
+ if (typeof ref2 === "string") {
5590
+ result.reference = ref2;
5591
+ }
5592
+ if (opts) {
5593
+ Object.assign(result, opts);
5594
+ }
5595
+ return result;
5596
+ };
5597
+ var ref = reference;
5598
+ var composite = (object, key, value) => {
5599
+ const k = [key];
5600
+ if (value.coding) {
5601
+ k.push("CodeableConcept");
5602
+ } else if (value.reference) {
5603
+ k.push("Reference");
5604
+ } else if (value.id && value.meta && value.resourceType) {
5605
+ k.push("Reference");
5606
+ value = reference(value);
5607
+ } else if (value.start || value.end) {
5608
+ k.push("Period");
5609
+ } else if (value.dateTime) {
5610
+ k.push("DateTime");
5611
+ } else if (typeof value === "string") {
5612
+ if (datetimeregex.test(value)) {
5613
+ k.push("DateTime");
5614
+ } else {
5615
+ k.push("String");
5616
+ }
5617
+ } else if (typeof value === "boolean") {
5618
+ k.push("Boolean");
5619
+ } else if (typeof value === "number") {
5620
+ k.push("Integer");
5621
+ }
5622
+ if (k.length === 2) {
5623
+ const finalKey = k.join("");
5624
+ object[finalKey] = value;
5625
+ } else {
5626
+ console.warn(
5627
+ `WARNING: Failed to map ${key}: unrecognised data type (see utils.composite)`
5628
+ );
5629
+ }
5630
+ };
5631
+
5632
+ // src/Adaptor.js
5633
+ import {
5634
+ dataPath,
5635
+ dataValue,
5636
+ dateFns,
5637
+ cursor,
5638
+ each,
5639
+ field,
5640
+ fields,
5641
+ fn,
5642
+ lastReferenceValue,
5643
+ merge,
5644
+ sourceValue
5645
+ } from "@openfn/language-common";
5623
5646
 
5624
5647
  // src/builders.js
5625
5648
  var builders_exports = {};
@@ -5642,6 +5665,7 @@ __export(builders_exports, {
5642
5665
  schedule: () => schedule,
5643
5666
  slot: () => slot
5644
5667
  });
5668
+ var import_lodash2 = __toESM(require_lodash(), 1);
5645
5669
  function address(type, props) {
5646
5670
  const mappings = {
5647
5671
  "fr-core-address": address_fr_core_address
@@ -11733,21 +11757,26 @@ function slot_fr_core_slot(props) {
11733
11757
  };
11734
11758
  return resource;
11735
11759
  }
11736
- var import_lodash2;
11737
- var init_builders = __esm({
11738
- "src/builders.js"() {
11739
- init_utils();
11740
- import_lodash2 = __toESM(require_lodash(), 1);
11741
- }
11742
- });
11743
11760
 
11744
11761
  // src/index.js
11745
- exports.__esModule = true;
11746
- exports.b = exports.builders = exports.util = void 0;
11747
- init_builders();
11748
- exports.util = (init_utils(), __toCommonJS(utils_exports));
11749
- exports.builders = (init_builders(), __toCommonJS(builders_exports));
11750
- exports.b = (init_builders(), __toCommonJS(builders_exports));
11762
+ var src_default = Adaptor_exports;
11763
+ export {
11764
+ builders_exports as b,
11765
+ builders_exports as builders,
11766
+ cursor,
11767
+ dataPath,
11768
+ dataValue,
11769
+ dateFns,
11770
+ src_default as default,
11771
+ each,
11772
+ field,
11773
+ fields,
11774
+ fn,
11775
+ lastReferenceValue,
11776
+ merge,
11777
+ sourceValue,
11778
+ utils_exports as util
11779
+ };
11751
11780
  /**
11752
11781
  * @license
11753
11782
  * Lodash <https://lodash.com/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-fhir-fr",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "OpenFn fhir-fr adaptor",
5
5
  "author": "Open Function Group",
6
6
  "license": "LGPLv3",
@@ -11,8 +11,8 @@
11
11
  "webUrl": "https://hl7.fr/ig/fhir/core",
12
12
  "specDate": "2024-03-25",
13
13
  "specUrl": "https://hl7.fr/ig/fhir/core/2.0.0/definitions.json.zip",
14
- "adaptorGeneratedDate": "2024-11-29T18:01:10.462Z",
15
- "generatorVersion": "0.2.0"
14
+ "adaptorGeneratedDate": "2024-12-01T15:19:38.395Z",
15
+ "generatorVersion": "0.2.1"
16
16
  },
17
17
  "dependencies": {
18
18
  "@openfn/language-common": "2.1.1"
@@ -56,13 +56,11 @@ type Address_fr_core_address_Props = {
56
56
  period: Period;
57
57
  };
58
58
 
59
- type Address_variants = "fr-core-address";
60
-
61
59
  type Address__lookups = {
62
60
  "fr-core-address": Address_fr_core_address_Props;
63
61
  };
64
62
 
65
- export declare function address<T extends Address_variants>(type: Address_variants, props: Address__lookups[T]);;
63
+ export declare function address<T extends keyof Address__lookups>(type: T, props: Address__lookups[T]);;
66
64
 
67
65
  type Extension_fr_core_address_insee_code_Props = {
68
66
  /**
@@ -813,8 +811,6 @@ type Extension_fr_core_use_period_Props = {
813
811
  value: Period;
814
812
  };
815
813
 
816
- type Extension_variants = "fr-core-address-insee-code" | "fr-core-appointment-operator" | "fr-core-comment" | "fr-core-contact-point-email-type" | "fr-core-estimated-discharge-date" | "fr-core-human-name-assembly-order" | "fr-core-identity-reliability" | "fr-core-location-position-room" | "fr-core-lunar-date" | "fr-core-observation-body-position-ext" | "fr-core-observation-height-body-position" | "fr-core-observation-level-of-exertion" | "fr-core-organization-activity-field" | "fr-core-organization-activity-type" | "fr-core-organization-analysis-section" | "fr-core-organization-applicant-act" | "fr-core-organization-budget-letter" | "fr-core-organization-description" | "fr-core-organization-executant" | "fr-core-organization-external" | "fr-core-organization-field" | "fr-core-organization-number-of-theorical-accomadation-space" | "fr-core-organization-prestation-discipline" | "fr-core-organization-short-name" | "fr-core-patient-birth-list-given-name" | "fr-core-patient-birthdate-update-indicator" | "fr-core-patient-contact-identifier" | "fr-core-patient-death-place" | "fr-core-patient-nationality" | "fr-core-practitioner-profession" | "fr-core-practitioner-specialty" | "fr-core-role-code-categorie-professionnelle" | "fr-core-schedule-availability-time" | "fr-core-service-type-duration" | "fr-core-slot-date" | "fr-core-use-period";
817
-
818
814
  type Extension__lookups = {
819
815
  "fr-core-address-insee-code": Extension_fr_core_address_insee_code_Props;
820
816
  "fr-core-appointment-operator": Extension_fr_core_appointment_operator_Props;
@@ -854,7 +850,7 @@ type Extension__lookups = {
854
850
  "fr-core-use-period": Extension_fr_core_use_period_Props;
855
851
  };
856
852
 
857
- export declare function extension<T extends Extension_variants>(type: Extension_variants, props: Extension__lookups[T]);;
853
+ export declare function extension<T extends keyof Extension__lookups>(type: T, props: Extension__lookups[T]);;
858
854
 
859
855
  type Appointment_fr_core_appointment_Props = {
860
856
  /**
@@ -1037,13 +1033,11 @@ type Appointment_fr_core_appointment_Props = {
1037
1033
  requestedPeriod: Period;
1038
1034
  };
1039
1035
 
1040
- type Appointment_variants = "fr-core-appointment";
1041
-
1042
1036
  type Appointment__lookups = {
1043
1037
  "fr-core-appointment": Appointment_fr_core_appointment_Props;
1044
1038
  };
1045
1039
 
1046
- export declare function appointment<T extends Appointment_variants>(type: Appointment_variants, props: Appointment__lookups[T]);;
1040
+ export declare function appointment<T extends keyof Appointment__lookups>(type: T, props: Appointment__lookups[T]);;
1047
1041
 
1048
1042
  type ContactPoint_fr_core_contact_point_Props = {
1049
1043
  /**
@@ -1076,13 +1070,11 @@ type ContactPoint_fr_core_contact_point_Props = {
1076
1070
  period: Period;
1077
1071
  };
1078
1072
 
1079
- type ContactPoint_variants = "fr-core-contact-point";
1080
-
1081
1073
  type ContactPoint__lookups = {
1082
1074
  "fr-core-contact-point": ContactPoint_fr_core_contact_point_Props;
1083
1075
  };
1084
1076
 
1085
- export declare function contactPoint<T extends ContactPoint_variants>(type: ContactPoint_variants, props: ContactPoint__lookups[T]);;
1077
+ export declare function contactPoint<T extends keyof ContactPoint__lookups>(type: T, props: ContactPoint__lookups[T]);;
1086
1078
 
1087
1079
  type Encounter_fr_core_encounter_Props = {
1088
1080
  /**
@@ -1440,13 +1432,11 @@ type Encounter_fr_core_encounter_Props = {
1440
1432
  partOf: Reference;
1441
1433
  };
1442
1434
 
1443
- type Encounter_variants = "fr-core-encounter";
1444
-
1445
1435
  type Encounter__lookups = {
1446
1436
  "fr-core-encounter": Encounter_fr_core_encounter_Props;
1447
1437
  };
1448
1438
 
1449
- export declare function encounter<T extends Encounter_variants>(type: Encounter_variants, props: Encounter__lookups[T]);;
1439
+ export declare function encounter<T extends keyof Encounter__lookups>(type: T, props: Encounter__lookups[T]);;
1450
1440
 
1451
1441
  type HealthcareService_fr_core_healthcare_service_Props = {
1452
1442
  /**
@@ -1696,13 +1686,11 @@ type HealthcareService_fr_core_healthcare_service_Props = {
1696
1686
  endpoint: Reference;
1697
1687
  };
1698
1688
 
1699
- type HealthcareService_variants = "fr-core-healthcare-service";
1700
-
1701
1689
  type HealthcareService__lookups = {
1702
1690
  "fr-core-healthcare-service": HealthcareService_fr_core_healthcare_service_Props;
1703
1691
  };
1704
1692
 
1705
- export declare function healthcareService<T extends HealthcareService_variants>(type: HealthcareService_variants, props: HealthcareService__lookups[T]);;
1693
+ export declare function healthcareService<T extends keyof HealthcareService__lookups>(type: T, props: HealthcareService__lookups[T]);;
1706
1694
 
1707
1695
  type HumanName_fr_core_human_name_Props = {
1708
1696
  /**
@@ -1743,13 +1731,11 @@ type HumanName_fr_core_human_name_Props = {
1743
1731
  period: Period;
1744
1732
  };
1745
1733
 
1746
- type HumanName_variants = "fr-core-human-name";
1747
-
1748
1734
  type HumanName__lookups = {
1749
1735
  "fr-core-human-name": HumanName_fr_core_human_name_Props;
1750
1736
  };
1751
1737
 
1752
- export declare function humanName<T extends HumanName_variants>(type: HumanName_variants, props: HumanName__lookups[T]);;
1738
+ export declare function humanName<T extends keyof HumanName__lookups>(type: T, props: HumanName__lookups[T]);;
1753
1739
 
1754
1740
  type Location_fr_core_location_Props = {
1755
1741
  /**
@@ -1983,13 +1969,11 @@ type Location_fr_core_location_Props = {
1983
1969
  endpoint: Reference;
1984
1970
  };
1985
1971
 
1986
- type Location_variants = "fr-core-location";
1987
-
1988
1972
  type Location__lookups = {
1989
1973
  "fr-core-location": Location_fr_core_location_Props;
1990
1974
  };
1991
1975
 
1992
- export declare function location<T extends Location_variants>(type: Location_variants, props: Location__lookups[T]);;
1976
+ export declare function location<T extends keyof Location__lookups>(type: T, props: Location__lookups[T]);;
1993
1977
 
1994
1978
  type MedicationAdministration_fr_core_medication_administration_inhaled_oxygen_Props = {
1995
1979
  /**
@@ -2194,13 +2178,11 @@ type MedicationAdministration_fr_core_medication_administration_inhaled_oxygen_P
2194
2178
  eventHistory: Reference;
2195
2179
  };
2196
2180
 
2197
- type MedicationAdministration_variants = "fr-core-medication-administration-inhaled-oxygen";
2198
-
2199
2181
  type MedicationAdministration__lookups = {
2200
2182
  "fr-core-medication-administration-inhaled-oxygen": MedicationAdministration_fr_core_medication_administration_inhaled_oxygen_Props;
2201
2183
  };
2202
2184
 
2203
- export declare function medicationAdministration<T extends MedicationAdministration_variants>(type: MedicationAdministration_variants, props: MedicationAdministration__lookups[T]);;
2185
+ export declare function medicationAdministration<T extends keyof MedicationAdministration__lookups>(type: T, props: MedicationAdministration__lookups[T]);;
2204
2186
 
2205
2187
  type Observation_fr_core_observation_bmi_Props = {
2206
2188
  /**
@@ -4645,8 +4627,6 @@ type Observation_fr_core_observation_saturation_oxygen_Props = {
4645
4627
  };
4646
4628
  };
4647
4629
 
4648
- type Observation_variants = "fr-core-observation-bmi" | "fr-core-observation-body-height" | "fr-core-observation-body-temperature" | "fr-core-observation-body-weight" | "fr-core-observation-bp" | "fr-core-observation-head-circum" | "fr-core-observation-heartrate" | "fr-core-observation-resp-rate" | "fr-core-observation-saturation-oxygen";
4649
-
4650
4630
  type Observation__lookups = {
4651
4631
  "fr-core-observation-bmi": Observation_fr_core_observation_bmi_Props;
4652
4632
  "fr-core-observation-body-height": Observation_fr_core_observation_body_height_Props;
@@ -4659,7 +4639,7 @@ type Observation__lookups = {
4659
4639
  "fr-core-observation-saturation-oxygen": Observation_fr_core_observation_saturation_oxygen_Props;
4660
4640
  };
4661
4641
 
4662
- export declare function observation<T extends Observation_variants>(type: Observation_variants, props: Observation__lookups[T]);;
4642
+ export declare function observation<T extends keyof Observation__lookups>(type: T, props: Observation__lookups[T]);;
4663
4643
 
4664
4644
  type Organization_fr_core_organization_Props = {
4665
4645
  /**
@@ -5369,8 +5349,6 @@ type Organization_fr_core_organization_uf_Props = {
5369
5349
  endpoint: Reference;
5370
5350
  };
5371
5351
 
5372
- type Organization_variants = "fr-core-organization" | "fr-core-organization-pole" | "fr-core-organization-uac" | "fr-core-organization-uf";
5373
-
5374
5352
  type Organization__lookups = {
5375
5353
  "fr-core-organization": Organization_fr_core_organization_Props;
5376
5354
  "fr-core-organization-pole": Organization_fr_core_organization_pole_Props;
@@ -5378,7 +5356,7 @@ type Organization__lookups = {
5378
5356
  "fr-core-organization-uf": Organization_fr_core_organization_uf_Props;
5379
5357
  };
5380
5358
 
5381
- export declare function organization<T extends Organization_variants>(type: Organization_variants, props: Organization__lookups[T]);;
5359
+ export declare function organization<T extends keyof Organization__lookups>(type: T, props: Organization__lookups[T]);;
5382
5360
 
5383
5361
  type Patient_fr_core_patient_Props = {
5384
5362
  /**
@@ -5952,14 +5930,12 @@ type Patient_fr_core_patient_ins_Props = {
5952
5930
  };
5953
5931
  };
5954
5932
 
5955
- type Patient_variants = "fr-core-patient" | "fr-core-patient-ins";
5956
-
5957
5933
  type Patient__lookups = {
5958
5934
  "fr-core-patient": Patient_fr_core_patient_Props;
5959
5935
  "fr-core-patient-ins": Patient_fr_core_patient_ins_Props;
5960
5936
  };
5961
5937
 
5962
- export declare function patient<T extends Patient_variants>(type: Patient_variants, props: Patient__lookups[T]);;
5938
+ export declare function patient<T extends keyof Patient__lookups>(type: T, props: Patient__lookups[T]);;
5963
5939
 
5964
5940
  type Practitioner_fr_core_practitioner_Props = {
5965
5941
  /**
@@ -6119,13 +6095,11 @@ type Practitioner_fr_core_practitioner_Props = {
6119
6095
  communication: CodeableConcept;
6120
6096
  };
6121
6097
 
6122
- type Practitioner_variants = "fr-core-practitioner";
6123
-
6124
6098
  type Practitioner__lookups = {
6125
6099
  "fr-core-practitioner": Practitioner_fr_core_practitioner_Props;
6126
6100
  };
6127
6101
 
6128
- export declare function practitioner<T extends Practitioner_variants>(type: Practitioner_variants, props: Practitioner__lookups[T]);;
6102
+ export declare function practitioner<T extends keyof Practitioner__lookups>(type: T, props: Practitioner__lookups[T]);;
6129
6103
 
6130
6104
  type PractitionerRole_fr_core_practitioner_role_exercice_Props = {
6131
6105
  /**
@@ -6497,14 +6471,12 @@ type PractitionerRole_fr_core_practitioner_role_profession_Props = {
6497
6471
  endpoint: Reference;
6498
6472
  };
6499
6473
 
6500
- type PractitionerRole_variants = "fr-core-practitioner-role-exercice" | "fr-core-practitioner-role-profession";
6501
-
6502
6474
  type PractitionerRole__lookups = {
6503
6475
  "fr-core-practitioner-role-exercice": PractitionerRole_fr_core_practitioner_role_exercice_Props;
6504
6476
  "fr-core-practitioner-role-profession": PractitionerRole_fr_core_practitioner_role_profession_Props;
6505
6477
  };
6506
6478
 
6507
- export declare function practitionerRole<T extends PractitionerRole_variants>(type: PractitionerRole_variants, props: PractitionerRole__lookups[T]);;
6479
+ export declare function practitionerRole<T extends keyof PractitionerRole__lookups>(type: T, props: PractitionerRole__lookups[T]);;
6508
6480
 
6509
6481
  type RelatedPerson_fr_core_related_person_Props = {
6510
6482
  /**
@@ -6648,13 +6620,11 @@ type RelatedPerson_fr_core_related_person_Props = {
6648
6620
  };
6649
6621
  };
6650
6622
 
6651
- type RelatedPerson_variants = "fr-core-related-person";
6652
-
6653
6623
  type RelatedPerson__lookups = {
6654
6624
  "fr-core-related-person": RelatedPerson_fr_core_related_person_Props;
6655
6625
  };
6656
6626
 
6657
- export declare function relatedPerson<T extends RelatedPerson_variants>(type: RelatedPerson_variants, props: RelatedPerson__lookups[T]);;
6627
+ export declare function relatedPerson<T extends keyof RelatedPerson__lookups>(type: T, props: RelatedPerson__lookups[T]);;
6658
6628
 
6659
6629
  type Schedule_fr_core_schedule_Props = {
6660
6630
  /**
@@ -6752,13 +6722,11 @@ type Schedule_fr_core_schedule_Props = {
6752
6722
  comment: string;
6753
6723
  };
6754
6724
 
6755
- type Schedule_variants = "fr-core-schedule";
6756
-
6757
6725
  type Schedule__lookups = {
6758
6726
  "fr-core-schedule": Schedule_fr_core_schedule_Props;
6759
6727
  };
6760
6728
 
6761
- export declare function schedule<T extends Schedule_variants>(type: Schedule_variants, props: Schedule__lookups[T]);;
6729
+ export declare function schedule<T extends keyof Schedule__lookups>(type: T, props: Schedule__lookups[T]);;
6762
6730
 
6763
6731
  type Slot_fr_core_slot_Props = {
6764
6732
  /**
@@ -6897,10 +6865,8 @@ type Slot_fr_core_slot_Props = {
6897
6865
  comment: string;
6898
6866
  };
6899
6867
 
6900
- type Slot_variants = "fr-core-slot";
6901
-
6902
6868
  type Slot__lookups = {
6903
6869
  "fr-core-slot": Slot_fr_core_slot_Props;
6904
6870
  };
6905
6871
 
6906
- export declare function slot<T extends Slot_variants>(type: Slot_variants, props: Slot__lookups[T]);;
6872
+ export declare function slot<T extends keyof Slot__lookups>(type: T, props: Slot__lookups[T]);;
package/types/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import './builders';
2
+ import * as Adaptor from './Adaptor';
3
+ export default Adaptor;
2
4
  export * as util from './utils';
3
5
  export * as builders from './builders';
4
6
  export * as b from './builders';