diff --git a/Server/Components/AICore/Context/Entry/Navigation/ServiceRecordContextEntry.cs b/Server/Components/AICore/Context/Entry/Navigation/ServiceRecordContextEntry.cs index 1284a987e..e5adefde1 100644 --- a/Server/Components/AICore/Context/Entry/Navigation/ServiceRecordContextEntry.cs +++ b/Server/Components/AICore/Context/Entry/Navigation/ServiceRecordContextEntry.cs @@ -54,7 +54,10 @@ namespace AICore.Context.Entry.Navigation [JsonPropertyName("Mitarbeiter")] public string Employee { get; set; } - [JsonPropertyName("Ziele")] + [JsonPropertyName("Massnahmen")] public List Goals { get; set; } + + [JsonPropertyName("Ziele")] + public List GoalCategories { get; set; } } } diff --git a/Server/Components/AICore/Context/EntryMapper/Detail/ServiceRecordContextEntryMapper.cs b/Server/Components/AICore/Context/EntryMapper/Detail/ServiceRecordContextEntryMapper.cs index fff1b15ab..be7ba79db 100644 --- a/Server/Components/AICore/Context/EntryMapper/Detail/ServiceRecordContextEntryMapper.cs +++ b/Server/Components/AICore/Context/EntryMapper/Detail/ServiceRecordContextEntryMapper.cs @@ -1,7 +1,9 @@ using System; using System.Linq; using AICore.Context.Entry.Navigation; +using BS.Shared; using BS.Shared.DataContracts; +using BS.Shared.Extensions; namespace AICore.Context.EntryMapper.Detail { @@ -26,10 +28,31 @@ namespace AICore.Context.EntryMapper.Detail pContext.InsUser = pObject.InsUser; pContext.Employee = pObject.Employee.FirstNameLastName; pContext.Goals = new System.Collections.Generic.List(); + pContext.GoalCategories = new System.Collections.Generic.List(); if (pObject.Goals is object && pObject.Goals.Any()) { - pContext.Goals.AddRange(pObject.Goals.Select(x => x.TypeDescription)); + foreach (var goal in pObject.Goals) + { + if(goal.Type == ValueListEntryType.SupportConceptGoalCategoryType + || goal.Type == ValueListEntryType.SupportConceptIndividualGoalCategoryType) + { + // Ziel + + pContext.GoalCategories.Add(goal.TypeDescription); + } + else if (goal.Type == ValueListEntryType.SupportConceptGoalType + || goal.Type == ValueListEntryType.SupportConceptIndividualGoalType) + { + // Massnahme + + pContext.Goals.Add(goal.TypeDescription); + } + else + { + // sonst + } + } } }