-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Require _is and _typeHierarchy * Add interfaces for TypeSpecifier structures
- Loading branch information
mgramigna
committed
Feb 17, 2022
1 parent
a221bd6
commit c139c09
Showing
5 changed files
with
103 additions
and
42 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './runtime.types'; | ||
export * from './cql-code-service.interfaces'; | ||
export * from './cql-patient.interfaces'; | ||
export * from './runtime.types'; | ||
export * from './type-specifiers.interfaces'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Types derived from http://cql.hl7.org/04-logicalspecification.html#typespecifier | ||
|
||
/* | ||
* Utility type for any possible TypeSpecifier | ||
*/ | ||
export type AnyTypeSpecifier = | ||
| NamedTypeSpecifier | ||
| IntervalTypeSpecifier | ||
| ListTypeSpecifier | ||
| TupleTypeSpecifier | ||
| ChoiceTypeSpecifier; | ||
|
||
/* | ||
* Base interface for other TypeSpecifiers to extend from | ||
*/ | ||
export interface TypeSpecifier { | ||
type: string; | ||
localId?: string; | ||
} | ||
|
||
export interface NamedTypeSpecifier extends TypeSpecifier { | ||
type: 'NamedTypeSpecifier'; | ||
name: string; | ||
} | ||
|
||
export interface IntervalTypeSpecifier extends TypeSpecifier { | ||
type: 'IntervalTypeSpecifier'; | ||
pointType: AnyTypeSpecifier; | ||
} | ||
|
||
export interface ListTypeSpecifier extends TypeSpecifier { | ||
type: 'ListTypeSpecifier'; | ||
elementType: AnyTypeSpecifier; | ||
} | ||
|
||
export interface TupleElementDefinition { | ||
localId?: string; | ||
name: string; | ||
elementType: AnyTypeSpecifier; | ||
} | ||
|
||
export interface TupleTypeSpecifier extends TypeSpecifier { | ||
type: 'TupleTypeSpecifier'; | ||
element?: TupleElementDefinition[]; | ||
} | ||
|
||
export interface ChoiceTypeSpecifier extends TypeSpecifier { | ||
type: 'ChoiceTypeSpecifier'; | ||
choice?: AnyTypeSpecifier[]; | ||
} |