@atomic-ehr/fhirpath 0.1.3 → 0.1.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.
@@ -983,7 +983,6 @@ declare class FHIRModelProviderBase implements ModelProvider<FHIRModelContext> {
983
983
  private primitiveTypesCache?;
984
984
  private resourceTypesCache?;
985
985
  private readonly typeMapping;
986
- private readonly primitiveTypeMapping;
987
986
  constructor();
988
987
  prepare(): Promise<void>;
989
988
  initialize(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-ehr/fhirpath",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A TypeScript implementation of FHIRPath",
5
5
  "type": "module",
6
6
  "main": "./dist/index.node.js",
@@ -81,30 +81,6 @@ export class FHIRModelProviderBase implements ModelProvider<FHIRModelContext> {
81
81
  'Count': 'Quantity'
82
82
  };
83
83
 
84
- // Map FHIR primitive names to FHIRPath type names
85
- private readonly primitiveTypeMapping: Record<string, string> = {
86
- 'boolean': 'Boolean',
87
- 'string': 'String',
88
- 'integer': 'Integer',
89
- 'decimal': 'Decimal',
90
- 'date': 'Date',
91
- 'dateTime': 'DateTime',
92
- 'time': 'Time',
93
- 'instant': 'Instant',
94
- 'base64Binary': 'Base64Binary',
95
- 'uri': 'Uri',
96
- 'url': 'Url',
97
- 'canonical': 'Canonical',
98
- 'code': 'Code',
99
- 'oid': 'Oid',
100
- 'id': 'Id',
101
- 'markdown': 'Markdown',
102
- 'unsignedInt': 'UnsignedInt',
103
- 'positiveInt': 'PositiveInt',
104
- 'uuid': 'Uuid',
105
- 'xhtml': 'Xhtml'
106
- };
107
-
108
84
  constructor() {
109
85
  if (this.constructor === FHIRModelProviderBase) {
110
86
  throw new Error("FHIRModelProviderBase can't be instantiated directly.");
@@ -616,7 +592,9 @@ export class FHIRModelProviderBase implements ModelProvider<FHIRModelContext> {
616
592
 
617
593
  this.resourceTypesCache = resources
618
594
  .filter(r => r.resourceType === 'StructureDefinition')
619
- .map(r => (r as unknown as StructureDefinition).name)
595
+ .map(r => r as unknown as StructureDefinition)
596
+ .filter(sd => sd.derivation !== 'constraint')
597
+ .map(sd => sd.name)
620
598
  .filter((name): name is string => !!name)
621
599
  .sort();
622
600
 
@@ -664,9 +642,7 @@ export class FHIRModelProviderBase implements ModelProvider<FHIRModelContext> {
664
642
  .map(r => (r as unknown as StructureDefinition).name)
665
643
  .filter((name): name is string => !!name);
666
644
 
667
- this.primitiveTypesCache = fhirPrimitives
668
- .map(name => this.primitiveTypeMapping[name] || name)
669
- .sort();
645
+ this.primitiveTypesCache = fhirPrimitives.sort();
670
646
 
671
647
  return this.primitiveTypesCache || [];
672
648
  }