Beispiel #1
0
        /// <summary>
        /// Creates procedure detail optionally including specified data.
        /// </summary>
        /// <param name="rp"></param>
        /// <param name="procedureStepFilter"></param>
        /// <param name="includeProtocol"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public ProcedureDetail CreateProcedureDetail(
            Procedure rp,
            Predicate <ProcedureStep> procedureStepFilter,
            bool includeProtocol,
            IPersistenceContext context)
        {
            var detail = new ProcedureDetail
            {
                ProcedureRef         = rp.GetRef(),
                Status               = EnumUtils.GetEnumValueInfo(rp.Status, context),
                Type                 = new ProcedureTypeAssembler().CreateSummary(rp.Type),
                ScheduledStartTime   = rp.ScheduledStartTime,
                SchedulingCode       = EnumUtils.GetEnumValueInfo(rp.SchedulingCode),
                StartTime            = rp.StartTime,
                EndTime              = rp.EndTime,
                CheckInTime          = rp.ProcedureCheckIn.CheckInTime,
                CheckOutTime         = rp.ProcedureCheckIn.CheckOutTime,
                PerformingFacility   = new FacilityAssembler().CreateFacilitySummary(rp.PerformingFacility),
                PerformingDepartment = rp.PerformingDepartment == null ? null : new DepartmentAssembler().CreateSummary(rp.PerformingDepartment, context),
                Laterality           = EnumUtils.GetEnumValueInfo(rp.Laterality, context),
                ImageAvailability    = EnumUtils.GetEnumValueInfo(rp.ImageAvailability, context),
                Portable             = rp.Portable,
                StudyInstanceUid     = rp.StudyInstanceUID
            };

            var includedSteps = CollectionUtils.Select(rp.GetWorkflowHistory(), procedureStepFilter);

            if (includedSteps.Count > 0)
            {
                var procedureStepAssembler = new ProcedureStepAssembler();
                detail.ProcedureSteps = CollectionUtils.Map(
                    includedSteps,
                    (ProcedureStep ps) => procedureStepAssembler.CreateProcedureStepDetail(ps, context));
            }

            // the Protocol may be null, if this procedure has not been protocolled
            if (includeProtocol && rp.ActiveProtocol != null)
            {
                var protocolAssembler = new ProtocolAssembler();
                detail.Protocol = protocolAssembler.CreateProtocolDetail(rp.ActiveProtocol, context);
            }

            return(detail);
        }
		/// <summary>
		/// Creates procedure detail optionally including specified data.
		/// </summary>
		/// <param name="rp"></param>
		/// <param name="procedureStepFilter"></param>
		/// <param name="includeProtocol"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public ProcedureDetail CreateProcedureDetail(
			Procedure rp,
			Predicate<ProcedureStep> procedureStepFilter,
			bool includeProtocol,
			IPersistenceContext context)
		{
			var detail = new ProcedureDetail
							{
								ProcedureRef = rp.GetRef(),
								Status = EnumUtils.GetEnumValueInfo(rp.Status, context),
								Type = new ProcedureTypeAssembler().CreateSummary(rp.Type),
								ScheduledStartTime = rp.ScheduledStartTime,
								SchedulingCode = EnumUtils.GetEnumValueInfo(rp.SchedulingCode),
								StartTime = rp.StartTime,
								EndTime = rp.EndTime,
								CheckInTime = rp.ProcedureCheckIn.CheckInTime,
								CheckOutTime = rp.ProcedureCheckIn.CheckOutTime,
								PerformingFacility = new FacilityAssembler().CreateFacilitySummary(rp.PerformingFacility),
								PerformingDepartment = rp.PerformingDepartment == null ? null : new DepartmentAssembler().CreateSummary(rp.PerformingDepartment, context),
								Laterality = EnumUtils.GetEnumValueInfo(rp.Laterality, context),
								ImageAvailability = EnumUtils.GetEnumValueInfo(rp.ImageAvailability, context),
								Portable = rp.Portable,
								StudyInstanceUid = rp.StudyInstanceUID
							};

			var includedSteps = CollectionUtils.Select(rp.GetWorkflowHistory(), procedureStepFilter);
			if (includedSteps.Count > 0)
			{
				var procedureStepAssembler = new ProcedureStepAssembler();
				detail.ProcedureSteps = CollectionUtils.Map(
					includedSteps,
					(ProcedureStep ps) => procedureStepAssembler.CreateProcedureStepDetail(ps, context));
			}

			// the Protocol may be null, if this procedure has not been protocolled
			if (includeProtocol && rp.ActiveProtocol != null)
			{
				var protocolAssembler = new ProtocolAssembler();
				detail.Protocol = protocolAssembler.CreateProtocolDetail(rp.ActiveProtocol, context);
			}

			return detail;
		}
Beispiel #3
0
		public ModalityProcedureStepSummary CreateProcedureStepSummary(ModalityProcedureStep mps, IPersistenceContext context)
		{
			var psSummary = new ProcedureStepAssembler().CreateProcedureStepSummary(mps, context);
			return new ModalityProcedureStepSummary(psSummary, mps.Description);
		}
        public ModalityProcedureStepSummary CreateProcedureStepSummary(ModalityProcedureStep mps, IPersistenceContext context)
        {
            var psSummary = new ProcedureStepAssembler().CreateProcedureStepSummary(mps, context);

            return(new ModalityProcedureStepSummary(psSummary, mps.Description));
        }