fhirsmith 0.16.1 → 0.18.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 (142) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +105 -30
  3. package/config-template.json +130 -4
  4. package/extension-tracker/extension-tracker.js +111 -3
  5. package/extension-tracker/readme.md +3 -0
  6. package/ips/ai-client.js +263 -0
  7. package/ips/composer.js +805 -0
  8. package/ips/editor-schema.js +289 -0
  9. package/ips/editor.js +290 -0
  10. package/ips/fhirpath-ips.js +397 -0
  11. package/ips/ips-codeable-concepts.md +1742 -0
  12. package/ips/ips-template.html +125 -0
  13. package/ips/ips-valuesets.js +159 -0
  14. package/ips/ips.js +1736 -0
  15. package/ips/membership.js +179 -0
  16. package/ips/pipeline.js +1012 -0
  17. package/ips/presenter.js +974 -0
  18. package/ips/profile-editor.js +578 -0
  19. package/ips/profiles.js +506 -0
  20. package/ips/readme.md +460 -0
  21. package/ips/render.js +1482 -0
  22. package/ips/search-params.js +83 -0
  23. package/ips/search.js +667 -0
  24. package/ips/share.js +178 -0
  25. package/ips/store.js +650 -0
  26. package/ips/terminology.js +395 -0
  27. package/ips/tx-client.js +202 -0
  28. package/ips/valuesets/CodeSystem-absent-unknown-uv-ips.json +206 -0
  29. package/ips/valuesets/ValueSet-absent-or-unknown-immunizations-uv-ips.json +59 -0
  30. package/ips/valuesets/ValueSet-ips-allergy-code.json +59 -0
  31. package/ips/valuesets/ValueSet-ips-allergy-manifestation.json +356 -0
  32. package/ips/valuesets/ValueSet-ips-allergy-substance.json +37 -0
  33. package/ips/valuesets/ValueSet-ips-body-site.json +26 -0
  34. package/ips/valuesets/ValueSet-ips-clinical-finding-or-none.json +35 -0
  35. package/ips/valuesets/ValueSet-ips-clinical-finding.json +26 -0
  36. package/ips/valuesets/ValueSet-ips-condition-code.json +72 -0
  37. package/ips/valuesets/ValueSet-ips-condition-severity.json +30 -0
  38. package/ips/valuesets/ValueSet-ips-condition-stage.json +26 -0
  39. package/ips/valuesets/ValueSet-ips-exposure-route.json +26 -0
  40. package/ips/valuesets/ValueSet-ips-imaging-procedure.json +25 -0
  41. package/ips/valuesets/ValueSet-ips-immunization-status-reason.json +43 -0
  42. package/ips/valuesets/ValueSet-ips-international-codes.json +25 -0
  43. package/ips/valuesets/ValueSet-ips-medication-ingredient.json +26 -0
  44. package/ips/valuesets/ValueSet-ips-medication-status-reason.json +37 -0
  45. package/ips/valuesets/ValueSet-ips-medication.json +50 -0
  46. package/ips/valuesets/ValueSet-ips-observation-code.json +18 -0
  47. package/ips/valuesets/ValueSet-ips-observation-interpretation.json +18 -0
  48. package/ips/valuesets/ValueSet-ips-procedure-followup.json +51 -0
  49. package/ips/valuesets/ValueSet-ips-procedure-outcome.json +30 -0
  50. package/ips/valuesets/ValueSet-ips-procedure-reason.json +37 -0
  51. package/ips/valuesets/ValueSet-ips-procedure.json +116 -0
  52. package/ips/valuesets/ValueSet-ips-route.json +46 -0
  53. package/ips/valuesets/ValueSet-ips-target-disease.json +171 -0
  54. package/ips/valuesets/ValueSet-ips-vaccine.json +31 -0
  55. package/ips/valuesets/elements.json +44 -0
  56. package/library/daily-report.js +422 -0
  57. package/library/fhir-search-values.js +138 -0
  58. package/library/html-server.js +32 -23
  59. package/library/html.js +9 -0
  60. package/library/mailer.js +77 -0
  61. package/library/narrative-check.js +222 -0
  62. package/library/npm-audit.js +25 -0
  63. package/library/package-manager.js +4 -2
  64. package/library/sqlite-session-store.js +29 -1
  65. package/package.json +8 -2
  66. package/packages/package-crawler.js +189 -82
  67. package/packages/packages.js +36 -63
  68. package/packages/utilities/dedupe-versions.js +22 -8
  69. package/publisher/publisher.js +29 -0
  70. package/registry/auth-store.js +366 -0
  71. package/registry/auth.js +872 -0
  72. package/registry/crawler.js +48 -1
  73. package/registry/documentation/api.md +162 -0
  74. package/registry/documentation/configuration.md +93 -0
  75. package/registry/documentation/documents.md +74 -0
  76. package/registry/documentation/internals.md +151 -0
  77. package/registry/documentation/readme.md +100 -0
  78. package/registry/documentation/security.md +199 -0
  79. package/registry/documents.js +309 -0
  80. package/registry/openapi.yaml +30 -0
  81. package/registry/registry-template.html +1 -1
  82. package/registry/registry.js +247 -54
  83. package/registry/uptime.js +154 -0
  84. package/release.sh +80 -0
  85. package/server.js +105 -44
  86. package/shl/shl.js +64 -9
  87. package/stats-db.js +93 -0
  88. package/stats.js +158 -1
  89. package/testing/readme.md +1 -1
  90. package/testing/search.js +2 -108
  91. package/testing/store.js +5 -0
  92. package/testing/testing.js +20 -0
  93. package/token/token-template.html +5 -4
  94. package/token/token.js +17 -10
  95. package/translations/Messages.properties +9 -0
  96. package/tx/README.md +52 -0
  97. package/tx/cm/cm-database.js +62 -0
  98. package/tx/cm/cm-package.js +20 -3
  99. package/tx/cs/cs-api.js +90 -14
  100. package/tx/cs/cs-cs.js +142 -19
  101. package/tx/cs/cs-icd11.js +366 -112
  102. package/tx/cs/cs-icf.js +418 -0
  103. package/tx/cs/cs-loinc.js +79 -39
  104. package/tx/cs/cs-omop.js +10 -3
  105. package/tx/cs/cs-snomed.js +918 -55
  106. package/tx/cs/cs-ucum.js +6 -0
  107. package/tx/cs/icd11-expressions.js +191 -78
  108. package/tx/importers/export-icd11-codesystem.js +58 -12
  109. package/tx/importers/icd11-schema.md +9 -5
  110. package/tx/library.js +107 -6
  111. package/tx/ocl/README.md +62 -6
  112. package/tx/ocl/cm-ocl.cjs +166 -44
  113. package/tx/ocl/cs-ocl.cjs +163 -13
  114. package/tx/ocl/resolve/public-access.js +143 -0
  115. package/tx/ocl/resolve/reference-resolver.js +458 -0
  116. package/tx/ocl/vs-ocl.cjs +167 -4
  117. package/tx/openapi-operations.js +4 -0
  118. package/tx/params.js +8 -1
  119. package/tx/problems.js +7 -5
  120. package/tx/provider.js +21 -5
  121. package/tx/sct/documentation.md +251 -0
  122. package/tx/sct/ecl.js +758 -46
  123. package/tx/sct/expressions.js +113 -52
  124. package/tx/syndication/syndication-feed.js +218 -0
  125. package/tx/syndication/syndication-store.js +415 -0
  126. package/tx/tx-html.js +37 -8
  127. package/tx/tx.fhir.org.yml +2 -3
  128. package/tx/tx.js +148 -5
  129. package/tx/vs/vs-database.js +26 -0
  130. package/tx/vs/vs-package.js +42 -10
  131. package/tx/vs/vs-vsac.js +25 -6
  132. package/tx/workers/expand.js +34 -7
  133. package/tx/workers/lookup.js +61 -6
  134. package/tx/workers/metadata.js +6 -1
  135. package/tx/workers/subsumes.js +1 -1
  136. package/tx/workers/translate.js +166 -15
  137. package/tx/workers/validate.js +128 -6
  138. package/utilities/make-sct-test-extension.js +264 -0
  139. package/utilities/submit-test-report.js +1 -1
  140. package/xig/xig.js +120 -12
  141. package/gr.sh +0 -3
  142. package/registry/readme.md +0 -124
