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

Virtual Packages and SUSHI Compatibility Changes #40

Open
wants to merge 2 commits into
base: new-fpl
Choose a base branch
from

Conversation

cmoesel
Copy link
Member

@cmoesel cmoesel commented Nov 5, 2024

Description: This PR includes various changes to better support the needs of SUSHI while remaining neutral for other environments and applications. These changes include:

  • VirtualPackage interface for pseudo packages not in the registry or local FHIR cache
  • DiskBased and InMemory implementations of Virtual Package
    • This replaces the previous local resource approach that used a special LOCAL#LOCAL package
    • In SUSHI, DiskBasedVirtualPackage is used to load local resources in input/resources, input/examples, etc
    • In SUSHI, InMemoryVirtualPackage is used to load the few R5 resources that should be resolvable in R4 (e.g., Base)
  • Support for loading VirtualPackages in the BasePackageLoader
  • Support for '|version' when searching by key
    • NOTE: I'm torn on whether we should support a single key argument that allows canonical version (e.g., findResourceJSON('SomeResource|1.2.3'), like in this PR) or if we should make version an optional 2nd argument (e.g., findResourceJSON('SomeResource', '1.2.3'), but then you need to pass in null if you don't want a version but need to pass in options as the 3rd argument)or make version an option (e.g., findResourceJSON('SomeResource', { version: '1.2.3' })).
  • New exportDB function in SQLJSPackageDB and BasePackageLoader for debugging purposes.
  • Added sort to find functions' options, with initial ByLoadOrder and ByType implementations (the original type argument is now just a filter, no longer affecting sort)
  • Added resolveVersion function to RegistryClient interface and corresponding implementations
  • Moved LRU cache from DiskBasedPackageCache to BasePackageLoader

Testing Instructions:

  • Run the tests and ensure they pass.
  • Run the CLI and use the --export option to export the SQLite DB to a file that you can load in a SQLite browser.
    • e.g., ts-node src/app.ts install hl7.fhir.us.core#7.0.0 hl7.fhir.us.mcode#2.0.0 --export
  • If you wish to try it in SUSHI, it's already integrated into SUSHI's new-fpl branch (but note that I'm working on polishing that branch; tests are still breaking and I want to do some refactoring).

Various changes to better support the needs of SUSHI while remaining neutral for other environments and applications. Including:
* VirtualPackage interface for pseudo packages not in the registry or local FHIR cache
* DiskBased and InMemory implementations of Virtual Package
* Support for loading VirtualPackages in the BasePackageLoader
* Support for '|version' when searching by key
* New exportDB function in SQLJSPackageDB and BasePackageLoader for debugging purposes
* New --export flag in CLI app to export a SQLite DB file from the loaded packages
* Added sort to find functions' options, with initial ByLoadOrder and ByType implementations (the original type argument is now just a filter, no longer affecting sort)
* Added resolveVersion function to RegistryClient interface and corresponding implementations
* Moved LRU cache from DiskBasedPackageCache to BasePackageLoader
- getPackageInfos returns all loaded package infos when search key is '*'
- BasePackageLoader returns helpful tips about SSL certificates and proxies when error is due to self-signed certificates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant