Exemplo n.º 1
0
 public DicomSeriesSynchronizeHelper(DicomSeriesAssembler assembler, ModalityPerformedProcedureStep mpps, IPersistenceContext context)
     : base(true, true)
 {
     _assembler = assembler;
     _mpps      = mpps;
     _context   = context;
 }
        public ModalityPerformedProcedureStepDetail CreateModalityPerformedProcedureStepDetail(ModalityPerformedProcedureStep mpps, IPersistenceContext context)
        {
            var assembler = new ModalityProcedureStepAssembler();

            // include the details of each MPS in the mpps summary
            var mpsDetails = CollectionUtils.Map(mpps.Activities,
                                                 (ProcedureStep mps) => assembler.CreateProcedureStepSummary(mps.As <ModalityProcedureStep>(), context));

            var dicomSeriesAssembler = new DicomSeriesAssembler();
            var dicomSeries          = dicomSeriesAssembler.GetDicomSeriesDetails(mpps.DicomSeries);

            StaffSummary mppsPerformer = null;
            var          performer     = mpps.Performer as ProcedureStepPerformer;

            if (performer != null)
            {
                var staffAssembler = new StaffAssembler();
                mppsPerformer = staffAssembler.CreateStaffSummary(performer.Staff, context);
            }

            return(new ModalityPerformedProcedureStepDetail(
                       mpps.GetRef(),
                       EnumUtils.GetEnumValueInfo(mpps.State, context),
                       mpps.StartTime,
                       mpps.EndTime,
                       mppsPerformer,
                       mpsDetails,
                       dicomSeries,
                       ExtendedPropertyUtils.Copy(mpps.ExtendedProperties)));
        }