Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert cql-execution to async (#271)
This commit contains all work done to convert the source code to async. Individual commits below show the progress of first converting over the source code and then fixing all of the unit tests as well as other issues that surfaced due to the underlying source code changes. * WIP: initial async conversion in source code * Asyncified elm date-tests * Asyncified elm datetime-tests * Fixed rejection test for Today() * asyncified list-tests. fixed missing Promise.all and added some types mainly to the builder and base expression class while hunting down the issue * interval tests converted * asyncified elm parameters-test * asyncified elm external-test * fixed should issues in elm external-test * asyncified elm library-test (shows errors caused by sort issues) * Asyncified elm instance-test * Asyncified elm structured-test * Asyncified elm nullological-test * asyncified elm message-test * asyncify elm executor-test * more efficient use of Promise.all in List expression * added async/await for clinical tests * removed unnecessary async/awaits * changed should() syntax * Asyncified elm string-test * Asyncified elm logical-test * Asyncified elm type-test * async-ify convert-test and fix convert bug * Asyncified elm query-test * added missing await for query relationship resolution in query expression processing * asyncify aggregate test * asyncify literal and reusable * remove erroneous asyncs * Update comparison-test.ts * add parens * add async sorting functionality for queries * remove verified checked TODOs * regen cql4browsers * Update browser and node examples to async * update docs to async * Use new should syntax in example unit test documentation * Switch asyncMergeSort to use generics and add more tests * Add detection of promises from patient source and await them * Add V2_to_V3_MIGRATION document and update README example * Update terminology to allow for async providers * Remove uses of isPromise and always use await * Use better function typing in multi-source query forEach * Add documentation about terminology provider async to migration guide * Force synchronous iteration where it might matter In testing, I discovered that some queries do not operate correctly when each iteration of the query is being executed asynchronously. It seems related to how aliases and contexts are handled. Instead of allowing a query to run over the list asynchronously, force synchronous iteration to avoid these issues. * Preserve original order for equivalent items in async merge sort When two items compare as equal, the sort should preserve the original order of the items relative to each other. In other words, if item A and item B are deemed equivalent by the sort comparator, and item A appeared before item B in the original unsorted list, then item A should continue to appear before item B in the sorted list. This makes for a more predictable stable ordering. * Separate out construction of expression and execution in ELM type conversion Co-authored-by: Chris Hossenlopp <hossenlopp@mitre.org> Co-authored-by: sarahmcdougall <smcdougall@mitre.org> Co-authored-by: natjoe4 <njjones@mitre.org> Co-authored-by: mriley <mriley@mitre.org> Co-authored-by: Chris Moesel <cmoesel@mitre.org>
- Loading branch information