コード例 #1
0
        public ProtocolGroupDetail GetProtocolGroupDetail(ProtocolGroup group, IPersistenceContext context)
        {
			List<ProtocolCodeSummary> codes = CollectionUtils.Map<ProtocolCode, ProtocolCodeSummary>(
                group.Codes,
				delegate(ProtocolCode code) { return GetProtocolCodeSummary(code); });

            ProcedureTypeGroupAssembler assembler = new ProcedureTypeGroupAssembler();
            List<ProcedureTypeGroupSummary> readingGroups = CollectionUtils.Map<ProcedureTypeGroup, ProcedureTypeGroupSummary>(
                group.ReadingGroups,
                delegate(ProcedureTypeGroup readingGroup) { return assembler.GetProcedureTypeGroupSummary(readingGroup, context); });
            
            return new ProtocolGroupDetail(group.Name, group.Description, codes, readingGroups);
        }
コード例 #2
0
        public void UpdateProtocolGroup(ProtocolGroup group, ProtocolGroupDetail detail, IPersistenceContext context)
        {
            group.Name = detail.Name;
            group.Description = detail.Description;

            group.Codes.Clear();
            detail.Codes.ForEach(delegate(ProtocolCodeSummary summary)
            {
				group.Codes.Add(context.Load<ProtocolCode>(summary.ProtocolCodeRef));
            });

            group.ReadingGroups.Clear();
            detail.ReadingGroups.ForEach(delegate(ProcedureTypeGroupSummary procedureTypeGroupSummary)
            {
                group.ReadingGroups.Add(context.Load<ReadingGroup>(procedureTypeGroupSummary.ProcedureTypeGroupRef));
            });
        }
コード例 #3
0
ファイル: ProtocolAssembler.cs プロジェクト: nhannd/Xian
		public ProtocolGroupDetail CreateProtocolGroupDetail(ProtocolGroup group, bool includeDeactivatedCodes, IPersistenceContext context)
		{
			var protocolCodes = includeDeactivatedCodes
				? group.Codes
				: CollectionUtils.Select(group.Codes, code => !code.Deactivated);

			var protocolCodeSummaries = CollectionUtils.Map<ProtocolCode, ProtocolCodeSummary>(
				protocolCodes,
				CreateProtocolCodeSummary);

			var assembler = new ProcedureTypeGroupAssembler();
			var groups = CollectionUtils.Map<ProcedureTypeGroup, ProcedureTypeGroupSummary>(
				group.ReadingGroups,
				readingGroup => assembler.GetProcedureTypeGroupSummary(readingGroup, context));

			return new ProtocolGroupDetail(group.Name, group.Description, protocolCodeSummaries, groups);
		}
コード例 #4
0
		public AddProtocolGroupResponse AddProtocolGroup(AddProtocolGroupRequest request)
		{
			var assembler = new ProtocolGroupAssembler();

			var group = new ProtocolGroup();
			assembler.UpdateProtocolGroup(group, request.Detail, this.PersistenceContext);

			this.PersistenceContext.Lock(group, DirtyState.New);
			this.PersistenceContext.SynchState();

			return new AddProtocolGroupResponse(assembler.GetProtocolGroupSummary(group));
		}
コード例 #5
0
 public ProtocolGroupSummary GetProtocolGroupSummary(ProtocolGroup protocolGroup)
 {
     return new ProtocolGroupSummary(protocolGroup.GetRef(), protocolGroup.Name, protocolGroup.Description);
 }
コード例 #6
0
ファイル: ProtocolAssembler.cs プロジェクト: nhannd/Xian
		public ProtocolGroupSummary CreateProtocolGroupSummary(ProtocolGroup group)
		{
			return new ProtocolGroupSummary(group.GetRef(), group.Name, group.Description);
		}