@@ -79,18 +79,23 @@ public void resolvePrimaryLibraryDependencies(IBaseResource mainArtifact, FhirCo
7979 var primaryLibrary = IOUtils .getLibraryUrlMap (fhirContext ).get (
8080 ResourceUtils .getPrimaryLibraryUrl (mainArtifact , fhirContext ));
8181 if (getPrimaryLibrary () == null ) { // we want to save the primary library for the artifact being bundled not dependency libraries
82+ if (primaryLibrary == null && mainArtifact .getIdElement () != null && mainArtifact .getIdElement ().getValue () != null ) {
83+ logger .warn ("Unable to resolve primary library for artifact {}" , mainArtifact .getIdElement ().getValue ());
84+ }
8285 setPrimaryLibrary (primaryLibrary );
8386 }
8487
8588 var missingDependencies = new HashSet <String >();
8689 if (includeDependencies ) {
87- dependencies .add (primaryLibrary );
88- var dependencyLibraries = ResourceUtils .getDepLibraryResources (
89- primaryLibrary , fhirContext , true , false , missingDependencies );
90- dependencies .addAll (dependencyLibraries .values ());
90+ if (primaryLibrary != null ) {
91+ dependencies .add (primaryLibrary );
92+ var dependencyLibraries = ResourceUtils .getDepLibraryResources (
93+ primaryLibrary , fhirContext , true , false , missingDependencies );
94+ dependencies .addAll (dependencyLibraries .values ());
95+ }
9196 }
9297
93- if (includeTerminology ) {
98+ if (includeTerminology && primaryLibrary != null ) {
9499 var dependencyValueSets = ResourceUtils .getDepValueSetResources (
95100 primaryLibrary , fhirContext , true , missingDependencies );
96101 dependencies .addAll (dependencyValueSets .values ());
0 commit comments