示例#1
0
        private ActivityExecutionStatusEvent InitialiseWithFirstExecutionStatus(Activity activity, User currentUser)
        {
            var status      = activity.ExecutionStatuses.OrderBy(es => es.Id).First();
            var statusEvent = new ActivityExecutionStatusEvent()
            {
                ActivityInstance = this,
                Comments         = "",
                EventCreatedBy   = currentUser,
                EventDateTime    = DateTime.Now,
                ExecutionStatus  = status
            };

            return(statusEvent);
        }
示例#2
0
        public Attachment(byte[] content, string description, string fileName, long size, AttachmentType attachmentType, Encounter encounter, Patient patient, ActivityExecutionStatusEvent activityExecutionStatusEvent)
        {
            Archived = false;

            Content          = content;
            Description      = description;
            FileName         = fileName;
            Size             = size;
            AttachmentType   = attachmentType;
            AttachmentTypeId = attachmentType.Id;

            Encounter   = encounter;
            EncounterId = encounter?.Id;

            Patient   = patient;
            PatientId = patient?.Id;

            ActivityExecutionStatusEvent   = activityExecutionStatusEvent;
            ActivityExecutionStatusEventId = activityExecutionStatusEvent?.Id;
        }
示例#3
0
        public ActivityExecutionStatusEvent AddNewEvent(ActivityExecutionStatus newStatus, User currentUser, string comments, DateTime?contextDate, string contextCode)
        {
            if (CurrentStatus.Description == newStatus.Description)
            {
                return(null);
            }
            ;

            var statusEvent = new ActivityExecutionStatusEvent()
            {
                ActivityInstance = this,
                Comments         = comments,
                EventCreatedBy   = currentUser,
                EventDateTime    = DateTime.Now,
                ExecutionStatus  = newStatus,
                ContextCode      = contextCode,
                ContextDateTime  = contextDate
            };

            CurrentStatus = newStatus;
            ExecutionEvents.Add(statusEvent);

            return(statusEvent);
        }