Exemplo n.º 1
1
		public AddDiagnosticServiceResponse AddDiagnosticService(AddDiagnosticServiceRequest request)
		{
			Platform.CheckForNullReference(request, "request");
			Platform.CheckMemberIsSet(request.DiagnosticService, "request.DiagnosticService");

			DiagnosticService item = new DiagnosticService();

			DiagnosticServiceAssembler assembler = new DiagnosticServiceAssembler();
			assembler.UpdateDiagnosticService(item, request.DiagnosticService, PersistenceContext);

			PersistenceContext.Lock(item, DirtyState.New);
			PersistenceContext.SynchState();

			return new AddDiagnosticServiceResponse(assembler.CreateSummary(item));
		}
Exemplo n.º 2
0
		public DiagnosticServiceSummary CreateSummary(DiagnosticService diagnosticService)
		{
			return new DiagnosticServiceSummary(
				diagnosticService.GetRef(),
				diagnosticService.Id,
				diagnosticService.Name,
				diagnosticService.Deactivated);
		}
Exemplo n.º 3
0
		public void UpdateDiagnosticService(DiagnosticService ds, DiagnosticServiceDetail detail, IPersistenceContext context)
		{
			ds.Id = detail.Id;
			ds.Name = detail.Name;
			ds.Deactivated = detail.Deactivated;

			ds.ProcedureTypes.Clear();
			ds.ProcedureTypes.AddAll(
				detail.ProcedureTypes.Select(pt => context.Load<ProcedureType>(pt.ProcedureTypeRef, EntityLoadFlags.Proxy)).ToList());
		}
Exemplo n.º 4
0
		public DiagnosticServicePlanDetail CreatePlanDetail(DiagnosticService diagnosticService, IPersistenceContext context)
		{
			var rptAssembler = new ProcedureTypeAssembler();
			return new DiagnosticServicePlanDetail(
				diagnosticService.GetRef(),
				diagnosticService.Id,
				diagnosticService.Name,
				diagnosticService.ProcedureTypes.Select(rpType => rptAssembler.CreateDetail(rpType, context)).ToList()
				);
		}
Exemplo n.º 5
0
		public DiagnosticServiceDetail CreateDetail(DiagnosticService diagnosticService)
		{
			var rptAssembler = new ProcedureTypeAssembler();
			return new DiagnosticServiceDetail(
				diagnosticService.GetRef(),
				diagnosticService.Id,
				diagnosticService.Name,
				CollectionUtils.Map<ProcedureType, ProcedureTypeSummary>(diagnosticService.ProcedureTypes, rptAssembler.CreateSummary),
				diagnosticService.Deactivated);
		}
		public DiagnosticServicePlanDetail CreatePlanDetail(DiagnosticService diagnosticService, bool includeDeactivatedProcedures, IPersistenceContext context)
		{
			var rptAssembler = new ProcedureTypeAssembler();
			var procedureTypes = includeDeactivatedProcedures ? diagnosticService.ProcedureTypes : diagnosticService.ProcedureTypes.Where(rpType => !rpType.Deactivated);
			return new DiagnosticServicePlanDetail(
				diagnosticService.GetRef(),
				diagnosticService.Id,
				diagnosticService.Name,
				procedureTypes.Select(rpType => rptAssembler.CreateDetail(rpType, context)).ToList()
				);
		}
 /// <summary>
 /// Constructor that does not specify an explicit list of procedures.
 /// </summary>
 /// <param name="enteredTime"></param>
 /// <param name="enteredBy"></param>
 /// <param name="enteredComment"></param>
 /// <param name="accessionNumber"></param>
 /// <param name="patient"></param>
 /// <param name="visit"></param>
 /// <param name="diagnosticService"></param>
 /// <param name="reasonForStudy"></param>
 /// <param name="priority"></param>
 /// <param name="orderingFacility"></param>
 /// <param name="performingFacility"></param>
 /// <param name="schedulingRequestTime"></param>
 /// <param name="orderingPractitioner"></param>
 /// <param name="resultRecipients"></param>
 public OrderCreationArgs(DateTime enteredTime, Staff enteredBy, string enteredComment, string accessionNumber,
                          Patient patient, Visit visit, DiagnosticService diagnosticService, string reasonForStudy, OrderPriority priority,
                          Facility orderingFacility, Facility performingFacility, DateTime?schedulingRequestTime, ExternalPractitioner orderingPractitioner,
                          IList <ResultRecipient> resultRecipients)
 {
     EnteredTime           = enteredTime;
     EnteredBy             = enteredBy;
     EnteredComment        = enteredComment;
     AccessionNumber       = accessionNumber;
     Patient               = patient;
     Visit                 = visit;
     DiagnosticService     = diagnosticService;
     ReasonForStudy        = reasonForStudy;
     Priority              = priority;
     OrderingFacility      = orderingFacility;
     PerformingFacility    = performingFacility;
     SchedulingRequestTime = schedulingRequestTime;
     OrderingPractitioner  = orderingPractitioner;
     ResultRecipients      = resultRecipients;
 }
Exemplo n.º 8
0
		/// <summary>
		/// Constructor that does not specify an explicit list of procedures.
		/// </summary>
		/// <param name="enteredTime"></param>
		/// <param name="enteredBy"></param>
		/// <param name="enteredComment"></param>
		/// <param name="accessionNumber"></param>
		/// <param name="patient"></param>
		/// <param name="visit"></param>
		/// <param name="diagnosticService"></param>
		/// <param name="reasonForStudy"></param>
		/// <param name="priority"></param>
		/// <param name="orderingFacility"></param>
		/// <param name="performingFacility"></param>
		/// <param name="schedulingRequestTime"></param>
		/// <param name="orderingPractitioner"></param>
		/// <param name="resultRecipients"></param>
		public OrderCreationArgs(DateTime enteredTime, Staff enteredBy, string enteredComment, string accessionNumber,
			Patient patient, Visit visit, DiagnosticService diagnosticService, string reasonForStudy, OrderPriority priority,
			Facility orderingFacility, Facility performingFacility, DateTime? schedulingRequestTime, ExternalPractitioner orderingPractitioner,
			IList<ResultRecipient> resultRecipients)
		{
			EnteredTime = enteredTime;
			EnteredBy = enteredBy;
			EnteredComment = enteredComment;
			AccessionNumber = accessionNumber;
			Patient = patient;
			Visit = visit;
			DiagnosticService = diagnosticService;
			ReasonForStudy = reasonForStudy;
			Priority = priority;
			OrderingFacility = orderingFacility;
			PerformingFacility = performingFacility;
			SchedulingRequestTime = schedulingRequestTime;
			OrderingPractitioner = orderingPractitioner;
			ResultRecipients = resultRecipients;
		}