public OrderRequisition CreateOrderRequisition(Order order, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var visitAssembler = new VisitAssembler(); var pracAssembler = new ExternalPractitionerAssembler(); var facilityAssembler = new FacilityAssembler(); var dsAssembler = new DiagnosticServiceAssembler(); var attachmentAssembler = new OrderAttachmentAssembler(); var noteAssembler = new OrderNoteAssembler(); var resultRecipientAssembler = new ResultRecipientAssembler(); var requisition = new OrderRequisition { OrderRef = order.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary( CollectionUtils.FirstElement(order.Procedures).PatientProfile, context), Visit = visitAssembler.CreateVisitSummary(order.Visit, context), DiagnosticService = dsAssembler.CreateSummary(order.DiagnosticService), SchedulingRequestTime = order.SchedulingRequestTime, OrderingPractitioner = pracAssembler.CreateExternalPractitionerSummary(order.OrderingPractitioner, context), OrderingFacility = facilityAssembler.CreateFacilitySummary(order.OrderingFacility), ReasonForStudy = order.ReasonForStudy, Priority = EnumUtils.GetEnumValueInfo(order.Priority, context), ResultRecipients = CollectionUtils.Map<ResultRecipient, ResultRecipientDetail>( order.ResultRecipients, r => resultRecipientAssembler.CreateResultRecipientDetail(r, context)), Procedures = CollectionUtils.Map<Procedure, ProcedureRequisition>( order.Procedures, procedure => CreateProcedureRequisition(procedure, context)), Attachments = CollectionUtils.Map<OrderAttachment, AttachmentSummary>( order.Attachments, attachment => attachmentAssembler.CreateOrderAttachmentSummary(attachment, context)), Notes = CollectionUtils.Map<OrderNote, OrderNoteDetail>( OrderNote.GetNotesForOrder(order), note => noteAssembler.CreateOrderNoteDetail(note, context)), ExtendedProperties = ExtendedPropertyUtils.Copy(order.ExtendedProperties), CanModify = !order.IsTerminated }; return requisition; }
public OrderRequisition CreateOrderRequisition(Order order, IPersistenceContext context) { var patientProfileAssembler = new PatientProfileAssembler(); var visitAssembler = new VisitAssembler(); var pracAssembler = new ExternalPractitionerAssembler(); var facilityAssembler = new FacilityAssembler(); var dsAssembler = new DiagnosticServiceAssembler(); var attachmentAssembler = new OrderAttachmentAssembler(); var noteAssembler = new OrderNoteAssembler(); var resultRecipientAssembler = new ResultRecipientAssembler(); var requisition = new OrderRequisition { OrderRef = order.GetRef(), Patient = patientProfileAssembler.CreatePatientProfileSummary( CollectionUtils.FirstElement(order.Procedures).PatientProfile, context), Visit = visitAssembler.CreateVisitSummary(order.Visit, context), DiagnosticService = dsAssembler.CreateSummary(order.DiagnosticService), SchedulingRequestTime = order.SchedulingRequestTime, OrderingPractitioner = pracAssembler.CreateExternalPractitionerSummary(order.OrderingPractitioner, context), OrderingFacility = facilityAssembler.CreateFacilitySummary(order.OrderingFacility), ReasonForStudy = order.ReasonForStudy, Priority = EnumUtils.GetEnumValueInfo(order.Priority, context), ResultRecipients = CollectionUtils.Map <ResultRecipient, ResultRecipientDetail>( order.ResultRecipients, r => resultRecipientAssembler.CreateResultRecipientDetail(r, context)), Procedures = CollectionUtils.Map <Procedure, ProcedureRequisition>( order.Procedures, procedure => CreateProcedureRequisition(procedure, context)), Attachments = CollectionUtils.Map <OrderAttachment, AttachmentSummary>( order.Attachments, attachment => attachmentAssembler.CreateOrderAttachmentSummary(attachment, context)), Notes = CollectionUtils.Map <OrderNote, OrderNoteDetail>( OrderNote.GetNotesForOrder(order), note => noteAssembler.CreateOrderNoteDetail(note, context)), ExtendedProperties = ExtendedPropertyUtils.Copy(order.ExtendedProperties), CanModify = !order.IsTerminated }; return(requisition); }