Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void ShowNoteDetail(PatientNoteDetail notedetail)
 {
     try
     {
         var caegotryChoices = new List <PatientNoteCategorySummary> {
             notedetail.Category
         };
         var editor = new PatientNoteEditorComponent(notedetail, caegotryChoices, true);
         LaunchAsDialog(this.Host.DesktopWindow, editor, SR.TitleNoteText);
     }
     catch (Exception e)
     {
         // failed to launch editor
         ExceptionHandler.Report(e, this.Host.DesktopWindow);
     }
 }
Ejemplo n.º 4
0
        public PatientNoteEditorComponent(PatientNoteDetail noteDetail, List <PatientNoteCategorySummary> noteCategoryChoices, bool readOnlyMode)
        {
            _readOnlyMode        = readOnlyMode;
            _note                = noteDetail;
            _noteCategoryChoices = noteCategoryChoices;

            _comment    = _note.Comment;
            _expiryDate = _note.ValidRangeUntil == null ? null : (DateTime?)_note.ValidRangeUntil.Value.Date;
            _category   = _note.Category;

            this.Validation.Add(new ValidationRule("ExpiryDate",
                                                   delegate
            {
                var valid = ExpiryDate == null || ExpiryDate > Platform.Time.Date;
                return(new ValidationResult(valid, SR.MessageInvalidExpiryDate));
            }));
        }
Ejemplo n.º 5
0
 public PatientNoteEditorComponent(PatientNoteDetail noteDetail, List <PatientNoteCategorySummary> noteCategoryChoices)
     : this(noteDetail, noteCategoryChoices, false)
 {
 }