public static CaseNoteResponse ToResponse(CaseNote historicalCaseNote)
 {
     return(new CaseNoteResponse
     {
         RecordId = historicalCaseNote.CaseNoteId,
         PersonId = historicalCaseNote.MosaicId,
         Title = historicalCaseNote.CaseNoteTitle,
         Content = historicalCaseNote.CaseNoteContent,
         DateOfEvent = historicalCaseNote.CreatedOn.ToString("s"),
         OfficerName = historicalCaseNote.CreatedByName,
         OfficerEmail = historicalCaseNote.CreatedByEmail,
         FormName = FormatFormNameForHistoricCaseNote(historicalCaseNote.NoteType)
     });
 }
Beispiel #2
0
 public CaseNoteDTO(CaseNote source, string agentName = "SYSTEM")
     : base(source)
 {
     NoteID          = source.NoteID;
     NoteTypeID      = source.NoteType;
     AgentUserID     = source.CreatedByUserID;
     SubjectUserID   = source.SubjectUserID;
     ProviderID      = source.ProviderID.GetValueOrDefault(0);
     ProgramID       = source.ProgramID.GetValueOrDefault(0);
     JobID           = source.JobID.GetValueOrDefault(0);
     Note            = source.Note;
     AgentName       = agentName;
     SubjectGoalID   = source.SubjectGoalID;
     CreatedByUserID = source.CreatedByUserID;
     VisibleDate     = source.VisibleDate;
 }
        public static BsonDocument HistoricalCaseNotesToDomain(CaseNote note)
        {
            var useNoteTypeForFormName = Environment.GetEnvironmentVariable("SOCIAL_CARE_FIX_HISTORIC_CASE_NOTE_RESPONSE") is ("true");

            return(new BsonDocument(
                       new List <BsonElement>
            {
                new BsonElement("_id", note.CaseNoteId),
                new BsonElement("mosaic_id", note.MosaicId),
                new BsonElement("worker_email", note.CreatedByEmail ?? ""),
                new BsonElement("form_name_overall", "Historical_Case_Note"),
                new BsonElement("form_name", useNoteTypeForFormName ? FormatFormNameForHistoricCaseNote(note.NoteType) : note.CaseNoteTitle),
                new BsonElement("title", note.CaseNoteTitle),
                new BsonElement("timestamp", note.CreatedOn.ToString("dd/MM/yyyy H:mm:ss")), //format used in imported data so have to match for now
                new BsonElement("is_historical", true)                                       //flag for front end
            }
                       ));
        }
Beispiel #4
0
        public void WhenThereAreMatchingRecordsReturnsSpecificInformationAboutTheCaseNote()
        {
            var(caseNote, noteType, caseWorker) = AddCaseNoteWithNoteTypeAndWorkerToDatabase(_personId);

            var expectedCaseNoteInformation = new CaseNote
            {
                MosaicId       = caseNote.PersonId.ToString(),
                CaseNoteId     = caseNote.Id.ToString(),
                NoteType       = noteType.Description,
                CaseNoteTitle  = caseNote.Title,
                CreatedOn      = caseNote.CreatedOn,
                CreatedByName  = $"{caseWorker.FirstNames} {caseWorker.LastNames}",
                CreatedByEmail = caseWorker.EmailAddress
            };

            var response = _historicalDataGateway.GetCaseNotesByPersonId(_personId);

            response.FirstOrDefault().Should().BeEquivalentTo(expectedCaseNoteInformation,
                                                              options =>
            {
                options.Using <DateTime>(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation, 1000)).WhenTypeIs <DateTime>();
                return(options);
            });
        }
Beispiel #5
0
        //// <summary>
        /// 
        /// </summary>
        /// <param name="caseId"></param>
        /// <returns></returns>
        //Get notes for case
        internal List<CaseNote> getWaiverNotesByCaseId(Int64 caseId)
        {
            List<CaseNote> cnList = new List<CaseNote>();
            string title = "VW_NOTES_VIA_CASE_ID";
            //  Int64 caseId = Convert.ToInt64(GetCaseIDviaCTRL(ctrlNum));
            Int64 userID = SpecDutyBase.gv.WW_USERLONG;
            String edipi = "";
            Int64 branchId = 0;
            Int64 relationshipID = 0;
            DataSet singleCaseStatus = GetInfo2(title, caseId, userID, edipi, branchId, relationshipID);
            if (singleCaseStatus != null)
            {
                int count = singleCaseStatus.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    DataRow r = singleCaseStatus.Tables[0].Rows[i];
                    if (r["INTERNAL_ONLY"].ToString().Equals("F") && r["PARENT_ID"] != null)
                    {
                        CaseNote cn = new CaseNote();
                        cn.waiverCaseId = Convert.ToInt64(r["CASE_ID"]);
                        cn.waiverNoteId = Convert.ToInt64(r["NOTE_ID"]);
                        cn.waiverUserId = Convert.ToInt64(r["USER_ID"]);
                        cn.waiverNote = Convert.ToString(r["NOTE"]);
                        cn.waiverUserName = Convert.ToString(r["USER_NAME"]);
                        cn.waiverNoteType = Convert.ToString(r["NOTE_TYPE"]);
                        cn.createDate = Convert.ToDateTime(r["DT_CREATED"]);
                        cn.waiverCaseStatus = Convert.ToString(r["CASE_STATUS"]);
                        cn.waiverBranchId = Convert.ToInt64(r["BRANCH_ID"]);

                       //  cn.waiverParentId = Convert.ToInt64(r["PARENT_ID"]);
                        cn.creatorRoleTitles = Convert.ToString(r["CREATOR_ROLE_TITLES"]);
                        cnList.Add(cn);
                    }
                }
            }

            return cnList;
        }
Beispiel #6
0
        public void EFContextGetsCaseNote()
        {
            CaseNote n = context.CaseNotes.First();

            Assert.IsNotNull(n);
        }