Skip to content

Commit 9afb906

Browse files
committed
Merge branch '949-load-a-resource-and-dependencies-instead-of-full-directory' of https://github.com/FirelyTeam/firely-cql-sdk into 949-load-a-resource-and-dependencies-instead-of-full-directory
2 parents 94b10e0 + a737a91 commit 9afb906

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Cql/Cql.Invocation/Toolkit/Extensions/InvocationToolkitExtensions.FhirLibraryAdding.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ IEnumerable<string> GetRelatedResources(FhirLibrary library)
235235
if (shouldInclude)
236236
{
237237
if (!file.Exists)
238-
throw new ArgumentException($"No file exists '{file}' for FHIR library '{identifier}'.");
238+
throw new FileNotFoundException($"No file exists '{file}' for FHIR library '{identifier}'.", file.FullName);
239239
return file;
240240
}
241241
logger.LogDebug("Skipped loading file '{file}' by predicate.", file);
@@ -245,7 +245,24 @@ IEnumerable<string> GetRelatedResources(FhirLibrary library)
245245

246246
// Regex to extract "Library", "NCQAAdvancedIllnessandFrailty", and optional "1.0.0" from resource string
247247
// Example: https://fire.ly/fhir/Library/NCQAAdvancedIllnessandFrailty|1.0.0
248-
// Groups: 1=resourceType, 2=libraryName, 3=version (optional)
248+
/// <summary>
249+
/// Regex to extract the resource type, library name, and optional version from a FHIR Library resource string.
250+
///
251+
/// Capture groups:
252+
/// 1. <b>resourceType</b>: The FHIR resource type (e.g., "Library").
253+
/// 2. <b>libraryName</b>: The name of the library (e.g., "NCQAAdvancedIllnessandFrailty").
254+
/// 3. <b>version</b> (optional): The version of the library (e.g., "1.0.0").
255+
///
256+
/// Examples of valid input strings and their capture groups:
257+
/// - <c>https://fire.ly/fhir/Library/NCQAAdvancedIllnessandFrailty|1.0.0</c>
258+
/// 1 = "Library", 2 = "NCQAAdvancedIllnessandFrailty", 3 = "1.0.0"
259+
/// - <c>/Library/SomeLibrary|2.3.4</c>
260+
/// 1 = "Library", 2 = "SomeLibrary", 3 = "2.3.4"
261+
/// - <c>/Library/AnotherLibrary</c>
262+
/// 1 = "Library", 2 = "AnotherLibrary", 3 = null
263+
/// - <c>https://example.com/fhir/Library/MyLib</c>
264+
/// 1 = "Library", 2 = "MyLib", 3 = null
265+
/// </summary>
249266
[GeneratedRegex(@"\/([A-Za-z]+)\/([^|\/]+)(?:\|([0-9A-Za-z\.\-\+]+))?$")]
250267
private static partial Regex FhirLibraryResourceRegex();
251268

0 commit comments

Comments
 (0)