using Riok.Mapperly.Abstractions; using Strata.ContinuousImprovement.Biz.ChargeCode.Opportunities; using Strata.ContinuousImprovement.Biz.Configuration; using Strata.ContinuousImprovement.Biz.Shared; using Strata.Schema.Client.Dtos; using System.Collections.Generic; using System.Text.Json; namespace Strata.ContinuousImprovement.JazzEntityFrameworkStub.Generics { [Mapper(UseDeepCloning = true, EnumMappingStrategy = EnumMappingStrategy.ByName, EnumMappingIgnoreCase = true)] public static partial class CCOpportunityMapper { public static CCOpportunityDataModel MapToDataModel(this CCOpportunity src, Configuration configuration) { var mapped = src.MapToDataModel(); mapped.Configuration = configuration; return mapped; } public static CCOpportunityDataModel MapToDataModel(this CCOpportunity src) { var mapped = Mapped(src); if (mapped == null) { return default; } mapped.EncounterGroup = (int)EncounterGroup.CaseType; mapped.CaseTypeJson = JsonSerializer.Serialize(new HierarchyPathsAndMembers { HierarchyPaths = new List(), Members = new List() }); mapped.ClinicalIndicatorJson = JsonSerializer.Serialize(new HierarchyPathsAndMembers { HierarchyPaths = new List(), Members = new List() }); mapped.ChargeCodeJson = JsonSerializer.Serialize(new HierarchyPathsAndMembers { HierarchyPaths = new List(), Members = new List() }); mapped.OpportunityLevelJson = JsonSerializer.Serialize(new HierarchyPathsAndMembers { HierarchyPaths = new List(), Members = new List() }); return mapped; } [MapperIgnoreTarget(nameof(CCOpportunityDataModel.CaseTypeJson))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.CaseTypes))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.ChargeCodeJson))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.ChargeCodes))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.ClinicalIndicatorJson))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.Configuration))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.DateCreated))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.Details))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.EncounterGroup))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.LevelCases))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.OpportunityLevelJson))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.OpportunityLevels))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.OpportunityId))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.OpportunityLevelJson))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.OpportunityId))] [MapperIgnoreTarget(nameof(CCOpportunityDataModel.PatientPopulations))] [MapperIgnoreSource(nameof(CCOpportunity.ChargeCodeGroup))] [MapperIgnoreSource(nameof(CCOpportunity.ChargeCodeGroupValue))] private static partial CCOpportunityDataModel Mapped(CCOpportunity src); } }