Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial typescript setup #260

Merged
merged 42 commits into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fac0cad
WIP: rename files for later additions
Jan 24, 2022
dc1c2fe
Initial working ts commit
Jan 24, 2022
745ba3d
Fix luxon types to v1.x; add self to contributors
Jan 24, 2022
db290bf
Update examples and fix optional param
Jan 24, 2022
4de4fa4
remove babel config
Jan 24, 2022
b327c44
Update cql4Browsers
Jan 24, 2022
c2c0e2d
Yarn audit fix
Jan 25, 2022
ea41f12
Switch parseInt calls to Number.isInteger
Feb 1, 2022
f509a08
Yarn audit fix
Feb 1, 2022
0822989
yarn --> npm
Feb 1, 2022
a69f154
Update grep of validate_cql4browsers to include file extension
Feb 1, 2022
e45194c
Update CI to npm over yarn
Feb 1, 2022
e9eb611
Type and infra improvements
Feb 3, 2022
ef6b8b5
Add default exports
Feb 3, 2022
c45764b
Fix overloaded import since Length class moved
Feb 3, 2022
507c41f
Simplify usage of accessing built in Math functions
Feb 11, 2022
4d8e43d
Apply suggestions from code review
mgramigna Feb 15, 2022
d6828e2
Quick updates from code review
Feb 15, 2022
505e7a5
Missed an optional version
Feb 15, 2022
9db6020
Add stricter type to datetime functions
Feb 15, 2022
304540e
Unify luxon imports in datetime
Feb 15, 2022
b215c5a
Add interfaces specifying CodeService and Data Provider structure
Feb 15, 2022
13834cb
Used access type modifiers in select constructors
Feb 15, 2022
bdb31d7
Regen cql4browsers and add npm build as prereq to browserify
Feb 15, 2022
5785caa
Better type support
Feb 16, 2022
cff80a5
Remove redundant constructor assignments
Feb 16, 2022
7ce2fa8
move to inline exports
Feb 16, 2022
5f2b60b
Update findValueSet to use consistent type when not found
Feb 16, 2022
305b66c
Update structure of exposed API
Feb 16, 2022
4d0fdab
Rename runtime-types -> runtime.types
Feb 16, 2022
6e8ad76
update cql4browsers
Feb 16, 2022
e273e0d
Add comment explaining overrides
Feb 16, 2022
d5d5340
Added TODO for future refactors of datetime
Feb 16, 2022
ce8fc0d
Reworked unit conversion to use clearer type checking
Feb 16, 2022
8e97dd8
removed patients from DataProvider
Feb 16, 2022
a221bd6
added abstract base class for Date and DateTime
Feb 17, 2022
fc4f98b
Add more proper typing
Feb 17, 2022
73dd291
Make Concept default codes to [] when null
cmoesel Feb 18, 2022
5c93ba8
Make ValueSet default codes to [] when null
Feb 21, 2022
3f2b51f
Properly mark code as type string in messageListeners.ts
Feb 21, 2022
aeb97fb
Update docs
Feb 21, 2022
544f7dc
A fitting end to this work: a typo
Feb 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
942 changes: 497 additions & 445 deletions examples/browser/cql4browsers.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/cql-code-service.ts
Expand Up @@ -21,9 +21,9 @@ export class CodeService implements TerminologyProvider {
return this.valueSets[oid] ? Object.values(this.valueSets[oid]) : [];
}

findValueSet(oid: string, version?: string): ValueSet | null | undefined {
findValueSet(oid: string, version?: string): ValueSet | null {
if (version != null) {
return this.valueSets[oid] != null ? this.valueSets[oid][version] : undefined;
return this.valueSets[oid] != null ? this.valueSets[oid][version] : null;
} else {
const results = this.findValueSetsByOid(oid);
if (results.length === 0) {
Expand Down
8 changes: 4 additions & 4 deletions src/cql-patient.ts
@@ -1,7 +1,7 @@
import * as DT from './datatypes/datatypes';
mgramigna marked this conversation as resolved.
Show resolved Hide resolved
import { RecordObject, DataProvider } from './types';
import { DataProvider, PatientObject, RecordObject } from './types';

export class Record {
export class Record implements RecordObject {
json: any;
id: string;

Expand Down Expand Up @@ -94,11 +94,11 @@ export class Record {
}
}

export class Patient extends Record {
export class Patient extends Record implements PatientObject {
name?: string;
gender?: string;
birthDate?: DT.DateTime | null;
records: RecordObject;
records: { [recordType: string]: Record[] };

constructor(json: any) {
super(json);
Expand Down