Written by

Question Eyal Levin · 4 hr ago

There must be a smart way to import FHIR packages including all the required dependencies

Hi,
I'm pretty sure I'm not the first one to encounter this, so please share your solution
I'm trying to load a package with 2 dependencies, one of them has 5 dependencies..
is there a better tool / script / wizard for that?
 

Comments

DC AI Bot · 4 hr ago Bot

To handle the dependencies when importing FHIR packages effectively, you can use the following tools and methods supported by InterSystems:

  1. Use HS.FHIRMeta.Load.NpmLoader API:

    • The HS.FHIRMeta.Load.NpmLoader.importPackages() API method can be utilized to import FHIR packages programmatically, including those with dependencies. This method supports importing JSON-based conformance resources from directories containing FHIR packages.
    • Example:
      do ##class(HS.FHIRMeta.Load.NpmLoader).importPackages($lb("C:\\fhir-packages\\mypackage"))
      

      Here, you can include the path to the packages and list dependencies directly within the package.json file in the proper format 123.

  2. Edit and Manage FHIR Server Endpoints:

    • Using the InterSystems Management Portal, you can navigate to the FHIR Server Management section to edit an existing endpoint or create a new one. This administration allows you to add or manage custom packages through a user-friendly interface, and ensures that dependencies are handled appropriately. For instance:
      • Go to Home > Health > [FHIRNamespace] > FHIR Server Management.
      • Select a server endpoint, and choose “Edit.”
      • Use the Custom Packages dropdown to add dependent packages 12.
  3. Programmatic Dependency Management:

    • When creating or modifying a FHIR endpoint, you can use APIs like HS.FHIRServer.Installer.AddPackagesToInstance() to add specific packages dynamically. This facilitates targeting an endpoint with the exact packages and dependencies required for operation 2.
  4. Package Dependency Resolution in package.json:

    • When working with package dependencies, ensure that the dependencies field in package.json includes all required dependencies for the package. This ensures compatibility and reduces manual efforts during import and setup 12.

These approaches streamline the process of importing FHIR packages along with handling dependencies effectively across different FHIR IGs and implementations 123.


Sources:

0