Skip to content

Commit 4157c82

Browse files
Merge remote-tracking branch 'lhc-git/master' into feature/LF-2985/async-functions
# Conflicts: # CHANGELOG.md # package-lock.json # package.json
2 parents 877bc1c + 5d3e04f commit 4157c82

20 files changed

+1078
-372
lines changed

CHANGELOG.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,31 @@
33
This log documents significant changes for each release. This project follows
44
[Semantic Versioning](http://semver.org/).
55

6-
## [3.12.0] - 2024-04-01
6+
## [3.14.0] - 2024-05-28
77
### Added
88
- Support for asynchronous functions: if any function in an expression returns
99
a Promise, then the result of evaluating the expression is a Promise.
1010

11+
## [3.13.2] - 2024-05-15
12+
### Fixed
13+
- an issue with evaluating an expression for a resource passed through an
14+
environment variable.
15+
- an issue with "statusShift" during performance tests.
16+
17+
## [3.13.1] - 2024-04-25
18+
### Fixed
19+
- Added flag 'u' for regular expressions in the specification's `matches` and
20+
`replaceMatches` functions to support the use of unicode character class
21+
escapes.
22+
23+
## [3.13.0] - 2024-04-10
24+
### Added
25+
- Function `defineVariable(name: String [, expr: expression])`.
26+
27+
## [3.12.0] - 2024-04-10
28+
### Changed
29+
- Updated Cypress to version 13.
30+
1131
## [3.11.0] - 2024-03-29
1232
### Added
1333
- Storing the FHIR data type along with the path in internal ResourceNode

cypress.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = defineConfig({
77
screenshotsFolder: 'test/cypress/screenshots',
88
videosFolder: 'test/cypress/videos',
99
e2e: {
10+
testIsolation: false,
1011
specPattern: 'test/cypress/e2e/**/*.cy.js',
1112
supportFile: 'test/cypress/support/e2e.js',
1213
},

fhir-context/dstu2/index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const updateWithGeneratedData = require('../general-additions');
12
/**
23
* Exports the FHIR model data for DSTU2. This is an internal structure that
34
* will likely evolve as more FHIR specific processing is added.
@@ -24,10 +25,7 @@ const modelInfo = {
2425
path2Type: require('./path2Type.json')
2526
};
2627

27-
// Generate a set of available data types
28-
modelInfo.availableTypes = new Set();
29-
// IE11 probably doesn't support `new Set(iterable)`
30-
Object.keys(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
31-
Object.values(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
28+
// Update with generated data
29+
updateWithGeneratedData(modelInfo)
3230

3331
module.exports = modelInfo;

fhir-context/general-additions.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Update the model with generated data
2+
module.exports = (modelInfo) => {
3+
// Generate a set of available data types
4+
modelInfo.availableTypes = new Set();
5+
// IE11 probably doesn't support `new Set(iterable)`
6+
Object.keys(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
7+
Object.values(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
8+
9+
// Generate a hash map to map paths to data types excluding "BackboneElement" and "Element".
10+
modelInfo.path2TypeWithoutElements = {};
11+
for(let i in modelInfo.path2Type) {
12+
if (modelInfo.path2Type[i] === 'Element' || modelInfo.path2Type[i] === 'BackboneElement') {
13+
continue;
14+
}
15+
modelInfo.path2TypeWithoutElements[i] = modelInfo.path2Type[i];
16+
}
17+
};

fhir-context/r4/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const updateWithGeneratedData = require('../general-additions');
2+
13
/**
24
* Exports the FHIR model data for R4. This is an internal structure that
35
* will likely evolve as more FHIR specific processing is added.
@@ -24,10 +26,7 @@ const modelInfo = {
2426
path2Type: require('./path2Type.json')
2527
};
2628

27-
// Generate a set of available data types
28-
modelInfo.availableTypes = new Set();
29-
// IE11 probably doesn't support `new Set(iterable)`
30-
Object.keys(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
31-
Object.values(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
29+
// Update with generated data
30+
updateWithGeneratedData(modelInfo)
3231

3332
module.exports = modelInfo;

fhir-context/r5/index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const updateWithGeneratedData = require('../general-additions');
12
/**
23
* Exports the FHIR model data for R5. This is an internal structure that
34
* will likely evolve as more FHIR specific processing is added.
@@ -24,10 +25,7 @@ const modelInfo = {
2425
path2Type: require('./path2Type.json')
2526
};
2627

27-
// Generate a set of available data types
28-
modelInfo.availableTypes = new Set();
29-
// IE11 probably doesn't support `new Set(iterable)`
30-
Object.keys(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
31-
Object.values(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
28+
// Update with generated data
29+
updateWithGeneratedData(modelInfo)
3230

3331
module.exports = modelInfo;

fhir-context/stu3/index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const updateWithGeneratedData = require('../general-additions');
12
/**
23
* Exports the FHIR model data for STU3. This is an internal structure that
34
* will likely evolve as more FHIR specific processing is added.
@@ -24,11 +25,8 @@ const modelInfo = {
2425
path2Type: require('./path2Type.json')
2526
};
2627

27-
// Generate a set of available data types
28-
modelInfo.availableTypes = new Set();
29-
// IE11 probably doesn't support `new Set(iterable)`
30-
Object.keys(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
31-
Object.values(modelInfo.type2Parent).forEach(i => modelInfo.availableTypes.add(i));
28+
// Update with generated data
29+
updateWithGeneratedData(modelInfo)
3230

3331
module.exports = modelInfo;
3432

index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ declare module "fhirpath" {
2121
): any[];
2222
export function resolveInternalTypes(value: any): any;
2323
export function types(value: any): string[];
24+
export function parse(expression: string): any;
25+
export const version :string;
2426
}
2527

2628
declare module "fhirpath/fhir-context/dstu2" {

0 commit comments

Comments
 (0)