Skip to content

Commit

Permalink
Merge pull request #139 from FirelyTeam/main
Browse files Browse the repository at this point in the history
Changes because of firely-net-sdk 5.3.0
  • Loading branch information
GinoCanessa authored Aug 3, 2023
2 parents fb79330 + dd716c4 commit 7adc38b
Show file tree
Hide file tree
Showing 10 changed files with 15,221 additions and 559 deletions.
29 changes: 29 additions & 0 deletions src/Microsoft.Health.Fhir.SpecManager/Cql/CqlModels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Xml.Serialization;

namespace Ncqa.Cql.Model
{
internal static class CqlModels
{
private static readonly XmlSerializer xmlSerializer = new(typeof(ModelInfo));

public static IDictionary<string, ClassInfo> ClassesByName(ModelInfo model)
{
var result = model.typeInfo.OfType<ClassInfo>()
.ToDictionary(classInfo => classInfo.name);
return result;
}

public static ModelInfo LoadFromStream(System.IO.Stream stream)
{
return xmlSerializer.Deserialize(stream) as ModelInfo
?? throw new ArgumentException($"This resource is not a valid {nameof(ModelInfo)}");
}

public static ModelInfo LoadEmbeddedResource(string resourceName)
{
var stream = typeof(CqlModels).Assembly.GetManifestResourceStream(resourceName)
?? throw new ArgumentException($"Manifest resource stream {resourceName} is not included in this assembly.");
return LoadFromStream(stream);
}
}
}
12,082 changes: 12,082 additions & 0 deletions src/Microsoft.Health.Fhir.SpecManager/Cql/Models/fhir-modelinfo-4.0.1.xml

Large diffs are not rendered by default.

Loading

0 comments on commit 7adc38b

Please sign in to comment.