fhirpath-ts 0.0.0-bootstrap.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.
Files changed (414) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +391 -0
  3. package/THIRD-PARTY-NOTICES.md +296 -0
  4. package/dist/analyzer/analyze-dto.d.ts +45 -0
  5. package/dist/analyzer/analyze-dto.d.ts.map +1 -0
  6. package/dist/analyzer/analyze-dto.js +147 -0
  7. package/dist/analyzer/analyze-dto.js.map +1 -0
  8. package/dist/analyzer/analyze.d.ts +98 -0
  9. package/dist/analyzer/analyze.d.ts.map +1 -0
  10. package/dist/analyzer/analyze.js +925 -0
  11. package/dist/analyzer/analyze.js.map +1 -0
  12. package/dist/analyzer/expression-policy.d.ts +210 -0
  13. package/dist/analyzer/expression-policy.d.ts.map +1 -0
  14. package/dist/analyzer/expression-policy.js +254 -0
  15. package/dist/analyzer/expression-policy.js.map +1 -0
  16. package/dist/analyzer/index.d.ts +3 -0
  17. package/dist/analyzer/index.d.ts.map +1 -0
  18. package/dist/analyzer/index.js +6 -0
  19. package/dist/analyzer/index.js.map +1 -0
  20. package/dist/analyzer/regex-safety.d.ts +10 -0
  21. package/dist/analyzer/regex-safety.d.ts.map +1 -0
  22. package/dist/analyzer/regex-safety.js +84 -0
  23. package/dist/analyzer/regex-safety.js.map +1 -0
  24. package/dist/analyzer/signatures.d.ts +72 -0
  25. package/dist/analyzer/signatures.d.ts.map +1 -0
  26. package/dist/analyzer/signatures.js +195 -0
  27. package/dist/analyzer/signatures.js.map +1 -0
  28. package/dist/api/bundle.d.ts +29 -0
  29. package/dist/api/bundle.d.ts.map +1 -0
  30. package/dist/api/bundle.js +108 -0
  31. package/dist/api/bundle.js.map +1 -0
  32. package/dist/api/cache.d.ts +10 -0
  33. package/dist/api/cache.d.ts.map +1 -0
  34. package/dist/api/cache.js +38 -0
  35. package/dist/api/cache.js.map +1 -0
  36. package/dist/api/column-signature.d.ts +53 -0
  37. package/dist/api/column-signature.d.ts.map +1 -0
  38. package/dist/api/column-signature.js +43 -0
  39. package/dist/api/column-signature.js.map +1 -0
  40. package/dist/api/compile.d.ts +120 -0
  41. package/dist/api/compile.d.ts.map +1 -0
  42. package/dist/api/compile.js +167 -0
  43. package/dist/api/compile.js.map +1 -0
  44. package/dist/api/constraints.d.ts +48 -0
  45. package/dist/api/constraints.d.ts.map +1 -0
  46. package/dist/api/constraints.js +52 -0
  47. package/dist/api/constraints.js.map +1 -0
  48. package/dist/api/dto.d.ts +134 -0
  49. package/dist/api/dto.d.ts.map +1 -0
  50. package/dist/api/dto.js +295 -0
  51. package/dist/api/dto.js.map +1 -0
  52. package/dist/api/engine.d.ts +136 -0
  53. package/dist/api/engine.d.ts.map +1 -0
  54. package/dist/api/engine.js +183 -0
  55. package/dist/api/engine.js.map +1 -0
  56. package/dist/api/evaluate.d.ts +7 -0
  57. package/dist/api/evaluate.d.ts.map +1 -0
  58. package/dist/api/evaluate.js +10 -0
  59. package/dist/api/evaluate.js.map +1 -0
  60. package/dist/api/project.d.ts +89 -0
  61. package/dist/api/project.d.ts.map +1 -0
  62. package/dist/api/project.js +150 -0
  63. package/dist/api/project.js.map +1 -0
  64. package/dist/api/tagged.d.ts +14 -0
  65. package/dist/api/tagged.d.ts.map +1 -0
  66. package/dist/api/tagged.js +13 -0
  67. package/dist/api/tagged.js.map +1 -0
  68. package/dist/cli/dto-check.d.ts +25 -0
  69. package/dist/cli/dto-check.d.ts.map +1 -0
  70. package/dist/cli/dto-check.js +77 -0
  71. package/dist/cli/dto-check.js.map +1 -0
  72. package/dist/cli/fhirpath-check.d.ts +3 -0
  73. package/dist/cli/fhirpath-check.d.ts.map +1 -0
  74. package/dist/cli/fhirpath-check.js +149 -0
  75. package/dist/cli/fhirpath-check.js.map +1 -0
  76. package/dist/cli/ts-loader.d.mts +3 -0
  77. package/dist/cli/ts-loader.d.mts.map +1 -0
  78. package/dist/cli/ts-loader.mjs +48 -0
  79. package/dist/cli/ts-loader.mjs.map +1 -0
  80. package/dist/engine/context.d.ts +173 -0
  81. package/dist/engine/context.d.ts.map +1 -0
  82. package/dist/engine/context.js +118 -0
  83. package/dist/engine/context.js.map +1 -0
  84. package/dist/engine/evaluator.d.ts +7 -0
  85. package/dist/engine/evaluator.d.ts.map +1 -0
  86. package/dist/engine/evaluator.js +196 -0
  87. package/dist/engine/evaluator.js.map +1 -0
  88. package/dist/engine/navigation.d.ts +11 -0
  89. package/dist/engine/navigation.d.ts.map +1 -0
  90. package/dist/engine/navigation.js +102 -0
  91. package/dist/engine/navigation.js.map +1 -0
  92. package/dist/engine/operators/collections.d.ts +12 -0
  93. package/dist/engine/operators/collections.d.ts.map +1 -0
  94. package/dist/engine/operators/collections.js +31 -0
  95. package/dist/engine/operators/collections.js.map +1 -0
  96. package/dist/engine/operators/comparison.d.ts +13 -0
  97. package/dist/engine/operators/comparison.d.ts.map +1 -0
  98. package/dist/engine/operators/comparison.js +77 -0
  99. package/dist/engine/operators/comparison.js.map +1 -0
  100. package/dist/engine/operators/equality.d.ts +19 -0
  101. package/dist/engine/operators/equality.d.ts.map +1 -0
  102. package/dist/engine/operators/equality.js +203 -0
  103. package/dist/engine/operators/equality.js.map +1 -0
  104. package/dist/engine/operators/index.d.ts +18 -0
  105. package/dist/engine/operators/index.d.ts.map +1 -0
  106. package/dist/engine/operators/index.js +30 -0
  107. package/dist/engine/operators/index.js.map +1 -0
  108. package/dist/engine/operators/logic.d.ts +8 -0
  109. package/dist/engine/operators/logic.d.ts.map +1 -0
  110. package/dist/engine/operators/logic.js +38 -0
  111. package/dist/engine/operators/logic.js.map +1 -0
  112. package/dist/engine/operators/math.d.ts +13 -0
  113. package/dist/engine/operators/math.d.ts.map +1 -0
  114. package/dist/engine/operators/math.js +198 -0
  115. package/dist/engine/operators/math.js.map +1 -0
  116. package/dist/engine/operators/strings.d.ts +8 -0
  117. package/dist/engine/operators/strings.d.ts.map +1 -0
  118. package/dist/engine/operators/strings.js +22 -0
  119. package/dist/engine/operators/strings.js.map +1 -0
  120. package/dist/engine/operators/types.d.ts +3 -0
  121. package/dist/engine/operators/types.d.ts.map +1 -0
  122. package/dist/engine/operators/types.js +15 -0
  123. package/dist/engine/operators/types.js.map +1 -0
  124. package/dist/engine/type-matching.d.ts +20 -0
  125. package/dist/engine/type-matching.d.ts.map +1 -0
  126. package/dist/engine/type-matching.js +122 -0
  127. package/dist/engine/type-matching.js.map +1 -0
  128. package/dist/errors.d.ts +25 -0
  129. package/dist/errors.d.ts.map +1 -0
  130. package/dist/errors.js +21 -0
  131. package/dist/errors.js.map +1 -0
  132. package/dist/eslint/index.d.ts +12 -0
  133. package/dist/eslint/index.d.ts.map +1 -0
  134. package/dist/eslint/index.js +316 -0
  135. package/dist/eslint/index.js.map +1 -0
  136. package/dist/fhir/html-checks.d.ts +7 -0
  137. package/dist/fhir/html-checks.d.ts.map +1 -0
  138. package/dist/fhir/html-checks.js +256 -0
  139. package/dist/fhir/html-checks.js.map +1 -0
  140. package/dist/fhir/model-navigation.d.ts +11 -0
  141. package/dist/fhir/model-navigation.d.ts.map +1 -0
  142. package/dist/fhir/model-navigation.js +142 -0
  143. package/dist/fhir/model-navigation.js.map +1 -0
  144. package/dist/functions/aggregate.d.ts +2 -0
  145. package/dist/functions/aggregate.d.ts.map +1 -0
  146. package/dist/functions/aggregate.js +127 -0
  147. package/dist/functions/aggregate.js.map +1 -0
  148. package/dist/functions/boundary.d.ts +2 -0
  149. package/dist/functions/boundary.d.ts.map +1 -0
  150. package/dist/functions/boundary.js +189 -0
  151. package/dist/functions/boundary.js.map +1 -0
  152. package/dist/functions/combining.d.ts +2 -0
  153. package/dist/functions/combining.d.ts.map +1 -0
  154. package/dist/functions/combining.js +13 -0
  155. package/dist/functions/combining.js.map +1 -0
  156. package/dist/functions/control.d.ts +2 -0
  157. package/dist/functions/control.d.ts.map +1 -0
  158. package/dist/functions/control.js +25 -0
  159. package/dist/functions/control.js.map +1 -0
  160. package/dist/functions/conversion.d.ts +3 -0
  161. package/dist/functions/conversion.d.ts.map +1 -0
  162. package/dist/functions/conversion.js +316 -0
  163. package/dist/functions/conversion.js.map +1 -0
  164. package/dist/functions/date-components.d.ts +2 -0
  165. package/dist/functions/date-components.d.ts.map +1 -0
  166. package/dist/functions/date-components.js +81 -0
  167. package/dist/functions/date-components.js.map +1 -0
  168. package/dist/functions/existence.d.ts +4 -0
  169. package/dist/functions/existence.d.ts.map +1 -0
  170. package/dist/functions/existence.js +97 -0
  171. package/dist/functions/existence.js.map +1 -0
  172. package/dist/functions/fhir.d.ts +2 -0
  173. package/dist/functions/fhir.d.ts.map +1 -0
  174. package/dist/functions/fhir.js +222 -0
  175. package/dist/functions/fhir.js.map +1 -0
  176. package/dist/functions/filtering.d.ts +2 -0
  177. package/dist/functions/filtering.d.ts.map +1 -0
  178. package/dist/functions/filtering.js +112 -0
  179. package/dist/functions/filtering.js.map +1 -0
  180. package/dist/functions/install.d.ts +18 -0
  181. package/dist/functions/install.d.ts.map +1 -0
  182. package/dist/functions/install.js +20 -0
  183. package/dist/functions/install.js.map +1 -0
  184. package/dist/functions/iteration.d.ts +7 -0
  185. package/dist/functions/iteration.d.ts.map +1 -0
  186. package/dist/functions/iteration.js +9 -0
  187. package/dist/functions/iteration.js.map +1 -0
  188. package/dist/functions/math.d.ts +2 -0
  189. package/dist/functions/math.d.ts.map +1 -0
  190. package/dist/functions/math.js +152 -0
  191. package/dist/functions/math.js.map +1 -0
  192. package/dist/functions/reflection.d.ts +2 -0
  193. package/dist/functions/reflection.d.ts.map +1 -0
  194. package/dist/functions/reflection.js +23 -0
  195. package/dist/functions/reflection.js.map +1 -0
  196. package/dist/functions/registry.d.ts +28 -0
  197. package/dist/functions/registry.d.ts.map +1 -0
  198. package/dist/functions/registry.js +46 -0
  199. package/dist/functions/registry.js.map +1 -0
  200. package/dist/functions/sort.d.ts +2 -0
  201. package/dist/functions/sort.d.ts.map +1 -0
  202. package/dist/functions/sort.js +48 -0
  203. package/dist/functions/sort.js.map +1 -0
  204. package/dist/functions/string.d.ts +2 -0
  205. package/dist/functions/string.d.ts.map +1 -0
  206. package/dist/functions/string.js +353 -0
  207. package/dist/functions/string.js.map +1 -0
  208. package/dist/functions/subsetting.d.ts +2 -0
  209. package/dist/functions/subsetting.d.ts.map +1 -0
  210. package/dist/functions/subsetting.js +72 -0
  211. package/dist/functions/subsetting.js.map +1 -0
  212. package/dist/functions/tree.d.ts +8 -0
  213. package/dist/functions/tree.d.ts.map +1 -0
  214. package/dist/functions/tree.js +109 -0
  215. package/dist/functions/tree.js.map +1 -0
  216. package/dist/functions/type-specifier.d.ts +8 -0
  217. package/dist/functions/type-specifier.d.ts.map +1 -0
  218. package/dist/functions/type-specifier.js +27 -0
  219. package/dist/functions/type-specifier.js.map +1 -0
  220. package/dist/functions/utility.d.ts +2 -0
  221. package/dist/functions/utility.d.ts.map +1 -0
  222. package/dist/functions/utility.js +76 -0
  223. package/dist/functions/utility.js.map +1 -0
  224. package/dist/functions/variables.d.ts +2 -0
  225. package/dist/functions/variables.d.ts.map +1 -0
  226. package/dist/functions/variables.js +35 -0
  227. package/dist/functions/variables.js.map +1 -0
  228. package/dist/index.d.ts +25 -0
  229. package/dist/index.d.ts.map +1 -0
  230. package/dist/index.js +11 -0
  231. package/dist/index.js.map +1 -0
  232. package/dist/lexer/lexer.d.ts +4 -0
  233. package/dist/lexer/lexer.d.ts.map +1 -0
  234. package/dist/lexer/lexer.js +318 -0
  235. package/dist/lexer/lexer.js.map +1 -0
  236. package/dist/lexer/tokens.d.ts +23 -0
  237. package/dist/lexer/tokens.d.ts.map +1 -0
  238. package/dist/lexer/tokens.js +40 -0
  239. package/dist/lexer/tokens.js.map +1 -0
  240. package/dist/model/provider.d.ts +36 -0
  241. package/dist/model/provider.d.ts.map +1 -0
  242. package/dist/model/provider.js +2 -0
  243. package/dist/model/provider.js.map +1 -0
  244. package/dist/parser/ast.d.ts +104 -0
  245. package/dist/parser/ast.d.ts.map +1 -0
  246. package/dist/parser/ast.js +2 -0
  247. package/dist/parser/ast.js.map +1 -0
  248. package/dist/parser/parser.d.ts +4 -0
  249. package/dist/parser/parser.d.ts.map +1 -0
  250. package/dist/parser/parser.js +299 -0
  251. package/dist/parser/parser.js.map +1 -0
  252. package/dist/parser/precedence.d.ts +24 -0
  253. package/dist/parser/precedence.d.ts.map +1 -0
  254. package/dist/parser/precedence.js +52 -0
  255. package/dist/parser/precedence.js.map +1 -0
  256. package/dist/parser/printer.d.ts +4 -0
  257. package/dist/parser/printer.d.ts.map +1 -0
  258. package/dist/parser/printer.js +112 -0
  259. package/dist/parser/printer.js.map +1 -0
  260. package/dist/r4/generated/resources-data.d.ts +3 -0
  261. package/dist/r4/generated/resources-data.d.ts.map +1 -0
  262. package/dist/r4/generated/resources-data.js +28628 -0
  263. package/dist/r4/generated/resources-data.js.map +1 -0
  264. package/dist/r4/generated/type-maps.d.ts +43153 -0
  265. package/dist/r4/generated/type-maps.d.ts.map +1 -0
  266. package/dist/r4/generated/type-maps.js +4 -0
  267. package/dist/r4/generated/type-maps.js.map +1 -0
  268. package/dist/r4/generated/types-data.d.ts +3 -0
  269. package/dist/r4/generated/types-data.d.ts.map +1 -0
  270. package/dist/r4/generated/types-data.js +2205 -0
  271. package/dist/r4/generated/types-data.js.map +1 -0
  272. package/dist/r4/index.d.ts +9 -0
  273. package/dist/r4/index.d.ts.map +1 -0
  274. package/dist/r4/index.js +94 -0
  275. package/dist/r4/index.js.map +1 -0
  276. package/dist/r4/model-data.d.ts +17 -0
  277. package/dist/r4/model-data.d.ts.map +1 -0
  278. package/dist/r4/model-data.js +2 -0
  279. package/dist/r4/model-data.js.map +1 -0
  280. package/dist/sites/index.d.ts +31 -0
  281. package/dist/sites/index.d.ts.map +1 -0
  282. package/dist/sites/index.js +205 -0
  283. package/dist/sites/index.js.map +1 -0
  284. package/dist/typed/infer.d.ts +234 -0
  285. package/dist/typed/infer.d.ts.map +1 -0
  286. package/dist/typed/infer.js +85 -0
  287. package/dist/typed/infer.js.map +1 -0
  288. package/dist/typed/perf-fixture.types.d.ts +136 -0
  289. package/dist/typed/perf-fixture.types.d.ts.map +1 -0
  290. package/dist/typed/perf-fixture.types.js +2 -0
  291. package/dist/typed/perf-fixture.types.js.map +1 -0
  292. package/dist/values/collection.d.ts +24 -0
  293. package/dist/values/collection.d.ts.map +1 -0
  294. package/dist/values/collection.js +51 -0
  295. package/dist/values/collection.js.map +1 -0
  296. package/dist/values/datetime.d.ts +54 -0
  297. package/dist/values/datetime.d.ts.map +1 -0
  298. package/dist/values/datetime.js +226 -0
  299. package/dist/values/datetime.js.map +1 -0
  300. package/dist/values/decimal.d.ts +48 -0
  301. package/dist/values/decimal.d.ts.map +1 -0
  302. package/dist/values/decimal.js +188 -0
  303. package/dist/values/decimal.js.map +1 -0
  304. package/dist/values/numeric.d.ts +24 -0
  305. package/dist/values/numeric.d.ts.map +1 -0
  306. package/dist/values/numeric.js +53 -0
  307. package/dist/values/numeric.js.map +1 -0
  308. package/dist/values/quantity.d.ts +49 -0
  309. package/dist/values/quantity.d.ts.map +1 -0
  310. package/dist/values/quantity.js +297 -0
  311. package/dist/values/quantity.js.map +1 -0
  312. package/dist/values/temporal-arithmetic.d.ts +17 -0
  313. package/dist/values/temporal-arithmetic.d.ts.map +1 -0
  314. package/dist/values/temporal-arithmetic.js +183 -0
  315. package/dist/values/temporal-arithmetic.js.map +1 -0
  316. package/dist/values/temporal-compare.d.ts +9 -0
  317. package/dist/values/temporal-compare.d.ts.map +1 -0
  318. package/dist/values/temporal-compare.js +59 -0
  319. package/dist/values/temporal-compare.js.map +1 -0
  320. package/dist/values/type-compat.d.ts +47 -0
  321. package/dist/values/type-compat.d.ts.map +1 -0
  322. package/dist/values/type-compat.js +100 -0
  323. package/dist/values/type-compat.js.map +1 -0
  324. package/dist/values/typed-value.d.ts +48 -0
  325. package/dist/values/typed-value.d.ts.map +1 -0
  326. package/dist/values/typed-value.js +117 -0
  327. package/dist/values/typed-value.js.map +1 -0
  328. package/dist/values/ucum.d.ts +14 -0
  329. package/dist/values/ucum.d.ts.map +1 -0
  330. package/dist/values/ucum.js +146 -0
  331. package/dist/values/ucum.js.map +1 -0
  332. package/package.json +137 -0
  333. package/src/analyzer/analyze-dto.ts +195 -0
  334. package/src/analyzer/analyze.ts +1181 -0
  335. package/src/analyzer/expression-policy.ts +434 -0
  336. package/src/analyzer/index.ts +23 -0
  337. package/src/analyzer/regex-safety.ts +85 -0
  338. package/src/analyzer/signatures.ts +260 -0
  339. package/src/api/bundle.ts +132 -0
  340. package/src/api/cache.ts +40 -0
  341. package/src/api/column-signature.ts +71 -0
  342. package/src/api/compile.ts +308 -0
  343. package/src/api/constraints.ts +104 -0
  344. package/src/api/dto.ts +445 -0
  345. package/src/api/engine.ts +328 -0
  346. package/src/api/evaluate.ts +11 -0
  347. package/src/api/project.ts +255 -0
  348. package/src/api/tagged.ts +35 -0
  349. package/src/cli/dto-check.ts +94 -0
  350. package/src/cli/fhirpath-check.ts +168 -0
  351. package/src/cli/ts-loader.mjs +49 -0
  352. package/src/engine/context.ts +282 -0
  353. package/src/engine/evaluator.ts +246 -0
  354. package/src/engine/navigation.ts +106 -0
  355. package/src/engine/operators/collections.ts +34 -0
  356. package/src/engine/operators/comparison.ts +82 -0
  357. package/src/engine/operators/equality.ts +232 -0
  358. package/src/engine/operators/index.ts +65 -0
  359. package/src/engine/operators/logic.ts +53 -0
  360. package/src/engine/operators/math.ts +225 -0
  361. package/src/engine/operators/strings.ts +25 -0
  362. package/src/engine/operators/types.ts +16 -0
  363. package/src/engine/type-matching.ts +148 -0
  364. package/src/errors.ts +33 -0
  365. package/src/eslint/index.ts +388 -0
  366. package/src/fhir/html-checks.ts +266 -0
  367. package/src/fhir/model-navigation.ts +148 -0
  368. package/src/functions/aggregate.ts +136 -0
  369. package/src/functions/boundary.ts +209 -0
  370. package/src/functions/combining.ts +15 -0
  371. package/src/functions/control.ts +25 -0
  372. package/src/functions/conversion.ts +349 -0
  373. package/src/functions/date-components.ts +88 -0
  374. package/src/functions/existence.ts +107 -0
  375. package/src/functions/fhir.ts +247 -0
  376. package/src/functions/filtering.ts +120 -0
  377. package/src/functions/install.ts +19 -0
  378. package/src/functions/iteration.ts +21 -0
  379. package/src/functions/math.ts +167 -0
  380. package/src/functions/reflection.ts +24 -0
  381. package/src/functions/registry.ts +72 -0
  382. package/src/functions/sort.ts +68 -0
  383. package/src/functions/string.ts +413 -0
  384. package/src/functions/subsetting.ts +89 -0
  385. package/src/functions/tree.ts +112 -0
  386. package/src/functions/type-specifier.ts +29 -0
  387. package/src/functions/utility.ts +82 -0
  388. package/src/functions/variables.ts +36 -0
  389. package/src/index.ts +30 -0
  390. package/src/lexer/lexer.ts +341 -0
  391. package/src/lexer/tokens.ts +69 -0
  392. package/src/model/provider.ts +36 -0
  393. package/src/parser/ast.ts +164 -0
  394. package/src/parser/parser.ts +321 -0
  395. package/src/parser/precedence.ts +52 -0
  396. package/src/parser/printer.ts +114 -0
  397. package/src/r4/generated/resources-data.ts +28631 -0
  398. package/src/r4/generated/type-maps.ts +22145 -0
  399. package/src/r4/generated/types-data.ts +2208 -0
  400. package/src/r4/index.ts +107 -0
  401. package/src/r4/model-data.ts +17 -0
  402. package/src/sites/index.ts +285 -0
  403. package/src/typed/infer.ts +433 -0
  404. package/src/typed/perf-fixture.types.ts +143 -0
  405. package/src/values/collection.ts +57 -0
  406. package/src/values/datetime.ts +285 -0
  407. package/src/values/decimal.ts +213 -0
  408. package/src/values/numeric.ts +63 -0
  409. package/src/values/quantity.ts +358 -0
  410. package/src/values/temporal-arithmetic.ts +231 -0
  411. package/src/values/temporal-compare.ts +65 -0
  412. package/src/values/type-compat.ts +133 -0
  413. package/src/values/typed-value.ts +151 -0
  414. package/src/values/ucum.ts +181 -0