@@ -0,0 +1,83 @@
1
+ //
2
+ // Copyright 2026, Health Intersections Pty Ltd (http://www.healthintersections.com.au)
3
+ //
4
+ // Licensed under BSD-3: https://opensource.org/license/bsd-3-clause
5
+ //
6
+
7
+ /**
8
+ * The search parameters the /ips module indexes, by resource: the standard R4
9
+ * parameters for Bundle, Composition and Patient (IPS is an R4 specification), with
10
+ * their FHIRPath expressions as the specification defines them, simplified where
11
+ * fhirpath.js has no resolve().
12
+ *
13
+ * A search on a project's documents is a search on Bundle, and the Composition and
14
+ * Patient parameters are reached by chaining: composition.date, composition.patient.name,
15
+ * composition.subject.birthdate. Each document is indexed once, when it is received,
16
+ * against everything here (see search.js).
17
+ *
18
+ * Only the types the parameters below have are implemented: string, token, date,
19
+ * reference. Nothing in these three resources is a number or quantity.
20
+ *
21
+ * @module ips/search-params
22
+ */
23
+
24
+ const BUNDLE = {
25
+ // the Composition is always the first entry; indexed specially (search.js) because the
26
+ // expression yields the resource, not a reference to it
27
+ composition: { type: 'reference', expression: 'Bundle.entry[0].resource', description: 'The first resource in the bundle, the Composition' },
28
+ identifier: { type: 'token', expression: 'Bundle.identifier', description: 'Persistent identifier for the bundle' },
29
+ timestamp: { type: 'date', expression: 'Bundle.timestamp', description: 'When the bundle was assembled' },
30
+ type: { type: 'token', expression: 'Bundle.type', description: 'document' }
31
+ };
32
+
33
+ const COMPOSITION = {
34
+ attester: { type: 'reference', expression: 'Composition.attester.party', description: 'Who attested the composition' },
35
+ author: { type: 'reference', expression: 'Composition.author', description: 'Who and/or what authored the composition' },
36
+ category: { type: 'token', expression: 'Composition.category', description: 'Categorization of Composition' },
37
+ confidentiality: { type: 'token', expression: 'Composition.confidentiality', description: 'As defined by affinity domain' },
38
+ context: { type: 'token', expression: 'Composition.event.code', description: 'Code(s) that apply to the event being documented' },
39
+ date: { type: 'date', expression: 'Composition.date', description: 'Composition editing time' },
40
+ encounter: { type: 'reference', expression: 'Composition.encounter', description: 'Context of the Composition' },
41
+ entry: { type: 'reference', expression: 'Composition.section.entry', description: 'A reference to data that supports this section' },
42
+ identifier: { type: 'token', expression: 'Composition.identifier', description: 'Version-independent identifier for the Composition' },
43
+ patient: { type: 'reference', expression: 'Composition.subject', description: 'Who and/or what the composition is about', target: 'Patient' },
44
+ period: { type: 'date', expression: 'Composition.event.period', description: 'The period covered by the documentation' },
45
+ section: { type: 'token', expression: 'Composition.section.code', description: 'Classification of section (recommended)' },
46
+ status: { type: 'token', expression: 'Composition.status', description: 'preliminary | final | amended | entered-in-error' },
47
+ subject: { type: 'reference', expression: 'Composition.subject', description: 'Who and/or what the composition is about', target: 'Patient' },
48
+ title: { type: 'string', expression: 'Composition.title', description: 'Human Readable name/title' },
49
+ type: { type: 'token', expression: 'Composition.type', description: 'Kind of composition (LOINC if possible)' }
50
+ };
51
+
52
+ const PATIENT = {
53
+ active: { type: 'token', expression: 'Patient.active', description: 'Whether the patient record is active' },
54
+ address: { type: 'string', expression: 'Patient.address', description: 'Any part of the address' },
55
+ 'address-city': { type: 'string', expression: 'Patient.address.city', description: 'A city specified in an address' },
56
+ 'address-country': { type: 'string', expression: 'Patient.address.country', description: 'A country specified in an address' },
57
+ 'address-postalcode': { type: 'string', expression: 'Patient.address.postalCode', description: 'A postal code specified in an address' },
58
+ 'address-state': { type: 'string', expression: 'Patient.address.state', description: 'A state specified in an address' },
59
+ 'address-use': { type: 'token', expression: 'Patient.address.use', description: 'A use code specified in an address' },
60
+ birthdate: { type: 'date', expression: 'Patient.birthDate', description: "The patient's date of birth" },
61
+ 'death-date': { type: 'date', expression: '(Patient.deceased as dateTime)', description: 'The date of death has been provided and satisfies this search value' },
62
+ deceased: { type: 'token', expression: 'Patient.deceased.exists() and Patient.deceased != false', description: 'This patient has been marked as deceased, or as a death date entered' },
63
+ email: { type: 'token', expression: "Patient.telecom.where(system='email')", description: 'A value in an email contact' },
64
+ family: { type: 'string', expression: 'Patient.name.family', description: 'A portion of the family name of the patient' },
65
+ gender: { type: 'token', expression: 'Patient.gender', description: 'Gender of the patient' },
66
+ 'general-practitioner': { type: 'reference', expression: 'Patient.generalPractitioner', description: "Patient's nominated general practitioner" },
67
+ given: { type: 'string', expression: 'Patient.name.given', description: 'A portion of the given name of the patient' },
68
+ identifier: { type: 'token', expression: 'Patient.identifier', description: 'A patient identifier' },
69
+ language: { type: 'token', expression: 'Patient.communication.language', description: 'Language code (irrespective of use value)' },
70
+ name: { type: 'string', expression: 'Patient.name', description: 'Any part of the name: family, given, prefix, suffix, or text' },
71
+ organization: { type: 'reference', expression: 'Patient.managingOrganization', description: 'The organization that is the custodian of the patient record' },
72
+ phone: { type: 'token', expression: "Patient.telecom.where(system='phone')", description: 'A value in a phone contact' },
73
+ telecom: { type: 'token', expression: 'Patient.telecom', description: 'The value in any kind of telecom details of the patient' }
74
+ };
75
+
76
+ const BY_RESOURCE = { Bundle: BUNDLE, Composition: COMPOSITION, Patient: PATIENT };
77
+
78
+ // the chains a search can use: the parameter name on Bundle, and what it leads to
79
+ const CHAINS = {
80
+ composition: { resource: 'Composition', via: { patient: 'Patient', subject: 'Patient' } }
81
+ };
82
+
83
+ module.exports = { BUNDLE, COMPOSITION, PATIENT, BY_RESOURCE, CHAINS };