public ProcedureStepDetail CreateProcedureStepDetail(ProcedureStep ps, IPersistenceContext context) { var staffAssembler = new StaffAssembler(); var modalityAssembler = new ModalityAssembler(); return(new ProcedureStepDetail( ps.GetRef(), ps.Name, ps.GetClass().Name, ps.Is <ModalityProcedureStep>() ? ps.As <ModalityProcedureStep>().Description : null, EnumUtils.GetEnumValueInfo(ps.State, context), ps.CreationTime, ps.Scheduling == null ? null : ps.Scheduling.StartTime, ps.StartTime, ps.EndTime, ps.AssignedStaff == null ? null : staffAssembler.CreateStaffSummary(ps.AssignedStaff, context), ps.PerformingStaff == null ? null : staffAssembler.CreateStaffSummary(ps.PerformingStaff, context), ps.Is <ModalityProcedureStep>() ? modalityAssembler.CreateModalitySummary(ps.As <ModalityProcedureStep>().Modality) : null)); }
public ProcedureStepSummary CreateProcedureStepSummary(ProcedureStep ps, IPersistenceContext context) { var assembler = new ProcedureAssembler(); var modalityAssembler = new ModalityAssembler(); return(new ProcedureStepSummary( ps.GetRef(), ps.Name, EnumUtils.GetEnumValueInfo(ps.State, context), ps.StartTime, ps.EndTime, ps.Is <ModalityProcedureStep>() ? modalityAssembler.CreateModalitySummary(ps.As <ModalityProcedureStep>().Modality) : null, assembler.CreateProcedureSummary(ps.Procedure, context))); }