@@ -0,0 +1,234 @@
1
+ import type { R4Bases, R4Elements, R4Resources, R4TypeOf } from '../r4/generated/type-maps.ts';
2
+ /**
3
+ * Type-level inference for common literal expressions: paths, indexes, choice
4
+ * stems, selected collection functions, `select`, `ofType`, `as`, fixed-result
5
+ * functions, unions, groups, and variable roots. Other expressions return
6
+ * `unknown[]`. The runtime and analyzer support the full language.
7
+ */
8
+ /**
9
+ * A type name the bound model knows — a resource or a datatype. What a DTO's
10
+ * `fhirType` must be, and what `fhirpath`/`compile` accept as the type an
11
+ * expression runs against. Lives here, with the rest of the inference vocabulary,
12
+ * so every layer above spells it one way.
13
+ */
14
+ export type FhirTypeName = keyof R4TypeOf & string;
15
+ /** Element lookup by name, walking base types. */
16
+ type ElementInfo<T extends string, E extends string> = T extends keyof R4Elements ? E extends keyof R4Elements[T] ? R4Elements[T][E] : T extends keyof R4Bases ? R4Bases[T] extends string ? ElementInfo<R4Bases[T], E> : never : never : never;
17
+ /**
18
+ * Characters that never appear in an element or variable name: their presence
19
+ * in a segment means an operator or literal got glued on (`name and x`,
20
+ * `gender=gender`), and the runtime evaluates something entirely different
21
+ * from a navigation. Such segments must degrade to 'opaque' — the broad state
22
+ * would let a later fixed-return call claim a concrete type for what is
23
+ * really a comparison.
24
+ */
25
+ type GluedName<E extends string> = E extends `${string} ${string}` | `${string}'${string}` | `${string}"${string}` | `${string}=${string}` | `${string}!${string}` | `${string}<${string}` | `${string}>${string}` | `${string}+${string}` | `${string}-${string}` | `${string}*${string}` | `${string}/${string}` | `${string}&${string}` | `${string}~${string}` | `${string},${string}` | `${string}|${string}` | `${string}%${string}` | `${string}$${string}` | `${string}@${string}` | `${string}(${string}` | `${string})${string}` | `${string}[${string}` | `${string}]${string}` | `${string}{${string}` | `${string}}${string}` | `${string}\\${string}` | `${string}\`${string}` ? true : false;
26
+ /**
27
+ * Navigates one element. A missing normal name widens the state because the
28
+ * runtime returns empty and a later fixed-result function still has a known
29
+ * type. A segment containing expression syntax becomes `opaque` instead.
30
+ */
31
+ type Navigate<S extends string, E extends string> = string extends S ? MissedElement<E, S> : ElementInfo<S, E> extends {
32
+ t: infer N extends string;
33
+ } ? string extends N ? MissedElement<E, string> : N : 'opaque';
34
+ /**
35
+ * An element lookup that found nothing: glued segments are misparses and go
36
+ * 'opaque'; a sane-looking name widens to (or stays) the broad state. Only
37
+ * misses pay the GluedName scan — real elements are never glued.
38
+ */
39
+ type MissedElement<E extends string, Broad extends string> = GluedName<E> extends true ? 'opaque' : Broad;
40
+ /**
41
+ * Checks that a matched call ends at its final `)`. Quotes are removed before
42
+ * balancing parentheses. Backslashes and backticks fall outside this subset.
43
+ */
44
+ type CleanArg<A extends string> = A extends `${string}\\${string}` | `${string}\`${string}` ? false : Balanced<StripQuoted<A>>;
45
+ /** Removes `'…'` spans so parens inside string literals don't disturb Balanced. */
46
+ type StripQuoted<A extends string> = A extends `${infer L}'${string}'${infer R}` ? `${L}${StripQuoted<R>}` : A;
47
+ /** Every `(` opens before its `)` closes; one nesting level per pair. */
48
+ type Balanced<A extends string> = A extends `${infer L}(${infer M})${infer R}` ? L extends `${string})${string}` ? false : M extends `${string}(${string}` ? false : Balanced<R> : A extends `${string})${string}` ? false : true;
49
+ /** Push one stack entry per `(` of A (quoted spans already stripped). */
50
+ type PushOpens<A extends string, Acc extends unknown[]> = A extends `${string}(${infer R}` ? PushOpens<R, [...Acc, 0]> : Acc;
51
+ /** Checks full parenthesis balance after quoted spans have been removed. */
52
+ type BalancedDeep<A extends string, Open extends unknown[] = []> = A extends `${infer Head})${infer Rest}` ? PushOpens<Head, Open> extends [unknown, ...infer Remaining] ? BalancedDeep<Rest, Remaining> : false : PushOpens<A, Open> extends [] ? true : false;
53
+ /**
54
+ * Whether a fragment is a complete sub-expression, so a `|` (or a group's `)`)
55
+ * right after it is really at the top level: quotes pair up, and what remains
56
+ * after stripping them balances with nothing left open. Backslashes and
57
+ * backticks are declined outright, like CleanArg.
58
+ */
59
+ type CompleteFragment<A extends string> = A extends `${string}\\${string}` | `${string}\`${string}` ? false : StripQuoted<A> extends infer Q extends string ? Q extends `${string}'${string}` ? false : BalancedDeep<Q> : false;
60
+ /** Strip the leading/trailing spaces a union split leaves around its terms. */
61
+ type Trim<S extends string> = S extends ` ${infer R}` ? Trim<R> : S extends `${infer L} ` ? Trim<L> : S;
62
+ /**
63
+ * Functions with input-independent result types. A test compares this table
64
+ * with analyzer signatures. Functions whose result depends on input stay out.
65
+ */
66
+ export declare const FIXED_RETURNS: {
67
+ readonly exists: "boolean";
68
+ readonly empty: "boolean";
69
+ readonly not: "boolean";
70
+ readonly hasValue: "boolean";
71
+ readonly count: "integer";
72
+ readonly length: "integer";
73
+ readonly toBoolean: "boolean";
74
+ readonly convertsToBoolean: "boolean";
75
+ readonly convertsToInteger: "boolean";
76
+ readonly convertsToDecimal: "boolean";
77
+ readonly convertsToString: "boolean";
78
+ readonly convertsToDate: "boolean";
79
+ readonly convertsToDateTime: "boolean";
80
+ readonly convertsToTime: "boolean";
81
+ readonly convertsToQuantity: "boolean";
82
+ readonly toInteger: "integer";
83
+ readonly toDecimal: "decimal";
84
+ readonly toString: "string";
85
+ readonly toDate: "date";
86
+ readonly toDateTime: "dateTime";
87
+ readonly toTime: "time";
88
+ readonly toQuantity: "Quantity";
89
+ readonly toChars: "string";
90
+ readonly join: "string";
91
+ readonly trim: "string";
92
+ readonly upper: "string";
93
+ readonly lower: "string";
94
+ readonly replace: "string";
95
+ readonly replaceMatches: "string";
96
+ readonly substring: "string";
97
+ readonly encode: "string";
98
+ readonly decode: "string";
99
+ readonly escape: "string";
100
+ readonly unescape: "string";
101
+ readonly split: "string";
102
+ readonly matches: "boolean";
103
+ readonly matchesFull: "boolean";
104
+ readonly startsWith: "boolean";
105
+ readonly endsWith: "boolean";
106
+ readonly contains: "boolean";
107
+ readonly subsetOf: "boolean";
108
+ readonly supersetOf: "boolean";
109
+ readonly isDistinct: "boolean";
110
+ readonly allTrue: "boolean";
111
+ readonly anyTrue: "boolean";
112
+ readonly allFalse: "boolean";
113
+ readonly anyFalse: "boolean";
114
+ readonly all: "boolean";
115
+ readonly indexOf: "integer";
116
+ readonly lastIndexOf: "integer";
117
+ readonly ceiling: "integer";
118
+ readonly floor: "integer";
119
+ readonly truncate: "integer";
120
+ readonly round: "decimal";
121
+ readonly sqrt: "decimal";
122
+ readonly exp: "decimal";
123
+ readonly ln: "decimal";
124
+ readonly log: "decimal";
125
+ };
126
+ type FixedReturns = typeof FIXED_RETURNS;
127
+ /**
128
+ * Functions that yield a subset or reordering of their input, so the input's
129
+ * type carries through. Cross-checked against the analyzer the same way as
130
+ * FIXED_RETURNS (their signatures preserve the input's types). `abs` is
131
+ * excluded deliberately: it preserves the numeric kind at runtime, but the
132
+ * analyzer declares its result unknown, and the table must not outrun it.
133
+ */
134
+ export declare const IDENTITY_RETURNS: readonly ["where", "first", "last", "single", "distinct", "tail", "skip", "take", "exclude", "intersect", "trace"];
135
+ type IdentityFn = (typeof IDENTITY_RETURNS)[number];
136
+ /** One call segment, dispatched on the function name. */
137
+ type Call<S extends string, Fn extends string, Arg extends string> = Fn extends IdentityFn ? S : Fn extends 'ofType' | 'as' ? Arg extends FhirTypeName ? Arg : 'opaque' : Fn extends keyof FixedReturns ? FixedReturns[Fn] : 'opaque';
138
+ /** One `.`-separated segment: a call the subset knows, an indexer, or an element. */
139
+ type Step<S extends string, Seg extends string> = [S] extends ['opaque'] ? 'opaque' : Seg extends `${infer Fn}(${infer Arg})` ? Fn extends 'select' ? ParseExpr<Arg, S> : CleanArg<Arg> extends true ? Call<S, Fn, Arg> : 'opaque' : Seg extends `${infer N}[${infer I}]` ? I extends `${string}]${string}` | `${string}[${string}` ? 'opaque' : Navigate<S, N> : Navigate<S, Seg>;
140
+ /** Walk the remaining `.`-separated segments. */
141
+ type ParseSegments<Expr extends string, S extends string> = Expr extends '' ? S : Expr extends `${infer Head}.${infer Rest}` ? Head extends `${string}(` | `${string}(${string}` ? StepAcrossParen<Expr, S> : ParseSegments<Rest, Step<S, Head>> : Step<S, Expr>;
142
+ /**
143
+ * A segment whose parentheses contain dots (e.g. `select(name.given)`) runs
144
+ * to the `)` that completes its argument; the `.` after that starts the next
145
+ * segment. Scanned `).` by `).`: a candidate close inside a string literal,
146
+ * or with parens still open, is not the close — CompleteFragment decides.
147
+ * With no valid `).` split, the whole rest is one segment ending at its
148
+ * final `)`.
149
+ */
150
+ type StepAcrossParen<Expr extends string, S extends string> = ScanSegmentEnd<Expr, '', S>;
151
+ type ScanSegmentEnd<Expr extends string, Acc extends string, S extends string> = Expr extends `${infer Head}).${infer Rest}` ? SegmentComplete<`${Acc}${Head}`> extends true ? ParseSegments<Rest, Step<S, `${Acc}${Head})`>> : ScanSegmentEnd<Rest, `${Acc}${Head}).`, S> : WholeParenSegment<`${Acc}${Expr}`, S>;
152
+ /** Whether `Body)` is one complete call segment: its argument closes exactly there. */
153
+ type SegmentComplete<Body extends string> = `${Body})` extends `${infer _Fn}(${infer Arg})` ? CompleteFragment<Arg> : false;
154
+ /** The rest of the expression is a single paren segment ending at its final `)`. */
155
+ type WholeParenSegment<Expr extends string, S extends string> = Expr extends `${infer Head})${''}` ? Step<S, `${Head})`> : 'opaque';
156
+ /**
157
+ * One expression in a context state `S`: a `|`-union of terms, or a single
158
+ * term. Plain dotted paths take two cheap checks: one skips the union scanner,
159
+ * and the next skips trimming and group or `%var` handling.
160
+ */
161
+ type ParseExpr<Expr extends string, S extends string> = Expr extends `${string}|${string}` | `(${string}` | `%${string}` ? ParseUnion<Expr, S> : Expr extends `${infer Root}.${infer Rest}` ? Root extends keyof R4Resources & string ? ParseSegments<Rest, Root> : ParseSegments<Expr, S> : Expr extends keyof R4Resources & string ? Expr : ParseSegments<Expr, S>;
162
+ /**
163
+ * Split off the leftmost top-level `|`. A candidate fragment whose quotes or
164
+ * parens are cut mid-way (the `|` sat inside a literal or a group) is not a
165
+ * split point: the fragment absorbs the `|` and the scan continues. With no
166
+ * top-level `|` at all, the whole expression is one term — its own parse is
167
+ * the validation, so this branch needs no separate completeness check.
168
+ */
169
+ type SplitUnion<Expr extends string, Acc extends string = ''> = Expr extends `${infer L}|${infer R}` ? CompleteFragment<`${Acc}${L}`> extends true ? {
170
+ term: `${Acc}${L}`;
171
+ rest: R;
172
+ } : SplitUnion<R, `${Acc}${L}|`> : {
173
+ whole: `${Acc}${Expr}`;
174
+ };
175
+ /** Fold the split terms into one union state. */
176
+ type ParseUnion<Expr extends string, S extends string> = SplitUnion<Expr> extends {
177
+ term: infer T extends string;
178
+ rest: infer R extends string;
179
+ } ? UnionStates<ParseTerm<Trim<T>, S>, ParseUnion<R, S>> : SplitUnion<Expr> extends {
180
+ whole: infer W extends string;
181
+ } ? ParseTerm<Trim<W>, S> : 'opaque';
182
+ /**
183
+ * The union of two term states. If EITHER side failed to parse, the whole
184
+ * union is 'opaque' — a known name must never absorb a failed parse. A broad
185
+ * member needs no special case: `string` swallows the other names, and
186
+ * unknowable-joined-with-anything is unknowable.
187
+ */
188
+ type UnionStates<A extends string, B extends string> = [A] extends ['opaque'] ? 'opaque' : [B] extends ['opaque'] ? 'opaque' : A | B;
189
+ /**
190
+ * One union term (or a whole single-term expression): a parenthesized group,
191
+ * a `%var` root, a resource-rooted path, or a path relative to the context
192
+ * state `S`. The top level passes S = 'opaque', so relative terms degrade
193
+ * there; select() passes its input state, so its sub-paths resolve.
194
+ */
195
+ type ParseTerm<Term extends string, S extends string> = Term extends `(${infer Body}` ? ExtractGroup<Body, '', S> : Term extends `%${infer Var}` ? ParseVarTerm<Var> : Term extends `${infer Root}.${infer Rest}` ? Root extends keyof R4Resources & string ? ParseSegments<Rest, Root> : ParseSegments<Term, S> : Term extends keyof R4Resources & string ? Term : ParseSegments<Term, S>;
196
+ /**
197
+ * A `%var` root enters the broad state: the variable's value is unknowable
198
+ * here, and broad is exactly "unknowable" — plain navigation stays
199
+ * `unknown[]`, while a fixed-return call (`%rowIndex.toString()`) keeps its
200
+ * input-independent type. The name must look like a name: a glued operator
201
+ * (`%a = b`) would make the runtime evaluate a comparison, not a variable.
202
+ */
203
+ type ParseVarTerm<Var extends string> = Var extends `${infer Name}.${infer Rest}` ? GluedName<Name> extends true ? 'opaque' : ParseSegments<Rest, string> : GluedName<Var> extends true ? 'opaque' : string;
204
+ /**
205
+ * Find the `)` closing a group's opening paren: scan `)` by `)`, and the
206
+ * first one whose interior is a complete fragment closes the group. What
207
+ * follows must be nothing or a `.`-chain — anything else (`(A | B) = (C)`)
208
+ * is a glued operator.
209
+ */
210
+ type ExtractGroup<Body extends string, Acc extends string, S extends string> = Body extends `${infer L})${infer R}` ? CompleteFragment<`${Acc}${L}`> extends true ? GroupTail<ParseExpr<`${Acc}${L}`, S>, R> : ExtractGroup<R, `${Acc}${L})`, S> : 'opaque';
211
+ /** Continue after a group: `(…)` ends the term, `(…).rest` walks on from the group's state. */
212
+ type GroupTail<G extends string, Tail extends string> = Tail extends '' ? G : Tail extends `.${infer Rest}` ? ParseSegments<Rest, G> : 'opaque';
213
+ /** The unwrapped result element type for a state; `[…]` keeps unions whole. */
214
+ type ResultOf<S extends string> = [S] extends [keyof R4TypeOf] ? R4TypeOf[S][] : unknown[];
215
+ /**
216
+ * The inferred result of evaluating `Expr` against its root resource.
217
+ * `string` (a non-literal expression) and anything outside the subset give
218
+ * `unknown[]`. The context is 'opaque': terms must be resource-rooted,
219
+ * `%var`-rooted, or parenthesized groups of those — a relative term
220
+ * (`id | …`) has no root to resolve against here and degrades.
221
+ */
222
+ export type FhirpathResult<Expr extends string> = FhirpathResultIn<Expr, 'opaque'>;
223
+ /**
224
+ * The inferred result of evaluating `Expr` with `Input` as the context type —
225
+ * what a DTO's `fhirType` gives its columns, so their paths can stay relative
226
+ * (`clinicalStatus.coding.first().code`). A resource-rooted term still resolves
227
+ * against its own root, and a type name outside the model degrades like any
228
+ * other out-of-subset expression.
229
+ */
230
+ export type FhirpathResultIn<Expr extends string, Input extends string> = string extends Expr ? unknown[] : ResultOf<ParseExpr<Expr, Input>>;
231
+ /** The expected input resource for `Expr` (`Patient.name` wants a Patient). */
232
+ export type FhirpathInput<Expr extends string> = string extends Expr ? unknown : Expr extends `${infer Root}.${string}` ? Root extends keyof R4Resources ? R4Resources[Root] : unknown : Expr extends keyof R4Resources ? R4Resources[Expr] : unknown;
233
+ export {};
234
+ //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MAAM,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,SAAS,EAAE,GACnE,CAAC,GACD,IAAI,SAAS,IAAI,MAAM,IAAI,EAAE,GAC3B,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,GACtB,QAAQ,CAAA;AAEd,+EAA+E;AAC/E,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAA;AAE1F;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,MAAM,IAAI,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAElF;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,IAAI,MAAM,SAAS,IAAI,GACzF,OAAO,EAAE,GACT,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AAEpC,+EAA+E;AAC/E,MAAM,MAAM,aAAa,CAAC,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS,IAAI,GAChE,OAAO,GACP,IAAI,SAAS,GAAG,MAAM,IAAI,IAAI,MAAM,EAAE,GACpC,IAAI,SAAS,MAAM,WAAW,GAC5B,WAAW,CAAC,IAAI,CAAC,GACjB,OAAO,GACT,IAAI,SAAS,MAAM,WAAW,GAC5B,WAAW,CAAC,IAAI,CAAC,GACjB,OAAO,CAAA"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Functions with input-independent result types. A test compares this table
3
+ * with analyzer signatures. Functions whose result depends on input stay out.
4
+ */
5
+ export const FIXED_RETURNS = {
6
+ exists: 'boolean',
7
+ empty: 'boolean',
8
+ not: 'boolean',
9
+ hasValue: 'boolean',
10
+ count: 'integer',
11
+ length: 'integer',
12
+ toBoolean: 'boolean',
13
+ convertsToBoolean: 'boolean',
14
+ convertsToInteger: 'boolean',
15
+ convertsToDecimal: 'boolean',
16
+ convertsToString: 'boolean',
17
+ convertsToDate: 'boolean',
18
+ convertsToDateTime: 'boolean',
19
+ convertsToTime: 'boolean',
20
+ convertsToQuantity: 'boolean',
21
+ toInteger: 'integer',
22
+ toDecimal: 'decimal',
23
+ toString: 'string',
24
+ toDate: 'date',
25
+ toDateTime: 'dateTime',
26
+ toTime: 'time',
27
+ toQuantity: 'Quantity',
28
+ toChars: 'string',
29
+ join: 'string',
30
+ trim: 'string',
31
+ upper: 'string',
32
+ lower: 'string',
33
+ replace: 'string',
34
+ replaceMatches: 'string',
35
+ substring: 'string',
36
+ encode: 'string',
37
+ decode: 'string',
38
+ escape: 'string',
39
+ unescape: 'string',
40
+ split: 'string',
41
+ matches: 'boolean',
42
+ matchesFull: 'boolean',
43
+ startsWith: 'boolean',
44
+ endsWith: 'boolean',
45
+ contains: 'boolean',
46
+ subsetOf: 'boolean',
47
+ supersetOf: 'boolean',
48
+ isDistinct: 'boolean',
49
+ allTrue: 'boolean',
50
+ anyTrue: 'boolean',
51
+ allFalse: 'boolean',
52
+ anyFalse: 'boolean',
53
+ all: 'boolean',
54
+ indexOf: 'integer',
55
+ lastIndexOf: 'integer',
56
+ ceiling: 'integer',
57
+ floor: 'integer',
58
+ truncate: 'integer',
59
+ round: 'decimal',
60
+ sqrt: 'decimal',
61
+ exp: 'decimal',
62
+ ln: 'decimal',
63
+ log: 'decimal',
64
+ };
65
+ /**
66
+ * Functions that yield a subset or reordering of their input, so the input's
67
+ * type carries through. Cross-checked against the analyzer the same way as
68
+ * FIXED_RETURNS (their signatures preserve the input's types). `abs` is
69
+ * excluded deliberately: it preserves the numeric kind at runtime, but the
70
+ * analyzer declares its result unknown, and the table must not outrun it.
71
+ */
72
+ export const IDENTITY_RETURNS = [
73
+ 'where',
74
+ 'first',
75
+ 'last',
76
+ 'single',
77
+ 'distinct',
78
+ 'tail',
79
+ 'skip',
80
+ 'take',
81
+ 'exclude',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,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,SAAS;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;CACiC,CAAA;AAIjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,WAAW;IACX,OAAO;CACC,CAAA"}
@@ -0,0 +1,136 @@
1
+ import type { FhirpathResult } from './infer.ts';
2
+ export type T001 = FhirpathResult<'Patient.name.given'>;
3
+ export type T002 = FhirpathResult<'Patient.name.family'>;
4
+ export type T003 = FhirpathResult<'Patient.birthDate'>;
5
+ export type T004 = FhirpathResult<'Patient.active'>;
6
+ export type T005 = FhirpathResult<'Patient.telecom.value'>;
7
+ export type T006 = FhirpathResult<'Patient.address.city'>;
8
+ export type T007 = FhirpathResult<'Patient.identifier.value'>;
9
+ export type T008 = FhirpathResult<'Patient.contact.name.family'>;
10
+ export type T009 = FhirpathResult<'Patient.name.first().given'>;
11
+ export type T010 = FhirpathResult<'Patient.name.exists()'>;
12
+ export type T011 = FhirpathResult<'Patient.name.count()'>;
13
+ export type T012 = FhirpathResult<"Patient.name.where(use = 'official').family">;
14
+ export type T013 = FhirpathResult<'Patient.name.select(given)'>;
15
+ export type T014 = FhirpathResult<'Patient.deceased'>;
16
+ export type T015 = FhirpathResult<'Patient.gender'>;
17
+ export type T016 = FhirpathResult<'Patient.maritalStatus.coding.code'>;
18
+ export type T017 = FhirpathResult<'Patient.communication.language.text'>;
19
+ export type T018 = FhirpathResult<'Patient.name[0].family'>;
20
+ export type T019 = FhirpathResult<'Patient.managingOrganization.reference'>;
21
+ export type T020 = FhirpathResult<'Patient.link.other.reference'>;
22
+ export type T021 = FhirpathResult<'Observation.status'>;
23
+ export type T022 = FhirpathResult<'Observation.code.coding.system'>;
24
+ export type T023 = FhirpathResult<'Observation.value.ofType(Quantity).unit'>;
25
+ export type T024 = FhirpathResult<'Observation.issued'>;
26
+ export type T025 = FhirpathResult<'Observation.category.coding.code'>;
27
+ export type T026 = FhirpathResult<'Observation.component.code.text'>;
28
+ export type T027 = FhirpathResult<'Observation.subject.reference'>;
29
+ export type T028 = FhirpathResult<'Observation.referenceRange.low.value'>;
30
+ export type T029 = FhirpathResult<'Observation.interpretation.text'>;
31
+ export type T030 = FhirpathResult<'Observation.effective'>;
32
+ export type T031 = FhirpathResult<'Bundle.entry.fullUrl'>;
33
+ export type T032 = FhirpathResult<'Bundle.type'>;
34
+ export type T033 = FhirpathResult<'Bundle.total'>;
35
+ export type T034 = FhirpathResult<'Bundle.entry.request.method'>;
36
+ export type T035 = FhirpathResult<'Bundle.link.url'>;
37
+ export type T036 = FhirpathResult<'Encounter.status'>;
38
+ export type T037 = FhirpathResult<'Encounter.class.code'>;
39
+ export type T038 = FhirpathResult<'Encounter.period.start'>;
40
+ export type T039 = FhirpathResult<'Encounter.participant.individual.reference'>;
41
+ export type T040 = FhirpathResult<'Encounter.reasonCode.text'>;
42
+ export type T041 = FhirpathResult<'Encounter.location.location.display'>;
43
+ export type T042 = FhirpathResult<'MedicationRequest.status'>;
44
+ export type T043 = FhirpathResult<'MedicationRequest.intent'>;
45
+ export type T044 = FhirpathResult<'MedicationRequest.medication'>;
46
+ export type T045 = FhirpathResult<'MedicationRequest.dosageInstruction.text'>;
47
+ export type T046 = FhirpathResult<'MedicationRequest.dispenseRequest.quantity.value'>;
48
+ export type T047 = FhirpathResult<'MedicationRequest.authoredOn'>;
49
+ export type T048 = FhirpathResult<'MedicationRequest.requester.display'>;
50
+ export type T049 = FhirpathResult<'Condition.clinicalStatus.coding.code'>;
51
+ export type T050 = FhirpathResult<'Condition.severity.text'>;
52
+ export type T051 = FhirpathResult<'Condition.onset'>;
53
+ export type T052 = FhirpathResult<'Condition.recordedDate'>;
54
+ export type T053 = FhirpathResult<'Condition.bodySite.coding.display'>;
55
+ export type T054 = FhirpathResult<'Condition.stage.summary.text'>;
56
+ export type T055 = FhirpathResult<'DiagnosticReport.status'>;
57
+ export type T056 = FhirpathResult<'DiagnosticReport.conclusion'>;
58
+ export type T057 = FhirpathResult<'DiagnosticReport.result.reference'>;
59
+ export type T058 = FhirpathResult<'DiagnosticReport.issued'>;
60
+ export type T059 = FhirpathResult<'DiagnosticReport.category.text'>;
61
+ export type T060 = FhirpathResult<'AllergyIntolerance.clinicalStatus.coding.code'>;
62
+ export type T061 = FhirpathResult<'AllergyIntolerance.criticality'>;
63
+ export type T062 = FhirpathResult<'AllergyIntolerance.reaction.severity'>;
64
+ export type T063 = FhirpathResult<'AllergyIntolerance.reaction.manifestation.text'>;
65
+ export type T064 = FhirpathResult<'AllergyIntolerance.onset'>;
66
+ export type T065 = FhirpathResult<'Immunization.status'>;
67
+ export type T066 = FhirpathResult<'Immunization.vaccineCode.text'>;
68
+ export type T067 = FhirpathResult<'Immunization.occurrence'>;
69
+ export type T068 = FhirpathResult<'Immunization.lotNumber'>;
70
+ export type T069 = FhirpathResult<'Immunization.doseQuantity.value'>;
71
+ export type T070 = FhirpathResult<'Appointment.status'>;
72
+ export type T071 = FhirpathResult<'Appointment.start'>;
73
+ export type T072 = FhirpathResult<'Appointment.end'>;
74
+ export type T073 = FhirpathResult<'Appointment.participant.actor.display'>;
75
+ export type T074 = FhirpathResult<'Appointment.description'>;
76
+ export type T075 = FhirpathResult<'CarePlan.status'>;
77
+ export type T076 = FhirpathResult<'CarePlan.intent'>;
78
+ export type T077 = FhirpathResult<'CarePlan.title'>;
79
+ export type T078 = FhirpathResult<'CarePlan.activity.detail.status'>;
80
+ export type T079 = FhirpathResult<'CarePlan.period.end'>;
81
+ export type T080 = FhirpathResult<'Procedure.status'>;
82
+ export type T081 = FhirpathResult<'Procedure.code.text'>;
83
+ export type T082 = FhirpathResult<'Procedure.performed'>;
84
+ export type T083 = FhirpathResult<'Procedure.outcome.text'>;
85
+ export type T084 = FhirpathResult<'Procedure.performer.actor.display'>;
86
+ export type T085 = FhirpathResult<'Questionnaire.status'>;
87
+ export type T086 = FhirpathResult<'Questionnaire.title'>;
88
+ export type T087 = FhirpathResult<'Questionnaire.item.text'>;
89
+ export type T088 = FhirpathResult<'Questionnaire.item.item.linkId'>;
90
+ export type T089 = FhirpathResult<'Questionnaire.item.type'>;
91
+ export type T090 = FhirpathResult<'QuestionnaireResponse.status'>;
92
+ export type T091 = FhirpathResult<'QuestionnaireResponse.item.answer.value'>;
93
+ export type T092 = FhirpathResult<'QuestionnaireResponse.item.linkId'>;
94
+ export type T093 = FhirpathResult<'QuestionnaireResponse.authored'>;
95
+ export type T094 = FhirpathResult<'ValueSet.status'>;
96
+ export type T095 = FhirpathResult<'ValueSet.url'>;
97
+ export type T096 = FhirpathResult<'ValueSet.expansion.contains.code'>;
98
+ export type T097 = FhirpathResult<'ValueSet.compose.include.system'>;
99
+ export type T098 = FhirpathResult<"Observation.value.ofType(Quantity).toQuantity('kg').value">;
100
+ export type T099 = FhirpathResult<"Observation.value.ofType(Quantity).toQuantity('kg.m/s2').value">;
101
+ export type T100 = FhirpathResult<'Patient.birthDate.toDate()'>;
102
+ export type T101 = FhirpathResult<'Patient.birthDate.convertsToDateTime()'>;
103
+ export type T102 = FhirpathResult<"Patient.name.given.join(', ')">;
104
+ export type T103 = FhirpathResult<'Patient.name.family.first().toChars()'>;
105
+ export type T104 = FhirpathResult<'Patient.name.given.first().toString()'>;
106
+ export type T105 = FhirpathResult<"Patient.name.where(given.first() = 'Peter').family">;
107
+ export type T106 = FhirpathResult<'Patient.name.where(use.exists() and given.exists()).given'>;
108
+ export type T107 = FhirpathResult<"Patient.name.exists(use = 'official')">;
109
+ export type T108 = FhirpathResult<'Patient.name.select(given.first()).count()'>;
110
+ export type T109 = FhirpathResult<"MedicationRequest.dosageInstruction.text.join('; ')">;
111
+ export type T110 = FhirpathResult<'Observation.component.value.ofType(Quantity).value.first().toString()'>;
112
+ export type T111 = FhirpathResult<'Patient.name.family.first().trim()'>;
113
+ export type T112 = FhirpathResult<'Patient.name.given.first().substring(0, 1)'>;
114
+ export type T113 = FhirpathResult<"Patient.name.family.first().replace('mers', 'm')">;
115
+ export type T114 = FhirpathResult<"Patient.name.family.first().matches('^Ch')">;
116
+ export type T115 = FhirpathResult<"Patient.name.given.first().startsWith('Pe')">;
117
+ export type T116 = FhirpathResult<"Patient.name.given.first().indexOf('e')">;
118
+ export type T117 = FhirpathResult<'Patient.name.count().toDecimal().round()'>;
119
+ export type T118 = FhirpathResult<'Patient.name.count().sqrt()'>;
120
+ export type T119 = FhirpathResult<'Patient.name.given.distinct()'>;
121
+ export type T120 = FhirpathResult<'Patient.name.given.skip(1).take(2)'>;
122
+ export type T121 = FhirpathResult<"Patient.name.given.first().split('e')">;
123
+ export type T122 = FhirpathResult<'Patient.name.all(use.exists())'>;
124
+ export type T123 = FhirpathResult<'Patient.name.given | Patient.name.family'>;
125
+ export type T124 = FhirpathResult<'(Patient.name.given | Patient.name.family).first()'>;
126
+ export type T125 = FhirpathResult<'(DiagnosticReport.effective.ofType(dateTime) | DiagnosticReport.issued).first().toString()'>;
127
+ export type T126 = FhirpathResult<'((Patient.name.given | Patient.name.family) | Patient.id).first()'>;
128
+ export type T127 = FhirpathResult<'Patient.name.select((given | family).first())'>;
129
+ export type T128 = FhirpathResult<'MedicationRequest.dosageInstruction.first().route.select(text | coding.display.first()).first()'>;
130
+ export type T129 = FhirpathResult<'%rowIndex.toString()'>;
131
+ export type T130 = FhirpathResult<'(%report.effective.ofType(dateTime) | %report.issued | ServiceRequest.authoredOn | ServiceRequest.occurrence.ofType(dateTime)).first().toString()'>;
132
+ export type T131 = FhirpathResult<'(id | %rowIndex.toString()).first()'>;
133
+ export type T132 = FhirpathResult<"Patient.name.where(family = 'a|b').given">;
134
+ export type T133 = FhirpathResult<'Patient.name.where(a.exists()).given'>;
135
+ export type T134 = FhirpathResult<'Patient.name.select(given.first()).count()'>;
136
+ //# sourceMappingURL=perf-fixture.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perf-fixture.types.d.ts","sourceRoot":"","sources":["../../src/typed/perf-fixture.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AACvD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAA;AACxD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAA;AACtD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;AACnD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAA;AAC1D,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAA;AACzD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,0BAA0B,CAAC,CAAA;AAC7D,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,6BAA6B,CAAC,CAAA;AAChE,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,4BAA4B,CAAC,CAAA;AAC/D,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAA;AAC1D,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAA;AACzD,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,6CAA6C,CAAC,CAAA;AAChF,MAAM,MAAM,IAAI,GAAG,c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ACrK,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,qCAAqC,CAAC,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,0CAA0C,CAAC,CAAA;AAC7E,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,sCAAsC,CAAC,CAAA;AACzE,MAAM,MAAM,IAAI,GAAG,cAAc,CAAC,4CAA4C,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=perf-fixture.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perf-fixture.types.js","sourceRoot":"","sources":["../../src/typed/perf-fixture.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { type TypedValue } from './typed-value.ts';
2
+ /**
3
+ * Singleton evaluation of collections, spec §4.5:
4
+ * 1. one item of the expected type → the item;
5
+ * 2. one item, expected type Boolean → `true`;
6
+ * 3. empty → empty (undefined here);
7
+ * 4. more than one item → error.
8
+ */
9
+ export declare function singleton(collection: TypedValue[], expectedType?: string): TypedValue | undefined;
10
+ /**
11
+ * Singleton evaluation coerced to a boolean, applying the implicit-true rule.
12
+ * Empty returns undefined, which the three-valued logic operators need as an
13
+ * answer distinct from false. Do not turn it into `false` here; see
14
+ * `criteriaBoolean`.
15
+ */
16
+ export declare function booleanSingleton(collection: TypedValue[]): boolean | undefined;
17
+ /**
18
+ * Returns one criteria Boolean. FHIRPath §4.5 supplies singleton evaluation;
19
+ * FHIR constraints add that an empty result does not satisfy the criteria, so
20
+ * empty becomes `false`. Other Boolean functions keep their own item rules.
21
+ */
22
+ export declare function criteriaBoolean(collection: TypedValue[]): boolean;
23
+ export declare function wrapBoolean(value: boolean | undefined): TypedValue[];
24
+ //# sourceMappingURL=collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/values/collection.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,UAAU,EAAiB,MAAM,kBAAkB,CAAA;AAEjF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAejG;AASD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,GAAG,SAAS,CAG9E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,CAEjE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,EAAE,CAEpE"}
@@ -0,0 +1,51 @@
1
+ import { FhirPathRuntimeError } from "../errors.js";
2
+ import { SYSTEM_BOOLEAN, typeLocalName } from "./typed-value.js";
3
+ /**
4
+ * Singleton evaluation of collections, spec §4.5:
5
+ * 1. one item of the expected type → the item;
6
+ * 2. one item, expected type Boolean → `true`;
7
+ * 3. empty → empty (undefined here);
8
+ * 4. more than one item → error.
9
+ */
10
+ export function singleton(collection, expectedType) {
11
+ if (collection.length === 0) {
12
+ return undefined;
13
+ }
14
+ if (collection.length > 1) {
15
+ throw new FhirPathRuntimeError(`Expected a collection with at most one item, but found ${collection.length}`);
16
+ }
17
+ const item = collection[0];
18
+ if (expectedType === undefined || matchesExpectedType(item, expectedType)) {
19
+ return item;
20
+ }
21
+ if (expectedType === SYSTEM_BOOLEAN) {
22
+ return { type: SYSTEM_BOOLEAN, value: true };
23
+ }
24
+ throw new FhirPathRuntimeError(`Expected a value of type ${expectedType}, but found ${item.type}`);
25
+ }
26
+ function matchesExpectedType(item, expectedType) {
27
+ // Case-insensitive on the local name so FHIR primitives (`boolean`) satisfy System types (`Boolean`).
28
+ return (item.type === expectedType || typeLocalName(item.type).toLowerCase() === typeLocalName(expectedType).toLowerCase());
29
+ }
30
+ /**
31
+ * Singleton evaluation coerced to a boolean, applying the implicit-true rule.
32
+ * Empty returns undefined, which the three-valued logic operators need as an
33
+ * answer distinct from false. Do not turn it into `false` here; see
34
+ * `criteriaBoolean`.
35
+ */
36
+ export function booleanSingleton(collection) {
37
+ const item = singleton(collection, SYSTEM_BOOLEAN);
38
+ return item === undefined ? undefined : item.value;
39
+ }
40
+ /**
41
+ * Returns one criteria Boolean. FHIRPath §4.5 supplies singleton evaluation;
42
+ * FHIR constraints add that an empty result does not satisfy the criteria, so
43
+ * empty becomes `false`. Other Boolean functions keep their own item rules.
44
+ */
45
+ export function criteriaBoolean(collection) {
46
+ return booleanSingleton(collection) ?? false;
47
+ }
48
+ export function wrapBoolean(value) {
49
+ return value === undefined ? [] : [{ type: SYSTEM_BOOLEAN, value }];
50
+ }
51
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/values/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,cAAc,EAAmB,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,UAAwB,EAAE,YAAqB;IACvE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,oBAAoB,CAAC,0DAA0D,UAAU,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/G,CAAC;IACD,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAe,CAAA;IACxC,IAAI,YAAY,KAAK,SAAS,IAAI,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,YAAY,KAAK,cAAc,EAAE,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAA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