diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index 005f9882..81ffe1f4 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -3146,7 +3146,10 @@ namespace BMA.EHR.Insignia.Service.Controllers var doc = await _documentService.UploadFileAsync(file, file.FileName); insigniaNoteProfile.DocReceiveInsignia = doc; } - var root = _userProfileRepository.GetOc(req.OrgId, 0, AccessToken)?.Root ?? null; + + var orgData = _userProfileRepository.GetOcByNodeId(req.OrgId,0, AccessToken); + var root = orgData?.Root ?? null; + var rootDnaId = orgData?.RootDnaId ?? null; if (req.OrgId != Guid.Parse("00000000-0000-0000-0000-000000000000")) { if (root == null) @@ -3157,6 +3160,7 @@ namespace BMA.EHR.Insignia.Service.Controllers root = "สำนักนายกรัฐมนตรี"; } insigniaNoteProfile.OrgReceiveInsignia = root; + insigniaNoteProfile.RootDnaId = rootDnaId; insigniaNoteProfile.OrgReceiveInsigniaId = req.OrgId; insigniaNoteProfile.DateReceiveInsignia = req.Date; insigniaNoteProfile.LastUpdateFullName = FullName ?? "System Administrator";