public void UpdateNote(PatientNote note, PatientNoteDetail detail) { // the only properties of the note that can be updated is the ValidRange // and only if it is not already expired if (!note.IsExpired) note.ValidRange.Until = detail.ValidRangeUntil; }
public PatientNote CreateNote(PatientNoteDetail detail, Staff author, IPersistenceContext context) { PatientNoteCategory category = context.Load<PatientNoteCategory>(detail.Category.NoteCategoryRef, EntityLoadFlags.Proxy); PatientNote note = new PatientNote(author, category, detail.Comment); note.ValidRange.Until = detail.ValidRangeUntil; return note; }
/// <summary> /// Adds a <see cref="PatientNote"/> to this patient. /// </summary> /// <remarks> /// Use this method rather than adding to the <see cref="Patient.Notes"/> /// collection directly. /// </remarks> /// <param name="note"></param> public virtual void AddNote(PatientNote note) { if (note.Patient != null) { //NB: technically we should remove the profile from the other patient's collection, but there //seems to be a bug with NHibernate where it deletes the profile if we do this //profile.Patient.Profiles.Remove(profile); } note.Patient = this; _notes.Add(note); }
public PatientNoteDetail CreateNoteDetail(PatientNote note, IPersistenceContext context) { if (note == null) return null; PatientNoteCategoryAssembler categoryAssembler = new PatientNoteCategoryAssembler(); StaffAssembler staffAssembler = new StaffAssembler(); return new PatientNoteDetail( note.GetRef(), note.Comment, categoryAssembler.CreateNoteCategorySummary(note.Category, context), staffAssembler.CreateStaffSummary(note.Author, context), note.CreationTime, note.ValidRange.From, note.ValidRange.Until, note.IsExpired); }