Beispiel #1
0
        public override void Execute()
        {
            var       broker      = new BrokerService();
            var       transaction = broker.BeginTransaction();
            Exception _ex_        = null;

            try
            {
                foreach (var cmd in _lst)
                {
                    cmd.State = transaction;
                    cmd.Execute();
                }
                broker.CommitTransaction(transaction);
            }
            catch (Exception ex)
            {
                _ex_ = ex;
                broker.RollbackTransaction(transaction);
            }

            if (null != _ex_)
            {
                if (WhenFailed != null)
                {
                    WhenFailed.Execute();
                }
                else
                {
                    throw _ex_;
                }
            }
        }
Beispiel #2
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_procedureStep.ScheduledProcedureStepID, "_procedureStep.ScheduledProcedureStepID");

            var broker = new BrokerService();

            broker.AddScheduledProcedureStep(_imageServiceRequest.AccessionNumber, _procedure.RequestedProcedureID, _procedureStep, State as MWLDataset);
        }
Beispiel #3
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_imageServiceRequest.AccessionNumber, "_imageServiceRequest.AccessionNumber");

            var broker = new BrokerService();

            broker.AddRequestedProcedure(_imageServiceRequest.AccessionNumber, _procedure, State as MWLDataset);
        }
Beispiel #4
0
        public override void Execute()
        {
            var broker = new BrokerService();

            var p = broker.FindMPPS(_pps.MPPSSOPInstanceUID);

            if (p != null)
            {
                broker.DeleteMPPS(_pps.MPPSSOPInstanceUID);
            }
        }
Beispiel #5
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_procedureStep.ScheduledProcedureStepID, "_procedureStep.ScheduledProcedureStepID");

            var broker = new BrokerService();

            var p = broker.FindScheduledProcedureStep(_procedureStep.ScheduledProcedureStepID);

            if (p != null)
            {
                broker.DeleteScheduledProcedureStep(_procedure.RequestedProcedureID);
            }
        }
Beispiel #6
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_imageServiceRequest.AccessionNumber, "_imageServiceRequest.AccessionNumber");

            var broker = new BrokerService();

            var p = broker.FindRequestedProcedure(_imageServiceRequest.AccessionNumber, _procedure.RequestedProcedureID);

            if (p != null)
            {
                broker.DeleteRequestedProcedure(_imageServiceRequest.AccessionNumber, _procedure.RequestedProcedureID);
            }
        }
Beispiel #7
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_visit.AdmissionID, "_visit.AdmissionID");

            var broker = new BrokerService();

            var v = broker.FindVisit(_visit.AdmissionID);

            if (v != null)
            {
                broker.DeleteVisit(_visit.AdmissionID);
            }
        }
Beispiel #8
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_imageServiceRequest.AccessionNumber, "_imageServiceRequest.AccessionNumber");

            var broker = new BrokerService();

            var r = broker.FindImagingServiceRequest(_imageServiceRequest.AccessionNumber, _patient.PatientID, _patient.IssuerOfPatientID);

            if (r != null)
            {
                broker.DeleteImagingServiceRequest(_imageServiceRequest.AccessionNumber, _patient.PatientID, _patient.IssuerOfPatientID);
            }
        }
Beispiel #9
0
        public override void Execute()
        {
            var broker = new BrokerService();

            var p = broker.FindMPPS(_pps.MPPSSOPInstanceUID);

            if (p != null)
            {
                throw new ArgumentException("PPS Information already exist.");
            }

            broker.AddMPPS(_pps);
        }
Beispiel #10
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_imageServiceRequest.AccessionNumber, "_imageServiceRequest.AccessionNumber");

            var broker = new BrokerService();

            var r = broker.FindImagingServiceRequest(_imageServiceRequest.AccessionNumber, _patient.PatientID, _patient.IssuerOfPatientID);

            if (r != null)
            {
                throw new ArgumentException("ImageServiceRequest already exist.");
            }
            broker.AddImagingServiceRequest(_patient.PatientID, _patient.IssuerOfPatientID, _imageServiceRequest, State as MWLDataset);
        }
Beispiel #11
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_visit.AdmissionID, "_visit.AdmissionID");

            var broker = new BrokerService();

            var v = broker.FindVisit(_visit.AdmissionID);

            if (v != null)
            {
                throw new ArgumentException("Visit already exist.");
            }

            broker.AddVisit(_visit, State as MWLDataset);
        }
Beispiel #12
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_patient, "_patient");
            Guard.ArgumentNotNullOrEmpty(_patient.IssuerOfPatientID, "IssuerOfPatientID");

            var broker = new BrokerService();

            var p = broker.FindPatient(_patient.PatientID, _patient.IssuerOfPatientID);

            if (p != null)
            {
                throw new ArgumentException("Patient already exist");
            }

            broker.AddPatient(_patient, State as MWLDataset);
        }
Beispiel #13
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_procedureStep.ScheduledProcedureStepID, "_procedureStep.ScheduledProcedureStepID");

            var broker = new BrokerService();

            var p = broker.FindScheduledProcedureStep(_procedureStep.ScheduledProcedureStepID);

            if (p != null)
            {
                broker.UpdateScheduledProcedureStep(_procedure.RequestedProcedureID, _procedureStep);
            }
            else
            {
                broker.AddScheduledProcedureStep(_imageServiceRequest.AccessionNumber, _procedure.RequestedProcedureID, _procedureStep);
            }
        }
Beispiel #14
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_patient, "_patient");
            Guard.ArgumentNotNullOrEmpty(_patient.IssuerOfPatientID, "IssuerOfPatientID");

            var broker = new BrokerService();

            var p = broker.FindPatient(_patient.PatientID, _patient.IssuerOfPatientID);

            if (p != null)
            {
                //deletes patient only and leave the cascade operation to db engine:
                //broker.DeletePatient(_patient.PatientID, _patient.IssuerOfPatientID);

                //enforce deleting all logically related records:
                broker.DeletePatientAndRelatedRecords(_patient.PatientID, _patient.IssuerOfPatientID);
            }
        }
Beispiel #15
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_visit.AdmissionID, "_visit.AdmissionID");

            var broker = new BrokerService();

            var v = broker.FindVisit(_visit.AdmissionID);

            if (v != null)
            {
                broker.UpdateVisit(_visit.AdmissionID, _visit);
            }
            else
            {
                //because of legacy behavior some visit records might have been left orphaned, we need to delete first
                broker.DeleteThenAddVisit(_visit);
            }
        }
Beispiel #16
0
        public override void Execute()
        {
            Guard.ArgumentNotNull(_patient, "_patient");
            Guard.ArgumentNotNullOrEmpty(_patient.IssuerOfPatientID, "IssuerOfPatientID");

            var broker = new BrokerService();

            var p = broker.FindPatient(_patient.PatientID, _patient.IssuerOfPatientID);

            if (p != null)
            {
                broker.UpdatePatient(_patient.PatientID, _patient.IssuerOfPatientID, _patient);
            }
            else
            {
                broker.AddPatient(_patient);
            }
        }