diff --git a/src/Microsoft.Health.Fhir.SpecManager/Cql/CqlModels.cs b/src/Microsoft.Health.Fhir.SpecManager/Cql/CqlModels.cs new file mode 100644 index 000000000..8aa8f10a2 --- /dev/null +++ b/src/Microsoft.Health.Fhir.SpecManager/Cql/CqlModels.cs @@ -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 ClassesByName(ModelInfo model) + { + var result = model.typeInfo.OfType() + .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); + } + } +} diff --git a/src/Microsoft.Health.Fhir.SpecManager/Cql/Models/fhir-modelinfo-4.0.1.xml b/src/Microsoft.Health.Fhir.SpecManager/Cql/Models/fhir-modelinfo-4.0.1.xml new file mode 100644 index 000000000..3c32d72bb --- /dev/null +++ b/src/Microsoft.Health.Fhir.SpecManager/Cql/Models/fhir-modelinfo-4.0.1.xml @@ -0,0 +1,12082 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.cs b/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.cs new file mode 100644 index 000000000..eb980b965 --- /dev/null +++ b/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.cs @@ -0,0 +1,2004 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by xsd, Version=4.8.3928.0. +// +namespace Ncqa.Cql.Model { + using System.Xml.Serialization; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + [System.Xml.Serialization.XmlRootAttribute("modelInfo", Namespace="urn:hl7-org:elm-modelinfo:r1", IsNullable=false)] + public partial class ModelInfo { + + private ModelSpecifier[] requiredModelInfoField; + + private TypeInfo[] typeInfoField; + + private ConversionInfo[] conversionInfoField; + + private ContextInfo[] contextInfoField; + + private string nameField; + + private string versionField; + + private string urlField; + + private string targetUrlField; + + private string targetVersionField; + + private string schemaLocationField; + + private string targetQualifierField; + + private string patientClassNameField; + + private string patientClassIdentifierField; + + private string patientBirthDatePropertyNameField; + + private bool caseSensitiveField; + + private bool caseSensitiveFieldSpecified; + + private bool strictRetrieveTypingField; + + private bool strictRetrieveTypingFieldSpecified; + + private string defaultContextField; + + /// + [System.Xml.Serialization.XmlElementAttribute("requiredModelInfo")] + public ModelSpecifier[] requiredModelInfo { + get { + return this.requiredModelInfoField; + } + set { + this.requiredModelInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("typeInfo")] + public TypeInfo[] typeInfo { + get { + return this.typeInfoField; + } + set { + this.typeInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("conversionInfo")] + public ConversionInfo[] conversionInfo { + get { + return this.conversionInfoField; + } + set { + this.conversionInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("contextInfo")] + public ContextInfo[] contextInfo { + get { + return this.contextInfoField; + } + set { + this.contextInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string url { + get { + return this.urlField; + } + set { + this.urlField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string targetUrl { + get { + return this.targetUrlField; + } + set { + this.targetUrlField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string targetVersion { + get { + return this.targetVersionField; + } + set { + this.targetVersionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string schemaLocation { + get { + return this.schemaLocationField; + } + set { + this.schemaLocationField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string targetQualifier { + get { + return this.targetQualifierField; + } + set { + this.targetQualifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string patientClassName { + get { + return this.patientClassNameField; + } + set { + this.patientClassNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string patientClassIdentifier { + get { + return this.patientClassIdentifierField; + } + set { + this.patientClassIdentifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string patientBirthDatePropertyName { + get { + return this.patientBirthDatePropertyNameField; + } + set { + this.patientBirthDatePropertyNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool caseSensitive { + get { + return this.caseSensitiveField; + } + set { + this.caseSensitiveField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool caseSensitiveSpecified { + get { + return this.caseSensitiveFieldSpecified; + } + set { + this.caseSensitiveFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool strictRetrieveTyping { + get { + return this.strictRetrieveTypingField; + } + set { + this.strictRetrieveTypingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool strictRetrieveTypingSpecified { + get { + return this.strictRetrieveTypingFieldSpecified; + } + set { + this.strictRetrieveTypingFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string defaultContext { + get { + return this.defaultContextField; + } + set { + this.defaultContextField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ModelSpecifier { + + private string urlField; + + private string nameField; + + private string versionField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string url { + get { + return this.urlField; + } + set { + this.urlField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ContextInfo { + + private NamedTypeSpecifier contextTypeField; + + private string nameField; + + private string keyElementField; + + private string birthDateElementField; + + /// + public NamedTypeSpecifier contextType { + get { + return this.contextTypeField; + } + set { + this.contextTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string keyElement { + get { + return this.keyElementField; + } + set { + this.keyElementField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string birthDateElement { + get { + return this.birthDateElementField; + } + set { + this.birthDateElementField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class NamedTypeSpecifier : TypeSpecifier { + + private string modelNameField; + + private string namespaceField; + + private string nameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string modelName { + get { + return this.modelNameField; + } + set { + this.modelNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string @namespace { + get { + return this.namespaceField; + } + set { + this.namespaceField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TupleTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BoundParameterTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ParameterTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChoiceTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntervalTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListTypeSpecifier))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NamedTypeSpecifier))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public abstract partial class TypeSpecifier { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class TupleTypeSpecifier : TypeSpecifier { + + private TupleTypeSpecifierElement[] elementField; + + /// + [System.Xml.Serialization.XmlElementAttribute("element")] + public TupleTypeSpecifierElement[] element { + get { + return this.elementField; + } + set { + this.elementField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class TupleTypeSpecifierElement { + + private TypeSpecifier elementTypeField; + + private string nameField; + + /// + public TypeSpecifier elementType { + get { + return this.elementTypeField; + } + set { + this.elementTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class BoundParameterTypeSpecifier : TypeSpecifier { + + private TypeSpecifier elementTypeSpecifierField; + + private string parameterNameField; + + private string boundTypeField; + + /// + public TypeSpecifier elementTypeSpecifier { + get { + return this.elementTypeSpecifierField; + } + set { + this.elementTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string parameterName { + get { + return this.parameterNameField; + } + set { + this.parameterNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string boundType { + get { + return this.boundTypeField; + } + set { + this.boundTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ParameterTypeSpecifier : TypeSpecifier { + + private string parameterNameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string parameterName { + get { + return this.parameterNameField; + } + set { + this.parameterNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ChoiceTypeSpecifier : TypeSpecifier { + + private TypeSpecifier[] choiceField; + + /// + [System.Xml.Serialization.XmlElementAttribute("choice")] + public TypeSpecifier[] choice { + get { + return this.choiceField; + } + set { + this.choiceField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class IntervalTypeSpecifier : TypeSpecifier { + + private TypeSpecifier pointTypeSpecifierField; + + private string pointTypeField; + + /// + public TypeSpecifier pointTypeSpecifier { + get { + return this.pointTypeSpecifierField; + } + set { + this.pointTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string pointType { + get { + return this.pointTypeField; + } + set { + this.pointTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ListTypeSpecifier : TypeSpecifier { + + private TypeSpecifier elementTypeSpecifierField; + + private string elementTypeField; + + /// + public TypeSpecifier elementTypeSpecifier { + get { + return this.elementTypeSpecifierField; + } + set { + this.elementTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string elementType { + get { + return this.elementTypeField; + } + set { + this.elementTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ConversionInfo { + + private TypeSpecifier fromTypeSpecifierField; + + private TypeSpecifier toTypeSpecifierField; + + private string functionNameField; + + private string fromTypeField; + + private string toTypeField; + + /// + public TypeSpecifier fromTypeSpecifier { + get { + return this.fromTypeSpecifierField; + } + set { + this.fromTypeSpecifierField = value; + } + } + + /// + public TypeSpecifier toTypeSpecifier { + get { + return this.toTypeSpecifierField; + } + set { + this.toTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string functionName { + get { + return this.functionNameField; + } + set { + this.functionNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string fromType { + get { + return this.fromTypeField; + } + set { + this.fromTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string toType { + get { + return this.toTypeField; + } + set { + this.toTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class TupleTypeInfoElement { + + private TypeSpecifier typeSpecifierField; + + private TypeSpecifier elementTypeSpecifierField; + + private string nameField; + + private string typeField; + + private string elementTypeField; + + private bool prohibitedField; + + private bool prohibitedFieldSpecified; + + private bool oneBasedField; + + private bool oneBasedFieldSpecified; + + /// + public TypeSpecifier typeSpecifier { + get { + return this.typeSpecifierField; + } + set { + this.typeSpecifierField = value; + } + } + + /// + public TypeSpecifier elementTypeSpecifier { + get { + return this.elementTypeSpecifierField; + } + set { + this.elementTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string elementType { + get { + return this.elementTypeField; + } + set { + this.elementTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool prohibited { + get { + return this.prohibitedField; + } + set { + this.prohibitedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool prohibitedSpecified { + get { + return this.prohibitedFieldSpecified; + } + set { + this.prohibitedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool oneBased { + get { + return this.oneBasedField; + } + set { + this.oneBasedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool oneBasedSpecified { + get { + return this.oneBasedFieldSpecified; + } + set { + this.oneBasedFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class SearchInfo { + + private TypeSpecifier typeSpecifierField; + + private string nameField; + + private string pathField; + + private string typeField; + + private string labelField; + + private string descriptionField; + + private string definitionField; + + private string commentField; + + /// + public TypeSpecifier typeSpecifier { + get { + return this.typeSpecifierField; + } + set { + this.typeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string path { + get { + return this.pathField; + } + set { + this.pathField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string label { + get { + return this.labelField; + } + set { + this.labelField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string definition { + get { + return this.definitionField; + } + set { + this.definitionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class RelationshipInfo { + + private string contextField; + + private string relatedKeyElementField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string context { + get { + return this.contextField; + } + set { + this.contextField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string relatedKeyElement { + get { + return this.relatedKeyElementField; + } + set { + this.relatedKeyElementField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ExpressionInfo { + + private string languageField; + + private string expressionField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string language { + get { + return this.languageField; + } + set { + this.languageField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string expression { + get { + return this.expressionField; + } + set { + this.expressionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ConstraintInfo { + + private ExpressionInfo[] expressionField; + + private string nameField; + + private string severityField; + + private string descriptionField; + + private string messageField; + + /// + [System.Xml.Serialization.XmlElementAttribute("expression")] + public ExpressionInfo[] expression { + get { + return this.expressionField; + } + set { + this.expressionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string severity { + get { + return this.severityField; + } + set { + this.severityField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string message { + get { + return this.messageField; + } + set { + this.messageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class BindingInfo { + + private string nameField; + + private string descriptionField; + + private BindingStrength strengthField; + + private string valueSetField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public BindingStrength strength { + get { + return this.strengthField; + } + set { + this.strengthField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string valueSet { + get { + return this.valueSetField; + } + set { + this.valueSetField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public enum BindingStrength { + + /// + Required, + + /// + Extensible, + + /// + Preferred, + + /// + Example, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ClassInfoElement { + + private TypeSpecifier typeSpecifierField; + + private TypeSpecifier elementTypeSpecifierField; + + private BindingInfo bindingField; + + private ConstraintInfo[] constraintField; + + private string nameField; + + private string typeField; + + private string elementTypeField; + + private bool prohibitedField; + + private bool prohibitedFieldSpecified; + + private bool oneBasedField; + + private bool oneBasedFieldSpecified; + + private string targetField; + + private string labelField; + + private string descriptionField; + + private string definitionField; + + private string commentField; + + private int minField; + + private bool minFieldSpecified; + + private string maxField; + + private bool mustSupportField; + + private bool mustSupportFieldSpecified; + + /// + public TypeSpecifier typeSpecifier { + get { + return this.typeSpecifierField; + } + set { + this.typeSpecifierField = value; + } + } + + /// + public TypeSpecifier elementTypeSpecifier { + get { + return this.elementTypeSpecifierField; + } + set { + this.elementTypeSpecifierField = value; + } + } + + /// + public BindingInfo binding { + get { + return this.bindingField; + } + set { + this.bindingField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("constraint")] + public ConstraintInfo[] constraint { + get { + return this.constraintField; + } + set { + this.constraintField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string elementType { + get { + return this.elementTypeField; + } + set { + this.elementTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool prohibited { + get { + return this.prohibitedField; + } + set { + this.prohibitedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool prohibitedSpecified { + get { + return this.prohibitedFieldSpecified; + } + set { + this.prohibitedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool oneBased { + get { + return this.oneBasedField; + } + set { + this.oneBasedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool oneBasedSpecified { + get { + return this.oneBasedFieldSpecified; + } + set { + this.oneBasedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string target { + get { + return this.targetField; + } + set { + this.targetField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string label { + get { + return this.labelField; + } + set { + this.labelField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string definition { + get { + return this.definitionField; + } + set { + this.definitionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int min { + get { + return this.minField; + } + set { + this.minField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool minSpecified { + get { + return this.minFieldSpecified; + } + set { + this.minFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string max { + get { + return this.maxField; + } + set { + this.maxField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool mustSupport { + get { + return this.mustSupportField; + } + set { + this.mustSupportField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mustSupportSpecified { + get { + return this.mustSupportFieldSpecified; + } + set { + this.mustSupportFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class TypeParameterInfo { + + private TypeSpecifier typeSpecifierField; + + private string nameField; + + private string constraintField; + + private string constraintTypeField; + + /// + public TypeSpecifier typeSpecifier { + get { + return this.typeSpecifierField; + } + set { + this.typeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string constraint { + get { + return this.constraintField; + } + set { + this.constraintField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string constraintType { + get { + return this.constraintTypeField; + } + set { + this.constraintTypeField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChoiceTypeInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TupleTypeInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ListTypeInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntervalTypeInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SimpleTypeInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ClassInfo))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProfileInfo))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public abstract partial class TypeInfo { + + private TypeSpecifier baseTypeSpecifierField; + + private string baseTypeField; + + /// + public TypeSpecifier baseTypeSpecifier { + get { + return this.baseTypeSpecifierField; + } + set { + this.baseTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string baseType { + get { + return this.baseTypeField; + } + set { + this.baseTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ChoiceTypeInfo : TypeInfo { + + private TypeSpecifier[] typeField; + + private TypeSpecifier[] choiceField; + + /// + [System.Xml.Serialization.XmlElementAttribute("type")] + public TypeSpecifier[] type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("choice")] + public TypeSpecifier[] choice { + get { + return this.choiceField; + } + set { + this.choiceField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class TupleTypeInfo : TypeInfo { + + private TupleTypeInfoElement[] elementField; + + /// + [System.Xml.Serialization.XmlElementAttribute("element")] + public TupleTypeInfoElement[] element { + get { + return this.elementField; + } + set { + this.elementField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ListTypeInfo : TypeInfo { + + private TypeSpecifier elementTypeSpecifierField; + + private string elementTypeField; + + /// + public TypeSpecifier elementTypeSpecifier { + get { + return this.elementTypeSpecifierField; + } + set { + this.elementTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string elementType { + get { + return this.elementTypeField; + } + set { + this.elementTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class IntervalTypeInfo : TypeInfo { + + private TypeSpecifier pointTypeSpecifierField; + + private string pointTypeField; + + /// + public TypeSpecifier pointTypeSpecifier { + get { + return this.pointTypeSpecifierField; + } + set { + this.pointTypeSpecifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string pointType { + get { + return this.pointTypeField; + } + set { + this.pointTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class SimpleTypeInfo : TypeInfo { + + private string namespaceField; + + private string nameField; + + private string targetField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string @namespace { + get { + return this.namespaceField; + } + set { + this.namespaceField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string target { + get { + return this.targetField; + } + set { + this.targetField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ProfileInfo))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ClassInfo : TypeInfo { + + private TypeParameterInfo[] parameterField; + + private ClassInfoElement[] elementField; + + private RelationshipInfo[] contextRelationshipField; + + private RelationshipInfo[] targetContextRelationshipField; + + private SearchInfo[] searchField; + + private ExpressionInfo[] inferenceExpressionField; + + private ConstraintInfo[] constraintField; + + private string namespaceField; + + private string nameField; + + private string identifierField; + + private string labelField; + + private string descriptionField; + + private string definitionField; + + private string commentField; + + private string targetField; + + private bool retrievableField; + + private string primaryCodePathField; + + private string primaryValueSetPathField; + + public ClassInfo() { + this.retrievableField = false; + } + + /// + [System.Xml.Serialization.XmlElementAttribute("parameter")] + public TypeParameterInfo[] parameter { + get { + return this.parameterField; + } + set { + this.parameterField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("element")] + public ClassInfoElement[] element { + get { + return this.elementField; + } + set { + this.elementField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("contextRelationship")] + public RelationshipInfo[] contextRelationship { + get { + return this.contextRelationshipField; + } + set { + this.contextRelationshipField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("targetContextRelationship")] + public RelationshipInfo[] targetContextRelationship { + get { + return this.targetContextRelationshipField; + } + set { + this.targetContextRelationshipField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("search")] + public SearchInfo[] search { + get { + return this.searchField; + } + set { + this.searchField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("inferenceExpression")] + public ExpressionInfo[] inferenceExpression { + get { + return this.inferenceExpressionField; + } + set { + this.inferenceExpressionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("constraint")] + public ConstraintInfo[] constraint { + get { + return this.constraintField; + } + set { + this.constraintField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string @namespace { + get { + return this.namespaceField; + } + set { + this.namespaceField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string identifier { + get { + return this.identifierField; + } + set { + this.identifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string label { + get { + return this.labelField; + } + set { + this.labelField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string definition { + get { + return this.definitionField; + } + set { + this.definitionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string target { + get { + return this.targetField; + } + set { + this.targetField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool retrievable { + get { + return this.retrievableField; + } + set { + this.retrievableField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string primaryCodePath { + get { + return this.primaryCodePathField; + } + set { + this.primaryCodePathField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string primaryValueSetPath { + get { + return this.primaryValueSetPathField; + } + set { + this.primaryValueSetPathField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:hl7-org:elm-modelinfo:r1")] + public partial class ProfileInfo : ClassInfo { + } +} diff --git a/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.xsd b/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.xsd new file mode 100644 index 000000000..f078d4f65 --- /dev/null +++ b/src/Microsoft.Health.Fhir.SpecManager/Cql/modelinfo.xsd @@ -0,0 +1,654 @@ + + + + + The modelInfo element defines metadata associated with a particular model to allow it to be used by CQL. + + + + + Defines an available context type for the model. + + + + + Specifies the type for the context. + + + + + + Specifies the name of the context. This is the name that will be referenced by context statements within CQL. + + + + + Specifies the key elements, in order and semi-colon delimited, of the context type that form the reference key for the context. The elements taken together must form a unique identifier for instances of the context. + + + + + Specifies the name of the birthDateElement of the context type. + + + + + + Defines the relationship of a class to the context. + + + + Specifies the target context of the relationship. + + + + + Specifies the related key elements, in order and semi-colon delimited, of the type that contain the reference to the context. There must be the same number of elements, and in the same order, as the target context. + + + + + + Defines a possible search path for a ClassInfo within the model. + + + + + Specifies the type of the search parameter as a type specifier + + + + + + Defines the name of the search info + + + + + Defines the formal path to search values within the ClassInfo. In the simplest case, this is the same as the name. + + + + + Specifies the type of the search parameter + + + + + Provides an optional, user-friendly label for the search path that can be used to reference the search path from CQL. + + + + + Specifies a short description of the search path + + + + + Provides a complete, detailed, markdown-capable definition of the search path + + + + + Provides markdown-capable additional comments on the use of the search path + + + + + + The ModelInfo type defines the metadata associated with a particular model to enable it to be used by the CQL translator. Note that none of the information specified here is required, it just enables some convenient shorthands within the language. + + + + + + + + + + The name attribute specifies the name of the data model. This value is the same as the model identifier used in using definitions and type specifiers within CQL. + + + + + The version attribute specifies the version of the data model. If specified, this value is the same as the version used in using definitions within CQL. + + + + + The url attribute specifies the xml namespace associated with the model, and is used by the CQL translator to establish the url used to reference types from the model schema within an ELM document. + + + + + Specifies a target url that identifies the xml namespace associated with the target model in the underlying representation. + + + + + Specifies a target version that identifies the version of the xml namespace associated with the target model in the underlying representation. + + + + + The schemaLocation attribute is used by the CQL translator to output the schemaLocation of the xsd for the data model in the resulting ELM document. + + + + + The targetQualifier attribute is used to specify the namespace qualifier that should be used when referencing types of the model within the ELM document. + + + + + DEPRECATED: The patientClassName attribute specifies the name of the Patient class within the model. + + + + + DEPRECATED: The patientClassIdentifier attribute specifies a unique name for the Patient class that may be independent of the name. In FHIR, this corresponds to the Patient profile identifier. + + + + + DEPRECATED: The patientBirthDatePropertyName attribute specifies the name of the birthdate property on the Patient model. + + + + + The isCaseSensitive attribute indicates whether the identifiers used by this model should be resolved case-sensitively. If the attribute is true, references to identifiers in this model must match by case. + + + + + The strictRetrieveTyping attribute indicates whether or not retrieve expressions against the model should be semantically validated. If this attribute is not present or false, code and date range filters within the retrieve are not type validated, allowing the data access layer to perform late binding of content within the retrieve. If the attribute is true, code and date range filters within the retrieve are type validated. + + + + + Specifies the default context to be used by CQL expressions for this model. + + + + + + The BindingStrength type describes possible strengths of a binding specification, Required, Extensible, Preferred, and Example. + + + + + + + + + + + Specifies binding information for an element + + + + Specifies a formal name for the binding, suitable for use as a class name in generated targets + + + + + Specifies a user-friendly description of the the binding, suitable for use as a display description for possible values of the element + + + + + Specifies the strength of the binding, required, extensible, preferred, or example + + + + + Specifies the target value set for the binding (i.e. the value set that specifies thes et of possible values for the element) + + + + + + + + This element is deprecated. New implementations should use the new elementTypeSpecifier element. + + + + + + + A constraint that applies to this class element. The evaluation context for the constraint is an instance of the class + + + + + + + This attribute is deprecated. New implementations should use the new elementType attribute + + + + + + + Indicates that the starting index for a list-valued element is one. By default, lists are zero-based. + + + + + Specifies a path that can be used instead of the name of the element to access the value for this element in the underlying representation. + + + + + Specifies a user-friendly label for the element + + + + + Specifies a short description of the element + + + + + Provides a complete, detailed, markdown-capable definition of the element + + + + + Provides markdown-capable additional comments on the use of the element + + + + + Specifies the minimum cardinality of the element. For non-list-valued elements, this is 0 or 1, indicating whether a value is required (1). For list-valued elements, this is an integer defining the minimum cardinality of the list value. + + + + + Specifies the maximum cardinality of the element. For non-list-valued elements, this is 0 or 1, indicating where a value is prohibited (0). For list-valued elements, this is an integer definined the maximum cardinality of the list, or a '*' indicating the list has no maximum number of elements. If this value is an integer, it must be greater than or equal to the value of the min attribute. + + + + + Specifies whether this element is relevant for the use case the class in which it appears is supporting + + + + + + The ExpressionInfo type models an expression in some language. + + + + Specifies the language of the expression as a media type (e.g. text/cql-expression) + + + + + The expression in the language specified by the language attribute + + + + + + The ConstraintInfo type models the definition of a constraint which can then be associated with a class info, class info element, or other model element. + + + + + The formal expression of the constraint in some formal language. Multiple expressions are considered equivalent formulations in alternate languages (i.e. there can be only one expression of a given language for the constraint). + + + + + + The name of the constraint, unique within the context of use for the constraint. + + + + + The severity of the constraint, one of Info, Warning, or Error. + + + + + A description of the constraint. + + + + + The message that is returned as a result of this constraint being violated. The message may be templatized through the use of double-braces ({{ }}). + + + + + + The ClassInfo type models information associated with a single class in the data model. + + + + + + + The generic parameters defined by a generic class. In generic class + SomeClass<S extends Type1, T>, 'S extends Type1' and 'T' are both generic + parameters. + + + + + + + + + + An expression that describes values of this class if they can be inferred from other data elements. If multiple expressions are provided, they must be isopragmatic (i.e. only one expression of each language is allowed) + + + + + A constraint that applies to the class. The evaluation context for the constraint is an instance of the class. + + + + + + Namespace is the namespace of the class. This is typically just the name of the model, but can contain additional qualifiers. + + + + + The name attribute specifies the name of the type within the data model. This corresponds to the name of the class within the class model, or the name of the type in the case of an xsd. In FHIR, this corresponds to the name of the resource. + + + + + The identifier attribute specifies a unique name for the class that may be independent of the name. In FHIR, this corresponds to the profile identifier. + + + + + The label attribute specifies the name of the class as it is referenced from CQL. This is a user-friendly identifier for the class that can be used within CQL as an alternative way to reference the class. + + + + + Specifies a short description of the class + + + + + Provides a complete, detailed, markdown-capable definition of the class + + + + + Provides markdown-capable additional comments on the use of the class + + + + + Specifies the name of the type in the underlying representation. + + + + + The retrievable attribute specifies whether the class can be used within a retrieve statement. This flag is intended to allow the implementation to control whether or not the class can be used as a data access point for the data model. + + + + + The primaryCodePath attribute specifies the path relative to the class that should be used to perform code filtering when a retrieve does not specify a code path. + + + + + The primaryValueSetPath attribute specifies the path relative to the class that should be used to perform alternative value set matching when source data does not have a code defined. + + + + + + + + + + + + + + + + + Namespace is the namespace of the type. This is typically just the name of the model, but can contain additional qualifiers. + + + + + Name is the unqualified name of the type within this model. + + + + + Specifies the name of the type in the underlying representation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is deprecated. New implementations should use the new elementTypeSpecifier element. + + + + + + + + This attribute is deprecated. New implementations should use the new elementType attribute. + + + + + + + Indicates that the starting index for a list-valued element is one. By default, lists are zero-based. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is deprecated. New implementations should use the new choice element. + + + + + + + + + + + Specifies the globally unique url for the model, this is equivalent to the url element of the referenced model info. + + + + + + + + + + + + + This attribute is deprecated. New implementations should use the new namespace attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A type which is generic class parameter such as T in MyGeneric<T extends + SomeType>. + + + + + + + + + + + A type which is replacing a class parameter such as T in MyClass extends MyGeneric<AValidType>. + + + + + + + + + The name of the parameter that is bound to a valid type based on the parameter + definition, such as 'T'. + + + + + + The type bound to the parameter (e.g., 'T'). + + + + + + + + A generic class parameter such as T in MyGeneric<T extends SomeType>. + + + + + + + + The name of the parameter such as T,K, etc... + + + + + One of NONE, CLASS, VALUE, TUPLE, INTERVAL, CHOICE, TYPE + + + + + The type this parameter should be assignable from (i.e., extend). + + + + + + TupleTypeSpecifierElement defines the name and type of a single element within a TupleTypeSpecifier. + + + + + + + + + TupleTypeSpecifier defines the possible elements of a tuple. + + + + + + + + + + diff --git a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2.cs b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2.cs index 8d9f84dcb..5112af5df 100644 --- a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2.cs +++ b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2.cs @@ -2,9 +2,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // -using System.Diagnostics; using System.IO; using Microsoft.Health.Fhir.SpecManager.Manager; +using Ncqa.Cql.Model; namespace Microsoft.Health.Fhir.SpecManager.Language { @@ -247,6 +247,8 @@ public sealed class CSharpFirely2 : ILanguage ["http://hl7.org/fhir/ValueSet/fhir-types"] = "FHIRAllTypes" }; + private record SinceVersion(FhirPackageCommon.FhirSequenceEnum Since); + private readonly Dictionary _sinceAttributes = new() { ["Meta.source"] = "R4", @@ -396,8 +398,13 @@ private enum GenSubset { { "subset", "Which subset of language exports to make (base|conformance|satellite). Default is satellite." }, { "w5", "If output should include 5 W's mappings (true|false). Default is true." }, + { "cqlmodel", "Name of the Cql model for which metadata attributes should be added to the pocos. 'Fhir401' is the only valid value at the moment." } }; + /// If a Cql ModelInfo is available, this will be the parsed XML model file. + private ModelInfo _cqlModelInfo = null; + private IDictionary _cqlModelClassInfo = null; + /// Export the passed FHIR version into the specified directory. /// The information. /// Information describing the server. @@ -458,6 +465,12 @@ void ILanguage.Export( Directory.CreateDirectory(Path.Combine(exportDirectory, "Generated")); } + if (options.LanguageOptions.TryGetValue("cqlmodel", out string cqlmodelResourceKey)) + { + _cqlModelInfo = CqlModels.LoadEmbeddedResource(cqlmodelResourceKey); + _cqlModelClassInfo = CqlModels.ClassesByName(_cqlModelInfo); + } + var allPrimitives = new Dictionary(); var allComplexTypes = new Dictionary(); var allResources = new Dictionary(); @@ -1166,6 +1179,8 @@ private void WriteComponent( _writer.WriteLineIndented($"[FhirType({fhirTypeConstructor})]"); } + var isPatientClass = false; + if (complex.BaseTypeName == "Quantity") { // Constrained quantities are handled differently @@ -1174,9 +1189,31 @@ private void WriteComponent( } string abstractFlag = isAbstract ? " abstract" : string.Empty; - List interfaces = new List(); + if (_cqlModelInfo is not null && _cqlModelInfo.patientClassName is not null) + { + // Just skip the model alias, I am currently not bothered enough to be more precise + var className = _cqlModelInfo.patientClassName.Split('.')[1]; + isPatientClass = complex.Name == className; + } + + if (isPatientClass) interfaces.Add($"{Namespace}.IPatient"); + + var identifierElement = isResource ? complex.Elements.SingleOrDefault(k => isIdentifierProperty(k.Value)).Value : null; + if (identifierElement is not null) + { + if (identifierElement.IsArray) + interfaces.Add("IIdentifiable>"); + else + interfaces.Add("IIdentifiable"); + } + + var primaryCodeElementInfo = isResource ? getPrimaryCodedElementInfo(complex, exportName) : null; + + if (primaryCodeElementInfo is not null) + interfaces.Add($"ICoded<{primaryCodeElementInfo.PropertyType}>"); + string modifierElementName = complex.Elements.Keys.SingleOrDefault(k => k.EndsWith(".modifierExtension", StringComparison.InvariantCulture)); if (modifierElementName != null) { @@ -1242,6 +1279,34 @@ private void WriteComponent( WriteElements(complex, exportName, ref exportedElements, subset); + if (identifierElement is not null) + { + if (identifierElement.IsArray) + _writer.WriteLineIndented("List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; }"); + else + _writer.WriteLineIndented("Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; }"); + + _writer.WriteLine(string.Empty); + } + + if (primaryCodeElementInfo is not null) + { + _writer.WriteLineIndented($"{primaryCodeElementInfo.PropertyType} ICoded<{primaryCodeElementInfo.PropertyType}>.Code {{ get => {primaryCodeElementInfo.PropertyName}; set => {primaryCodeElementInfo.PropertyName} = value; }}"); + _writer.WriteLineIndented($"IEnumerable ICoded.ToCodings() => {primaryCodeElementInfo.PropertyName}.ToCodings();"); + _writer.WriteLine(string.Empty); + } + + if (isPatientClass) + { + var birthdayProperty = exportedElements.SingleOrDefault(ee => ee.FhirElementName + ".value" == _cqlModelInfo?.patientBirthDatePropertyName); + + if (birthdayProperty is not null) + { + _writer.WriteLineIndented($"Hl7.Fhir.Model.Date {Namespace}.IPatient.BirthDate => {birthdayProperty.PropertyName};"); + _writer.WriteLine(string.Empty); + } + } + WriteCopyTo(exportName, exportedElements); if (!isAbstract) @@ -1258,6 +1323,30 @@ private void WriteComponent( // close class CloseScope(); + + WrittenElementInfo getPrimaryCodedElementInfo(FhirComplex complex, string exportName) + { + var primaryCodePath = _cqlModelClassInfo?.TryGetValue(complex.Name, out var classInfo) == true && !string.IsNullOrEmpty(classInfo.primaryCodePath) ? + (complex.Name + "." + classInfo.primaryCodePath) : null; + + var elem = primaryCodePath is not null ? (tryFindElementInComplex(complex, primaryCodePath, out var e) ? e : null) : null; + var primaryCodeElementInfo = elem is not null ? BuildElementInfo(exportName, elem) : null; + + if (primaryCodePath is not null && primaryCodeElementInfo is null) + { + Console.WriteLine($"Warning: Cannot locate primary code path {primaryCodePath}, so no ICoded was added to this type's signature."); + } + + return primaryCodeElementInfo; + } + } + + private bool tryFindElementInComplex(FhirComplex cplx, string name, out FhirElement elem) + { + if (cplx.Elements.TryGetValue(name, out elem)) return true; + if (cplx.Elements.TryGetValue(name + "[x]", out elem)) return true; + + return false; } private string DetermineExportedBaseTypeName(string baseTypeName) @@ -1293,7 +1382,7 @@ private void WriteIDictionarySupport(IEnumerable exportedEle } - private string NullCheck(WrittenElementInfo info) => info.ExportedName + (!info.IsList ? " is not null" : "?.Any() == true"); + private string NullCheck(WrittenElementInfo info) => info.PropertyName + (!info.IsList ? " is not null" : "?.Any() == true"); private void WriteDictionaryPairs(IEnumerable exportedElements) { @@ -1310,7 +1399,7 @@ private void WriteDictionaryPairs(IEnumerable exportedElemen { string elementProp = $"\"{info.FhirElementName}\""; _writer.WriteLineIndented($"if ({NullCheck(info)}) yield return new " + - $"KeyValuePair({elementProp},{info.ExportedName});"); + $"KeyValuePair({elementProp},{info.PropertyName});"); } CloseScope(); @@ -1336,7 +1425,7 @@ private void WriteDictionaryTryGetValue(IEnumerable exported _writer.WriteLineIndented($"case \"{info.FhirElementName}\":"); _writer.IncreaseIndent(); - _writer.WriteLineIndented($"value = {info.ExportedName};"); + _writer.WriteLineIndented($"value = {info.PropertyName};"); _writer.WriteLineIndented($"return {NullCheck(info)};"); _writer.DecreaseIndent(); @@ -1375,7 +1464,7 @@ private void WriteNamedChildren( if (info.IsList) { _writer.WriteLineIndented( - $"foreach (var elem in {info.ExportedName})" + + $"foreach (var elem in {info.PropertyName})" + $" {{ if (elem != null)" + $" yield return new ElementValue(\"{info.FhirElementName}\", elem);" + $" }}"); @@ -1383,8 +1472,8 @@ private void WriteNamedChildren( else { _writer.WriteLineIndented( - $"if ({info.ExportedName} != null)" + - $" yield return new ElementValue(\"{info.FhirElementName}\", {info.ExportedName});"); + $"if ({info.PropertyName} != null)" + + $" yield return new ElementValue(\"{info.FhirElementName}\", {info.PropertyName});"); } } @@ -1409,14 +1498,14 @@ private void WriteChildren( if (info.IsList) { _writer.WriteLineIndented( - $"foreach (var elem in {info.ExportedName})" + + $"foreach (var elem in {info.PropertyName})" + $" {{ if (elem != null) yield return elem; }}"); } else { _writer.WriteLineIndented( - $"if ({info.ExportedName} != null)" + - $" yield return {info.ExportedName};"); + $"if ({info.PropertyName} != null)" + + $" yield return {info.PropertyName};"); } } @@ -1442,7 +1531,7 @@ private void WriteMatches( foreach (WrittenElementInfo info in exportedElements) { _writer.WriteLineIndented( - $"if( !DeepComparable.Matches({info.ExportedName}, otherT.{info.ExportedName}))" + + $"if( !DeepComparable.Matches({info.PropertyName}, otherT.{info.PropertyName}))" + $" return false;"); } @@ -1469,7 +1558,7 @@ private void WriteIsExactly( foreach (WrittenElementInfo info in exportedElements) { _writer.WriteLineIndented( - $"if( !DeepComparable.IsExactly({info.ExportedName}, otherT.{info.ExportedName}))" + + $"if( !DeepComparable.IsExactly({info.PropertyName}, otherT.{info.PropertyName}))" + $" return false;"); } @@ -1505,14 +1594,14 @@ private void WriteCopyTo( if (info.IsList) { _writer.WriteLineIndented( - $"if({info.ExportedName} != null)" + - $" dest.{info.ExportedName} = new {info.ExportedType}({info.ExportedName}.DeepCopy());"); + $"if({info.PropertyName} != null)" + + $" dest.{info.PropertyName} = new {info.PropertyType}({info.PropertyName}.DeepCopy());"); } else { _writer.WriteLineIndented( - $"if({info.ExportedName} != null)" + - $" dest.{info.ExportedName} = ({info.ExportedType}){info.ExportedName}.DeepCopy();"); + $"if({info.PropertyName} != null)" + + $" dest.{info.PropertyName} = ({info.PropertyType}){info.PropertyName}.DeepCopy();"); } } @@ -1598,14 +1687,16 @@ private void WriteBackboneComponent( } // end of repair - string componentName = parentExportName + "#" + (string.IsNullOrEmpty(explicitName) ? + string explicitNamePart = string.IsNullOrEmpty(explicitName) ? complex.NameForExport(FhirTypeBase.NamingConvention.PascalCase) : - explicitName); - - Debug.Assert(!string.IsNullOrEmpty(componentName), $"Found a type at element {complex.Path} without a name or explicit name."); + explicitName; + string componentName = parentExportName + "#" + explicitNamePart; WriteSerializable(); _writer.WriteLineIndented($"[FhirType(\"{componentName}\", IsNestedType=true)]"); + + _writer.WriteLineIndented($"[BackboneType(\"{complex.Path}\")]"); + _writer.WriteLineIndented( $"public partial class" + $" {exportName}" + @@ -1760,7 +1851,9 @@ private void WriteEnum( $"(systems: {vs.ReferencedCodeSystems.Count})"); } - _writer.WriteLineIndented($"[FhirEnumeration(\"{name}\")]"); + var defaultSystem = GetDefaultCodeSystem(vs.Concepts); + + _writer.WriteLineIndented($"[FhirEnumeration(\"{name}\", \"{vs.URL}\", \"{defaultSystem}\")]"); _writer.WriteLineIndented($"public enum {nameSanitized}"); @@ -1785,7 +1878,10 @@ private void WriteEnum( string display = FhirUtils.SanitizeForValue(concept.Display); - _writer.WriteLineIndented($"[EnumLiteral(\"{codeValue}\", \"{concept.System}\"), Description(\"{display}\")]"); + if (concept.System != defaultSystem) + _writer.WriteLineIndented($"[EnumLiteral(\"{codeValue}\", \"{concept.System}\"), Description(\"{display}\")]"); + else + _writer.WriteLineIndented($"[EnumLiteral(\"{codeValue}\"), Description(\"{display}\")]"); if (usedLiterals.Contains(codeName)) { @@ -1819,6 +1915,14 @@ private void WriteEnum( }); } + private static string GetDefaultCodeSystem(List concepts) + { + return concepts.Select(c => c.System) + .GroupBy(c => c) + .OrderByDescending(c => c.Count()) + .First().Key; + } + /// Convert enum value - see Template-Model.tt#2061. /// The name. /// The enum converted value. @@ -1828,6 +1932,17 @@ private void WriteEnum( /// The element. private static int GetOrder(FhirElement element) => CSharpFirelyCommon.GetOrder(element); + + /// + /// Determines whether this element qualifies as an identifying element. + /// + /// + /// + private static bool isIdentifierProperty(FhirElement element) + { + return element.Name == "identifier" && element.ElementTypes.Count == 1 && element.ElementTypes.Values.First().Name == "Identifier"; + } + /// Writes the elements. /// The complex data type. /// Name of the exported complex parent. @@ -1839,31 +1954,12 @@ private void WriteElements( ref List exportedElements, GenSubset subset) { - foreach (FhirElement element in complex.Elements.Values.OrderBy(e => e.FieldOrder)) - { - if (element.IsInherited) - { - continue; - } - - string typeName = element.BaseTypeName; - - if (string.IsNullOrEmpty(typeName) && - (element.ElementTypes.Count == 1)) - { - typeName = element.ElementTypes.Values.First().Name; - } - - // if (!string.IsNullOrEmpty(element.ValueSet)) - if (typeName == "code") - { - WriteCodedElement( - element, - ref exportedElements, - subset); - continue; - } + var elementsToGenerate = complex.Elements.Values + .Where(e => !e.IsInherited) + .OrderBy(e => e.FieldOrder); + foreach (FhirElement element in elementsToGenerate) + { WriteElement( exportedComplexName, element, @@ -1872,14 +1968,7 @@ private void WriteElements( } } - /// Writes an element. - /// The element. - /// [in,out] The exported elements. - /// - private void WriteCodedElement( - FhirElement element, - ref List exportedElements, - GenSubset subset) + private WrittenElementInfo BuildCodedElementInfo(FhirElement element) { bool hasDefinedEnum = true; @@ -1893,83 +1982,10 @@ private void WriteCodedElement( vs = null; } - string pascal = FhirUtils.ToConvention(element.Name, string.Empty, FhirTypeBase.NamingConvention.PascalCase); - - BuildElementOptionals( - element, - subset, - out string summary, - out string isModifier, - out string choice, - out string allowedTypes, - out string resourceReferences); - - string fiveWs = string.Empty; - - if (_exportFiveWs) - { - if (!string.IsNullOrEmpty(element.FiveWs)) - { - fiveWs = $", FiveWs=\"{element.FiveWs}\""; - } - } - - /* Exceptions: - * o OperationOutcome.issue.severity does not have `IsModifier` anymore since R4. - */ - if (element.Path == "OperationOutcome.issue.severity") - { - WriteIndentedComment(element.ShortDescription); - _writer.WriteLineIndented($"[FhirElement(\"{element.Name}\"{summary}, IsModifier=true, Order={GetOrder(element)}{choice}{fiveWs})]"); - _writer.WriteLineIndented($"[FhirElement(\"{element.Name}\"{summary}, Order={GetOrder(element)}{choice}{fiveWs}, Since=FhirRelease.R4)]"); - } - else if (_sinceAttributes.TryGetValue(element.Path, out string since)) - { - BuildFhirElementAttribute(element.Name, element.ShortDescription, summary, isModifier, element, choice, fiveWs, since: since); - } - else if (_untilAttributes.TryGetValue(element.Path, out (string, string) until)) - { - BuildFhirElementAttribute(element.Name, element.ShortDescription, summary, isModifier, element, choice, fiveWs, until: until); - } - else - { - BuildFhirElementAttribute(element.Name, element.ShortDescription, summary, isModifier, element, choice, fiveWs); - } - - if (hasDefinedEnum) - { - _writer.WriteLineIndented("[DeclaredType(Type = typeof(Code))]"); - } - - if (!string.IsNullOrEmpty(resourceReferences)) - { - _writer.WriteLineIndented("[CLSCompliant(false)]"); - _writer.WriteLineIndented(resourceReferences); - } - - // Generate the [AllowedTypes] attribute, except when we are generating an element for the - // open datatypes in base, since this list contains classes that we have not yet moved to the base subset. - bool isOpenTypeInBaseSubset = (subset.HasFlag(GenSubset.Base) || subset.HasFlag(GenSubset.Conformance)) && element.ElementTypes.Count > 25; - if (!string.IsNullOrEmpty(allowedTypes) && !isOpenTypeInBaseSubset) - { - _writer.WriteLineIndented("[CLSCompliant(false)]"); - _writer.WriteLineIndented(allowedTypes); - } - - if ((element.CardinalityMin != 0) || - (element.CardinalityMax != 1)) - { - _writer.WriteLineIndented($"[Cardinality(Min={element.CardinalityMin},Max={element.CardinalityMax})]"); - } - - _writer.WriteLineIndented("[DataMember]"); - - string namespacedCodeLiteral; string codeLiteral; string enumClass; string optional; - - string matchTrailer = string.Empty; + string pascal = FhirUtils.ToConvention(element.Name, string.Empty, FhirTypeBase.NamingConvention.PascalCase); if (hasDefinedEnum) { @@ -1979,20 +1995,17 @@ private void WriteCodedElement( if (string.IsNullOrEmpty(vsClass)) { codeLiteral = $"Code<{Namespace}.{vsName}>"; - namespacedCodeLiteral = $"{Namespace}.Code<{Namespace}.{vsName}>"; enumClass = $"{Namespace}.{vsName}"; } else { codeLiteral = $"Code<{Namespace}.{vsClass}.{vsName}>"; - namespacedCodeLiteral = $"{Namespace}.Code<{Namespace}.{vsClass}.{vsName}>"; enumClass = $"{Namespace}.{vsClass}.{vsName}"; if (vsName.ToUpperInvariant() == pascal.ToUpperInvariant()) { throw new InvalidOperationException($"Using the name '{pascal}' for the property would lead to a compiler error. " + $"Change the name of the valueset '{vs.URL}' by adapting the _enumNamesOverride variable in the generator and rerun."); - //matchTrailer = "_"; } } @@ -2001,128 +2014,32 @@ private void WriteCodedElement( else { codeLiteral = $"{Namespace}.Code"; - namespacedCodeLiteral = $"{Namespace}.Code"; enumClass = "string"; optional = string.Empty; } - if (element.CardinalityMax == 1) - { - exportedElements.Add( - new WrittenElementInfo() - { - FhirElementName = element.Name.Replace("[x]", string.Empty), - ExportedName = $"{pascal}{matchTrailer}Element", - ExportedType = codeLiteral, - IsList = false, - IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), - }); - _writer.WriteLineIndented($"public {codeLiteral} {pascal}{matchTrailer}Element"); + bool isList = element.CardinalityMax != 1; - OpenScope(); - _writer.WriteLineIndented($"get {{ return _{pascal}{matchTrailer}Element; }}"); - _writer.WriteLineIndented($"set {{ _{pascal}{matchTrailer}Element = value; OnPropertyChanged(\"{pascal}{matchTrailer}Element\"); }}"); - CloseScope(); - - _writer.WriteLineIndented($"private {codeLiteral} _{pascal}{matchTrailer}Element;"); - _writer.WriteLine(string.Empty); - } - else - { - exportedElements.Add( - new WrittenElementInfo() - { - FhirElementName = element.Name.Replace("[x]", string.Empty), - ExportedName = $"{pascal}{matchTrailer}Element", - ExportedType = $"List<{codeLiteral}>", - IsList = true, - IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), - }); - - _writer.WriteLineIndented($"public List<{codeLiteral}> {pascal}{matchTrailer}Element"); - - OpenScope(); - _writer.WriteLineIndented($"get {{ if(_{pascal}{matchTrailer}Element==null) _{pascal}{matchTrailer}Element = new List<{namespacedCodeLiteral}>(); return _{pascal}{matchTrailer}Element; }}"); - _writer.WriteLineIndented($"set {{ _{pascal}{matchTrailer}Element = value; OnPropertyChanged(\"{pascal}{matchTrailer}Element\"); }}"); - CloseScope(); - - _writer.WriteLineIndented($"private List<{codeLiteral}> _{pascal}{matchTrailer}Element;"); - _writer.WriteLine(string.Empty); - } - - WriteIndentedComment(element.ShortDescription); - _writer.WriteLineIndented($"/// This uses the native .NET datatype, rather than the FHIR equivalent"); - - _writer.WriteLineIndented("[IgnoreDataMember]"); - - if (element.CardinalityMax == 1) - { - _writer.WriteLineIndented($"public {enumClass}{optional} {pascal}{matchTrailer}"); - - OpenScope(); - _writer.WriteLineIndented($"get {{ return {pascal}{matchTrailer}Element != null ? {pascal}{matchTrailer}Element.Value : null; }}"); - _writer.WriteLineIndented("set"); - OpenScope(); - - // T4 template has some HasValue checks - compiler will replace and this is simpler - _writer.WriteLineIndented($"if (value == null)"); - - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}{matchTrailer}Element = null;"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented("else"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}{matchTrailer}Element = new {codeLiteral}(value);"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented($"OnPropertyChanged(\"{pascal}{matchTrailer}\");"); - CloseScope(suppressNewline: true); - CloseScope(); - } - else + var ei = new WrittenElementInfo() { - _writer.WriteLineIndented($"public IEnumerable<{enumClass}{optional}> {pascal}{matchTrailer}"); - - OpenScope(); - _writer.WriteLineIndented($"get {{ return {pascal}{matchTrailer}Element != null ? {pascal}{matchTrailer}Element.Select(elem => elem.Value) : null; }}"); - _writer.WriteLineIndented("set"); - OpenScope(); - - _writer.WriteLineIndented($"if (value == null)"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}{matchTrailer}Element = null;"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented("else"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}{matchTrailer}Element = new List<{namespacedCodeLiteral}>(value.Select(elem=>new {namespacedCodeLiteral}(elem)));"); - _writer.DecreaseIndent(); + FhirElementName = element.Name.Replace("[x]", string.Empty), + PropertyName = $"{pascal}Element", + PropertyType = isList ? $"List<{codeLiteral}>" : codeLiteral, + ElementType = codeLiteral, + IsList = isList, + IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), + PrimitiveHelperName = pascal, + PrimitiveHelperType = $"{enumClass}{optional}", + IsPrimitive = true, // All coded elements are either Code or Code - so primitives + IsCodedEnum = hasDefinedEnum + }; - _writer.WriteLineIndented($"OnPropertyChanged(\"{pascal}{matchTrailer}\");"); - CloseScope(suppressNewline: true); - CloseScope(); - } + return ei; } - private void BuildFhirElementAttribute(string name, string shortDescription, string summary, string isModifier, FhirElement element, string choice, string fiveWs, string since = null, (string, string)? until = null) + private void BuildFhirElementAttribute(string name, string summary, string isModifier, FhirElement element, string choice, string fiveWs, string since = null, (string, string)? until = null) { - var description = - (since, until, shortDescription) switch - { - (_, _, null) => null, - (not null, _, _) => shortDescription + - $". Note: Element was introduced in {since}, do not use when working with older releases.", - (_, (var release, ""), _) => shortDescription + - $". Note: Element is deprecated since {release}, do not use with {release} and newer releases.", - (_, (var release, var replacedBy), _) => shortDescription + - $". Note: Element is replaced by '{replacedBy}' since {release}. Do not use this element '{name}' with {release} and newer releases.", - _ => shortDescription - }; - - if (description is not null) - { - WriteIndentedComment(description); - } - string attributeText = $"[FhirElement(\"{name}\"{summary}{isModifier}, Order={GetOrder(element)}{choice}{fiveWs}"; if (since is { }) { @@ -2149,14 +2066,10 @@ private void WriteElement( ref List exportedElements, GenSubset subset) { - string name = element.Name; + string name = element.Name.Replace("[x]", string.Empty); - if (name.Contains("[x]")) - { - name = name.Replace("[x]", string.Empty); - } - - string pascal = FhirUtils.ToConvention(name, string.Empty, FhirTypeBase.NamingConvention.PascalCase); + WrittenElementInfo ei = BuildElementInfo(exportedComplexName, element); + exportedElements.Add(ei); BuildElementOptionals( element, @@ -2177,12 +2090,8 @@ private void WriteElement( } } - /* Exceptions: - * o Meta.source only exists since R5. - * o Meta.profile has changed types from `uri` to `canonical`, but we stick to Uri across releases. - * - * If we start to include more classes like this, we might need to - * automate this, by scanning differences between 3/4/5/6/7 etc.. */ + var since = _sinceAttributes.TryGetValue(element.Path, out string s) ? s : null; + var until = _untilAttributes.TryGetValue(element.Path, out (string, string) u) ? u : default((string, string)?); var description = element.Path switch { @@ -2190,40 +2099,38 @@ private void WriteElement( "Signature.onBehalfOf" => element.ShortDescription + ".\nNote: Since R4 the type of this element should be a fixed type (ResourceReference). For backwards compatibility it remains of type DataType.", "Signature.when" => element.ShortDescription + ".\nNote: Since R5 the cardinality is expanded to 0..1 (previous it was 1..1).", "Signature.type" => element.ShortDescription + ".\nNote: Since R5 the cardinality is expanded to 0..* (previous it was 1..*).", - _ => element.ShortDescription + _ => attributeDescriptionWithSinceInfo(name, element.ShortDescription, since, until) }; - if (_sinceAttributes.TryGetValue(element.Path, out string since)) + if (description is not null) WriteIndentedComment(description); + + if (element.Path == "OperationOutcome.issue.severity") { - if (element.Path is "Signature.who" or "Signature.onBehalfOf") - { - BuildFhirElementAttribute(name, description, summary, isModifier, element, ", Choice = ChoiceType.DatatypeChoice", fiveWs); - BuildFhirElementAttribute(name, null, summary, isModifier, element, "", fiveWs, since: since); - _writer.WriteLineIndented($"[DeclaredType(Type = typeof(ResourceReference), Since = FhirRelease.R4)]"); - _writer.WriteLineIndented($"[AllowedTypes(typeof(Hl7.Fhir.Model.FhirUri), typeof(Hl7.Fhir.Model.ResourceReference))]"); - } - else - { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs, since: since); - } + BuildFhirElementAttribute(name, summary, ", IsModifier=true", element, choice, fiveWs); + BuildFhirElementAttribute(name, summary, null, element, choice, fiveWs, since: "R4"); } - else if (_untilAttributes.TryGetValue(element.Path, out (string, string) until)) + else if (element.Path is "Signature.who" or "Signature.onBehalfOf") { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs, until: until); + BuildFhirElementAttribute(name, summary, isModifier, element, ", Choice = ChoiceType.DatatypeChoice", fiveWs); + BuildFhirElementAttribute(name, summary, isModifier, element, "", fiveWs, since: since); + _writer.WriteLineIndented($"[DeclaredType(Type = typeof(ResourceReference), Since = FhirRelease.R4)]"); + _writer.WriteLineIndented($"[AllowedTypes(typeof(Hl7.Fhir.Model.FhirUri), typeof(Hl7.Fhir.Model.ResourceReference))]"); } - else if (element.Path == "Meta.profile") + else + { + BuildFhirElementAttribute(name, summary, isModifier, element, choice, fiveWs, since, until); + } + + if (element.Path == "Meta.profile") { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(Canonical), Since = FhirRelease.R4)]"); } else if (element.Path == "Bundle.link.relation") { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(Code), Since = FhirRelease.R5)]"); } else if (element.Path == "Attachment.size") { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(UnsignedInt), Since = FhirRelease.STU3)]"); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(Integer64), Since = FhirRelease.R5)]"); } @@ -2233,13 +2140,18 @@ private void WriteElement( "ElementDefinition.mapping.comment" or "CapabilityStatement.implementation.description") { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(FhirString))]"); _writer.WriteLineIndented($"[DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]"); } - else + + if (ei.IsCodedEnum) { - BuildFhirElementAttribute(name, description, summary, isModifier, element, choice, fiveWs); + _writer.WriteLineIndented("[DeclaredType(Type = typeof(Code))]"); + } + + if (!string.IsNullOrEmpty(element.BindingName)) + { + _writer.WriteLineIndented($"[Binding(\"{element.BindingName}\")]"); } // Generate the [AllowedTypes] and [ResourceReference] attributes, except when we are @@ -2264,7 +2176,6 @@ private void WriteElement( else { _writer.WriteLineIndented(resourceReferences); - } } @@ -2279,7 +2190,28 @@ private void WriteElement( _writer.WriteLineIndented($"[Cardinality(Min={element.CardinalityMin},Max={element.CardinalityMax})]"); } + writeElementGettersAndSetters(element, ei); + } + + private string attributeDescriptionWithSinceInfo(string name, string baseDescription, string since = null, (string, string)? until = null) + { + return (since, until, baseDescription) switch + { + (_, _, null) => null, + (not null, _, _) => baseDescription + + $". Note: Element was introduced in {since}, do not use when working with older releases.", + (_, (var release, ""), _) when until is not null => baseDescription + + $". Note: Element is deprecated since {release}, do not use with {release} and newer releases.", + (_, (var release, var replacedBy), _) when until is not null => baseDescription + + $". Note: Element is replaced by '{replacedBy}' since {release}. Do not use this element '{name}' with {release} and newer releases.", + _ => baseDescription + }; + } + + private WrittenElementInfo BuildElementInfo(string exportedComplexName, FhirElement element) + { string type; + var name = element.Name.Replace("[x]", string.Empty); if (!string.IsNullOrEmpty(element.BaseTypeName)) { @@ -2289,16 +2221,15 @@ private void WriteElement( { type = element.ElementTypes.First().Value.Name; } - else if (!string.IsNullOrEmpty(choice)) - { - type = "DataType"; - } else { - Debug.Fail($"No type can be derived for element {element.Name}"); - type = "object"; + type = "DataType"; } + // Elements of type Code or Code have their own naming/types, so handle those separately. + if (type == "code") + return BuildCodedElementInfo(element); + /* This is an exception - we want to share Meta across different FHIR versions, * so we use the "most common" type to the versions, which * is uri rather than the more specific canonical. */ @@ -2307,9 +2238,7 @@ private void WriteElement( type = "uri"; } - _writer.WriteLineIndented("[DataMember]"); - - bool noElement = true; + bool isPrimitive = false; if (type.Contains('.')) { @@ -2328,21 +2257,13 @@ private void WriteElement( optional = "?"; } - noElement = false; + isPrimitive = true; } else { nativeType = $"{Namespace}.{type}"; } - //if ((_info.FhirSequence < FhirPackageCommon.FhirSequenceEnum.R4) && - // _info.ComplexTypes.ContainsKey(exportedComplexName) && - // (type == "markdown")) - //{ - // nativeType = "string"; - // noElement = false; - //} - if (CSharpFirelyCommon.TypeNameMappings.ContainsKey(type)) { type = CSharpFirelyCommon.TypeNameMappings[type]; @@ -2352,115 +2273,106 @@ private void WriteElement( type = FhirUtils.SanitizedToConvention(type, FhirTypeBase.NamingConvention.PascalCase); } - string elementTag = noElement ? string.Empty : "Element"; + WrittenElementInfo ei; + bool isList = element.CardinalityMax != 1; + string pascal = FhirUtils.ToConvention(name, string.Empty, FhirTypeBase.NamingConvention.PascalCase); - if (element.CardinalityMax == 1) - { - exportedElements.Add( - new WrittenElementInfo() - { - FhirElementName = element.Name.Replace("[x]", string.Empty), - ExportedName = $"{pascal}{elementTag}", - ExportedType = $"{Namespace}.{type}", - IsList = false, - IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), - }); + ei = new WrittenElementInfo() + { + FhirElementName = name, + PropertyName = isPrimitive ? $"{pascal}Element" : pascal, + PropertyType = isList ? $"List<{Namespace}.{type}>" : $"{Namespace}.{type}", + ElementType = $"{Namespace}.{type}", + IsList = isList, + IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), + IsPrimitive = isPrimitive, + PrimitiveHelperName = isPrimitive ? (pascal == exportedComplexName ? $"{pascal}_" : pascal) : null, // Since properties cannot have the same name as their enclosing types, we'll add a '_' suffix if this happens. + PrimitiveHelperType = isPrimitive ? nativeType + optional : null + }; + return ei; + } - _writer.WriteLineIndented($"public {Namespace}.{type} {pascal}{elementTag}"); + private void writeElementGettersAndSetters(FhirElement element, WrittenElementInfo ei) + { + _writer.WriteLineIndented("[DataMember]"); + + if (!ei.IsList) + { + _writer.WriteLineIndented($"public {ei.PropertyType} {ei.PropertyName}"); OpenScope(); - _writer.WriteLineIndented($"get {{ return _{pascal}{elementTag}; }}"); - _writer.WriteLineIndented($"set {{ _{pascal}{elementTag} = value; OnPropertyChanged(\"{pascal}{elementTag}\"); }}"); + _writer.WriteLineIndented($"get {{ return _{ei.PropertyName}; }}"); + _writer.WriteLineIndented($"set {{ _{ei.PropertyName} = value; OnPropertyChanged(\"{ei.PropertyName}\"); }}"); CloseScope(); - _writer.WriteLineIndented($"private {Namespace}.{type} _{pascal}{elementTag};"); + _writer.WriteLineIndented($"private {ei.PropertyType} _{ei.PropertyName};"); _writer.WriteLine(string.Empty); } else { - exportedElements.Add( - new WrittenElementInfo() - { - FhirElementName = element.Name.Replace("[x]", string.Empty), - ExportedName = $"{pascal}{elementTag}", - ExportedType = $"List<{Namespace}.{type}>", - IsList = true, - IsChoice = element.Name.Contains("[x]", StringComparison.Ordinal), - }); - - _writer.WriteLineIndented($"public List<{Namespace}.{type}> {pascal}{elementTag}"); + _writer.WriteLineIndented($"public {ei.PropertyType} {ei.PropertyName}"); OpenScope(); - _writer.WriteLineIndented($"get {{ if(_{pascal}{elementTag}==null) _{pascal}{elementTag} = new List<{Namespace}.{type}>(); return _{pascal}{elementTag}; }}"); - _writer.WriteLineIndented($"set {{ _{pascal}{elementTag} = value; OnPropertyChanged(\"{pascal}{elementTag}\"); }}"); + _writer.WriteLineIndented($"get {{ if(_{ei.PropertyName}==null) _{ei.PropertyName} = new {ei.PropertyType}(); return _{ei.PropertyName}; }}"); + _writer.WriteLineIndented($"set {{ _{ei.PropertyName} = value; OnPropertyChanged(\"{ei.PropertyName}\"); }}"); CloseScope(); - _writer.WriteLineIndented($"private List<{Namespace}.{type}> _{pascal}{elementTag};"); + _writer.WriteLineIndented($"private {ei.PropertyType} _{ei.PropertyName};"); _writer.WriteLine(string.Empty); } - if (noElement) - { - // only write the one field - return; - } - - string matchTrailer = string.Empty; - - if (pascal == exportedComplexName) - { - matchTrailer = "_"; - } - - WriteIndentedComment(element.ShortDescription); - _writer.WriteLineIndented($"/// This uses the native .NET datatype, rather than the FHIR equivalent"); - - _writer.WriteLineIndented("[IgnoreDataMember]"); - - if (element.CardinalityMax == 1) - { - _writer.WriteLineIndented($"public {nativeType}{optional} {pascal}{matchTrailer}"); - - OpenScope(); - _writer.WriteLineIndented($"get {{ return {pascal}Element != null ? {pascal}Element.Value : null; }}"); - _writer.WriteLineIndented("set"); - OpenScope(); - - _writer.WriteLineIndented($"if (value == null)"); - - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}Element = null;"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented("else"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}Element = new {Namespace}.{type}(value);"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented($"OnPropertyChanged(\"{pascal}{matchTrailer}\");"); - CloseScope(suppressNewline: true); - CloseScope(); - } - else + if (ei.IsPrimitive) { - _writer.WriteLineIndented($"public IEnumerable<{nativeType}{optional}> {pascal}{matchTrailer}"); - - OpenScope(); - _writer.WriteLineIndented($"get {{ return {pascal}Element != null ? {pascal}Element.Select(elem => elem.Value) : null; }}"); - _writer.WriteLineIndented("set"); - OpenScope(); - - _writer.WriteLineIndented($"if (value == null)"); + WriteIndentedComment(element.ShortDescription); + _writer.WriteLineIndented($"/// This uses the native .NET datatype, rather than the FHIR equivalent"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}Element = null;"); - _writer.DecreaseIndent(); - _writer.WriteLineIndented("else"); - _writer.IncreaseIndent(); - _writer.WriteLineIndented($"{pascal}Element = new List<{Namespace}.{type}>(value.Select(elem=>new {Namespace}.{type}(elem)));"); - _writer.DecreaseIndent(); + _writer.WriteLineIndented("[IgnoreDataMember]"); - _writer.WriteLineIndented($"OnPropertyChanged(\"{pascal}{matchTrailer}\");"); - CloseScope(suppressNewline: true); - CloseScope(); + if (!ei.IsList) + { + _writer.WriteLineIndented($"public {ei.PrimitiveHelperType} {ei.PrimitiveHelperName}"); + + OpenScope(); + _writer.WriteLineIndented($"get {{ return {ei.PropertyName} != null ? {ei.PropertyName}.Value : null; }}"); + _writer.WriteLineIndented("set"); + OpenScope(); + + _writer.WriteLineIndented($"if (value == null)"); + + _writer.IncreaseIndent(); + _writer.WriteLineIndented($"{ei.PropertyName} = null;"); + _writer.DecreaseIndent(); + _writer.WriteLineIndented("else"); + _writer.IncreaseIndent(); + _writer.WriteLineIndented($"{ei.PropertyName} = new {ei.PropertyType}(value);"); + _writer.DecreaseIndent(); + _writer.WriteLineIndented($"OnPropertyChanged(\"{ei.PrimitiveHelperName}\");"); + CloseScope(suppressNewline: true); + CloseScope(); + } + else + { + _writer.WriteLineIndented($"public IEnumerable<{ei.PrimitiveHelperType}> {ei.PrimitiveHelperName}"); + + OpenScope(); + _writer.WriteLineIndented($"get {{ return {ei.PropertyName} != null ? {ei.PropertyName}.Select(elem => elem.Value) : null; }}"); + _writer.WriteLineIndented("set"); + OpenScope(); + + _writer.WriteLineIndented($"if (value == null)"); + + _writer.IncreaseIndent(); + _writer.WriteLineIndented($"{ei.PropertyName} = null;"); + _writer.DecreaseIndent(); + _writer.WriteLineIndented("else"); + _writer.IncreaseIndent(); + _writer.WriteLineIndented($"{ei.PropertyName} = new {ei.PropertyType}(value.Select(elem=>new {ei.ElementType}(elem)));"); + _writer.DecreaseIndent(); + + _writer.WriteLineIndented($"OnPropertyChanged(\"{ei.PrimitiveHelperName}\");"); + CloseScope(suppressNewline: true); + CloseScope(); + } } } @@ -2955,9 +2867,7 @@ private void WriteGenerationComment(ExportStreamWriter writer = null) writer.WriteLineIndented("// "); writer.WriteLineIndented($"// Contents of: {_info.PackageName} version: {_info.VersionString}"); -#if !DEBUG - //writer.WriteLineIndented($"// Generated by {_headerUserName} on {_headerGenerationDateTime}"); -#endif + if ((_options.ExportList != null) && _options.ExportList.Any()) { string restrictions = string.Join("|", _options.ExportList); @@ -3020,7 +2930,7 @@ private void CloseScope(bool includeSemicolon = false, bool suppressNewline = fa /// (Optional) True if is summary, false if not. /// private void WriteIndentedComment(string value, bool isSummary = true, bool singleLine = false) - => CSharpFirelyCommon.WriteIndentedComment(_writer, value, isSummary, singleLine); + => _writer.WriteIndentedComment(value, isSummary, singleLine); /// Adds a set of FhirTypes to a total set of exportable WrittenModelInfos. private static void AddModels( @@ -3067,13 +2977,18 @@ private struct WrittenValueSetInfo } /// Information about the written element. - private struct WrittenElementInfo + private class WrittenElementInfo { internal string FhirElementName; - internal string ExportedName; - internal string ExportedType; + internal string PropertyName; + internal string PropertyType; + internal bool IsPrimitive; + internal string PrimitiveHelperName; + internal string PrimitiveHelperType; internal bool IsList; internal bool IsChoice; + internal string ElementType; + internal bool IsCodedEnum; } /// Information about the written model. diff --git a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2IG.cs b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2IG.cs index f1dc533cd..f5ec0fcfd 100644 --- a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2IG.cs +++ b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirely2IG.cs @@ -2,16 +2,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; using Microsoft.Health.Fhir.SpecManager.Manager; -using Microsoft.Health.Fhir.SpecManager.Models; namespace Microsoft.Health.Fhir.SpecManager.Language { @@ -24,12 +17,6 @@ public sealed class CSharpFirely2IG : ILanguage /// The serialization namespace. private const string _serializationNamespace = "Hl7.Fhir.Serialization"; - /// Name of the header user. - private string _headerUserName; - - /// The header generation date time. - private string _headerGenerationDateTime; - /// FHIR information we are exporting. private FhirVersionInfo _info; @@ -40,10 +27,10 @@ public sealed class CSharpFirely2IG : ILanguage private Dictionary _writtenValueSets = new Dictionary(); /// The written resources. - private Dictionary _writtenModels = new Dictionary(); + private readonly Dictionary _writtenModels = new Dictionary(); /// The written converters. - private List _writtenConverters = new List(); + private readonly List _writtenConverters = new List(); /// The split characters. private static readonly char[] _splitChars = { '|', ' ' }; @@ -61,7 +48,7 @@ public sealed class CSharpFirely2IG : ILanguage private const string _singleFileExportExtension = null; /// Structures to skip generating. - private static HashSet _exclusionSet = new HashSet() + private static readonly HashSet _exclusionSet = new HashSet() { /* Since Base defines its methods abstractly, the pattern for generating it * is sufficiently different from derived classes that it makes sense not @@ -151,7 +138,7 @@ public sealed class CSharpFirely2IG : ILanguage private static readonly Func FhirToCsFilter = wmi => !excludeFromCsToFhir.Contains(wmi.FhirName); private static readonly Func CsToStringFilter = FhirToCsFilter; - private static string[] excludeFromCsToFhir = + private static readonly string[] excludeFromCsToFhir = { "CanonicalResource", "MetadataResource", @@ -173,7 +160,7 @@ public sealed class CSharpFirely2IG : ILanguage "total", }; - private static Dictionary _elementNameReplacementsByPath = new Dictionary() + private static readonly Dictionary _elementNameReplacementsByPath = new Dictionary() { { "Element.id", "ElementId" }, { "Extension.url", "Url" }, @@ -269,9 +256,6 @@ void ILanguage.Export( Directory.CreateDirectory(exportDirectory); } - _headerUserName = Environment.UserName; - _headerGenerationDateTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss", null); - //foreach (FhirPrimitive model in _info.PrimitiveTypes.Values) //{ // WritePrimitiveType(model); diff --git a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirelyCommon.cs b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirelyCommon.cs index 741514954..c3b3ac5aa 100644 --- a/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirelyCommon.cs +++ b/src/Microsoft.Health.Fhir.SpecManager/Language/CSharpFirelyCommon.cs @@ -66,7 +66,7 @@ internal static class CSharpFirelyCommon /// The value. /// (Optional) True if is summary, false if not. /// (Optional) True if this is a short comment using a single line comment prefix. Implies isSummary = false. - public static void WriteIndentedComment(ExportStreamWriter writer, string value, bool isSummary = true, bool singleLine = false) + public static void WriteIndentedComment(this ExportStreamWriter writer, string value, bool isSummary = true, bool singleLine = false) { if (string.IsNullOrEmpty(value)) { diff --git a/src/Microsoft.Health.Fhir.SpecManager/Manager/FhirPackageCommon.cs b/src/Microsoft.Health.Fhir.SpecManager/Manager/FhirPackageCommon.cs index fceae17f7..1d8db3c2b 100644 --- a/src/Microsoft.Health.Fhir.SpecManager/Manager/FhirPackageCommon.cs +++ b/src/Microsoft.Health.Fhir.SpecManager/Manager/FhirPackageCommon.cs @@ -8,7 +8,7 @@ namespace Microsoft.Health.Fhir.SpecManager.Manager; /// Information about the FHIR core package. public static class FhirPackageCommon { - /// Extension URL for JSON type information. + /// Extension URL for JSON type information. public const string UrlJsonType = "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type"; /// Extension URL for XML type information. @@ -63,22 +63,22 @@ public readonly record struct PublishedReleaseInformation( string BallotPrefix = null); /// The FHIR releases. - private static List _fhirReleases = new() + private static readonly List _fhirReleases = new() { new (FhirSequenceEnum.DSTU2, new DateOnly(2015, 10, 24), "1.0.2", "DSTU2 Release with 1 technical errata"), - + new (FhirSequenceEnum.STU3, new DateOnly(2019, 10, 24), "3.0.2", "STU3 Release with 2 technical errata"), - + new (FhirSequenceEnum.R4, new DateOnly(2018, 04, 02), "3.2.0", "R4 Draft for comment / First Candidate Normative Content", "2018Jan"), new (FhirSequenceEnum.R4, new DateOnly(2018, 05, 02), "3.3.0", "R4 Ballot #1 : Mixed Normative/Trial use (First Normative ballot)", "2018May"), new (FhirSequenceEnum.R4, new DateOnly(2018, 08, 21), "3.5.0", "R4 Ballot #2 : Mixed Normative/Trial use (Second Normative ballot + Baltimore Connectathon)", "2018Sep"), new (FhirSequenceEnum.R4, new DateOnly(2018, 11, 09), "3.5a.0", "Special R4 Ballot #3 : Normative Packages for Terminology / Conformance + Observation", "2018Dec"), new (FhirSequenceEnum.R4, new DateOnly(2019, 10, 30), "4.0.1", "R4 Release with 1 technical errata"), - + new (FhirSequenceEnum.R4B, new DateOnly(2021, 03, 11), "4.1.0", "R4B Ballot #1", "2021Mar"), new (FhirSequenceEnum.R4B, new DateOnly(2021, 12, 20), "4.3.0-snapshot1", "R4B January 2022 Connectathon"), new (FhirSequenceEnum.R4B, new DateOnly(2022, 05, 28), "4.3.0", "R4B Release"), - + new (FhirSequenceEnum.R5, new DateOnly(2019, 12, 31), "4.2.0", "R5 Preview #1", "2020Feb"), new (FhirSequenceEnum.R5, new DateOnly(2020, 05, 04), "4.4.0", "R5 Preview #2", "2020May"), new (FhirSequenceEnum.R5, new DateOnly(2020, 08, 20), "4.5.0", "R5 Preview #3", "2020Sep"), @@ -94,22 +94,22 @@ public readonly record struct PublishedReleaseInformation( private static readonly DateOnly _semverUrlChangeDate = new DateOnly(2021, 12, 01); /// The FHIR release by version. - private static Dictionary _fhirReleasesByVersion; + private static readonly Dictionary _fhirReleasesByVersion; /// Gets the FHIR releases. public static List CoreVersions => _fhirReleases; /// The latest version by release. - private static Dictionary _latestVersionByRelease; + private static readonly Dictionary _latestVersionByRelease; /// The package base by release. - private static Dictionary _packageBaseByRelease; + private static readonly Dictionary _packageBaseByRelease; /// List of names of the core packages. - private static Dictionary _corePackagesAndReleases; + private static readonly Dictionary _corePackagesAndReleases; /// Types of resources to process, by FHIR version. - private static Dictionary> _versionResourcesToProcess = new() + private static readonly Dictionary> _versionResourcesToProcess = new() { { FhirSequenceEnum.DSTU2, @@ -176,7 +176,7 @@ public readonly record struct PublishedReleaseInformation( }; /// Types of resources to ignore, by FHIR version. - private static Dictionary> _versionResourcesToIgnore = new() + private static readonly Dictionary> _versionResourcesToIgnore = new() { { FhirSequenceEnum.DSTU2, @@ -228,7 +228,7 @@ public readonly record struct PublishedReleaseInformation( }; /// The version files to ignore. - private static Dictionary> _versionFilesToIgnore = new() + private static readonly Dictionary> _versionFilesToIgnore = new() { { FhirSequenceEnum.DSTU2, @@ -454,26 +454,14 @@ public static string BallotPrefixForVersion(string version) /// Major for release. /// The release. /// The sequence release number for a FHIR release (e.g., 2 for DSTU2). - public static int MajorIntForVersion(FhirSequenceEnum release) + public static int MajorIntForVersion(FhirSequenceEnum release) => release switch { - switch (release) - { - case FhirSequenceEnum.DSTU2: - return 2; - - case FhirSequenceEnum.STU3: - return 3; - - case FhirSequenceEnum.R4: - case FhirSequenceEnum.R4B: - return 4; - - case FhirSequenceEnum.R5: - return 5; - } - - return 0; - } + FhirSequenceEnum.DSTU2 => 2, + FhirSequenceEnum.STU3 => 3, + FhirSequenceEnum.R4 or FhirSequenceEnum.R4B => 4, + FhirSequenceEnum.R5 => 5, + _ => 0, + }; /// Major release for version. /// Thrown when one or more required arguments are diff --git a/src/Microsoft.Health.Fhir.SpecManager/Microsoft.Health.Fhir.SpecManager.csproj b/src/Microsoft.Health.Fhir.SpecManager/Microsoft.Health.Fhir.SpecManager.csproj index 23aa6ee2d..113fad88a 100644 --- a/src/Microsoft.Health.Fhir.SpecManager/Microsoft.Health.Fhir.SpecManager.csproj +++ b/src/Microsoft.Health.Fhir.SpecManager/Microsoft.Health.Fhir.SpecManager.csproj @@ -50,4 +50,10 @@ + + + Fhir401 + + + diff --git a/src/fhir-codegen-cli/Properties/launchSettings.json b/src/fhir-codegen-cli/Properties/launchSettings.json index 68e449e5c..d1c1debbc 100644 --- a/src/fhir-codegen-cli/Properties/launchSettings.json +++ b/src/fhir-codegen-cli/Properties/launchSettings.json @@ -1,114 +1,114 @@ { - "profiles": { - "info-All": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated --include-experimental --language Info", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "info-Rx": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated\\Info_R5.txt --load-r5 latest --include-experimental --language Info", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "tsBasic-All": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --include-experimental --language TypeScript", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "tsBasic-Rx": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated\\TypeScript_R4B.ts --load-r4b latest --include-experimental --language TypeScript", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "csBasic-All": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --include-experimental --language CSharpBasic", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "csBasic-Rx": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated\\CSharpBasic_R3.cs --load-r3 latest --include-experimental --language CSharpBasic", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "GenerateBasics": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --include-experimental --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --language Info|TypeScript|CSharpBasic", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x Base": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.Base\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2|subset=base --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x Conformance": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.Conformance\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2|subset=conformance --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x STU3": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.STU3\\Model --load-r3 3.0.2 --language CSharpFirely2 --language-options CSharpFirely2 --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x R4": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R4\\Model --load-r4 4.0.1 --language CSharpFirely2 --language-options CSharpFirely2 --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x R4B": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R4B\\Model --load-r4b 4.3.0 --language CSharpFirely2 --language-options CSharpFirely2 --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely 5.x R5": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R5\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2 --include-experimental --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "server4-Az": { - "commandName": "Project", - "commandLineArgs": "--fhir-server-url http://fhirdemo5.azurewebsites.net/ --export-keys Patient|Encounter|Observation --language-options OpenApi|OpenApiVersion=2|FileFormat=json|MultiFile=false|SchemaLevel=names|IncludeSearchParams=false|FhirMime=common|PatchMime=json|IncludeHeaders=false|Minify=true --output-path ..\\..\\generated\\ --language OpenApi", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "server4-H": { - "commandName": "Project", - "commandLineArgs": "--fhir-server-url https://hapi.fhir.org/baseR4/ --export-keys Patient --language-options OpenApi|OpenApiVersion=3|FileFormat=yaml|SchemaLevel=none|IncludeSearchParams=true|SingleResponses=true|FhirMime=common --output-path ..\\..\\generated\\OpenApi2-Hapi-Patient.yaml --language OpenApi", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "cyto4": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\cytoscape --load-r4 latest --export-keys Patient|Encounter|Observation --language Cytoscape", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "cs2r4B": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\temp\\cs2r4b --load-r4b latest --language-options CSharp2|namespace=fhirCsR4B --language CSharp2 --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "cs2r5": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\temp\\cs2r5 --load-r5 latest --language-options CSharp2|namespace=fhirCsR5 --language CSharp2 --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "ts-sdk-r4": { - "commandName": "Project", - "commandLineArgs": "--output-path ..\\..\\..\\fhir-typescript\\core\\r4\\src --load-r4 latest --language TypeScriptSdk --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "firelyJsonTest": { - "commandName": "Project", - "commandLineArgs": "--export-types \"primitive|complex|resource\" --output-path ..\\..\\generated\\SystemTextJsonExt_R4\\ --load-r4 latest --language CSharpFirely2JsonExt --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "igTest": { - "commandName": "Project", - "commandLineArgs": "-p hl7.fhir.us.core --output-path ..\\..\\generated\\IG\\ --language Info --official-expansions-only true", - "workingDirectory": "$(MSBuildProjectDirectory)" - }, - "Firely openAPI": { - "commandName": "Project", - "commandLineArgs": "--fhir-server-url http://server.fire.ly/ --resolve-external false --language-options OpenApi|SingleResponses=false|Metadata=true|SchemaLevel=names|MultiFile=true --output-path ..\\..\\generated\\FS-OpenApi-R4 --language OpenApi", - "workingDirectory": "$(MSBuildProjectDirectory)" - } + "profiles": { + "info-All": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated --include-experimental --language Info", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "info-Rx": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated\\Info_R5.txt --load-r5 latest --include-experimental --language Info", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "tsBasic-All": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --include-experimental --language TypeScript", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "tsBasic-Rx": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated\\TypeScript_R4B.ts --load-r4b latest --include-experimental --language TypeScript", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "csBasic-All": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --include-experimental --language CSharpBasic", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "csBasic-Rx": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated\\CSharpBasic_R3.cs --load-r3 latest --include-experimental --language CSharpBasic", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "GenerateBasics": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\generated --load-r2 latest --include-experimental --load-r3 latest --load-r4 latest --load-r4b latest --load-r5 latest --language Info|TypeScript|CSharpBasic", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x Base": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.Base\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2|subset=base|cqlmodel=Fhir401 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x Conformance": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.Conformance\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2|subset=conformance|cqlmodel=Fhir401 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x STU3": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.STU3\\Model --load-r3 3.0.2 --language CSharpFirely2 --language-options CSharpFirely2 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x R4": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R4\\Model --load-r4 4.0.1 --language CSharpFirely2 --language-options CSharpFirely2|cqlmodel=Fhir401 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x R4B": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R4B\\Model --load-r4b 4.3.0 --language CSharpFirely2 --language-options CSharpFirely2 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely 5.x R5": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\firely-net-sdk\\src\\Hl7.Fhir.R5\\Model --load-r5 5.0.0 --language CSharpFirely2 --language-options CSharpFirely2 --include-experimental --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "server4-Az": { + "commandName": "Project", + "commandLineArgs": "--fhir-server-url http://fhirdemo5.azurewebsites.net/ --export-keys Patient|Encounter|Observation --language-options OpenApi|OpenApiVersion=2|FileFormat=json|MultiFile=false|SchemaLevel=names|IncludeSearchParams=false|FhirMime=common|PatchMime=json|IncludeHeaders=false|Minify=true --output-path ..\\..\\generated\\ --language OpenApi", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "server4-H": { + "commandName": "Project", + "commandLineArgs": "--fhir-server-url https://hapi.fhir.org/baseR4/ --export-keys Patient --language-options OpenApi|OpenApiVersion=3|FileFormat=yaml|SchemaLevel=none|IncludeSearchParams=true|SingleResponses=true|FhirMime=common --output-path ..\\..\\generated\\OpenApi2-Hapi-Patient.yaml --language OpenApi", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "cyto4": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\cytoscape --load-r4 latest --export-keys Patient|Encounter|Observation --language Cytoscape", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "cs2r4B": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\temp\\cs2r4b --load-r4b latest --language-options CSharp2|namespace=fhirCsR4B --language CSharp2 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "cs2r5": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\temp\\cs2r5 --load-r5 latest --language-options CSharp2|namespace=fhirCsR5 --language CSharp2 --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "ts-sdk-r4": { + "commandName": "Project", + "commandLineArgs": "--output-path ..\\..\\..\\fhir-typescript\\core\\r4\\src --load-r4 latest --language TypeScriptSdk --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "firelyJsonTest": { + "commandName": "Project", + "commandLineArgs": "--export-types \"primitive|complex|resource\" --output-path ..\\..\\generated\\SystemTextJsonExt_R4\\ --load-r4 latest --language CSharpFirely2JsonExt --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "igTest": { + "commandName": "Project", + "commandLineArgs": "-p hl7.fhir.us.core --output-path ..\\..\\generated\\IG\\ --language Info --official-expansions-only true", + "workingDirectory": "$(MSBuildProjectDirectory)" + }, + "Firely openAPI": { + "commandName": "Project", + "commandLineArgs": "--fhir-server-url http://server.fire.ly/ --resolve-external false --language-options OpenApi|SingleResponses=false|Metadata=true|SchemaLevel=names|MultiFile=true --output-path ..\\..\\generated\\FS-OpenApi-R4 --language OpenApi", + "workingDirectory": "$(MSBuildProjectDirectory)" } -} + } +} \ No newline at end of file