@aehrc/ecl-core 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -108,6 +108,36 @@ const results = await fhir.evaluateEcl('< 404684003');
108
108
  // { concepts: [...], total }
109
109
  ```
110
110
 
111
+ ### Canonical Comparison
112
+
113
+ ```typescript
114
+ import { canonicalise, compareExpressions } from '@aehrc/ecl-core';
115
+
116
+ // Normalise to a deterministic canonical form (strips terms, sorts operands/attributes)
117
+ canonicalise('< 404684003 |Clinical finding| OR < 19829001');
118
+ // → '<19829001 OR <404684003'
119
+
120
+ // Compare two expressions for structural equivalence
121
+ compareExpressions('< 404684003 OR < 19829001', '< 19829001 OR < 404684003');
122
+ // → 'structurally_equivalent'
123
+ ```
124
+
125
+ Returns `'identical'`, `'structurally_equivalent'`, or `'different'`. Throws `CanonicaliseError` for unparseable input. Pure, synchronous, zero-network-dependency.
126
+
127
+ ### Historical Associations
128
+
129
+ ```typescript
130
+ import { FhirTerminologyService } from '@aehrc/ecl-core';
131
+
132
+ const fhir = new FhirTerminologyService({ baseUrl: 'https://tx.ontoserver.csiro.au/fhir' });
133
+
134
+ // Look up historical association targets for an inactive concept
135
+ const associations = await fhir.getHistoricalAssociations('261282001');
136
+ // [{ type: 'same-as', refsetId: '900000000000527005', targets: [{ code: '52323007', display: 'Helleborus niger' }] }]
137
+ ```
138
+
139
+ Queries SNOMED CT historical association reference sets (SAME AS, REPLACED BY, POSSIBLY EQUIVALENT TO, ALTERNATIVE) via FHIR `ConceptMap/$translate`.
140
+
111
141
  ### Knowledge
112
142
 
113
143
  Structured ECL reference documentation — 50 articles across 6 categories.