예제 #1
0
        public void UpdateMPPS(string mppsSOPInstanceUID, WCFPPSInformation mpps)
        {
            PPSInformation srchMpps = new PPSInformation()
            {
                MPPSSOPInstanceUID = mppsSOPInstanceUID
            };

            Guard.ArgumentNotNullOrEmpty(mppsSOPInstanceUID, "mppsSOPInstanceUID");
            VerifyMpps(mpps);

            using (MPPSDataset ds = DB.DataAccess.FindMPPS(srchMpps))
            {
                if (ds != null && ds.PPSInformation.Rows.Count > 0)
                {
                    MPPSDataset.PPSInformationRow row = ds.PPSInformation.Rows[0] as MPPSDataset.PPSInformationRow;

                    row.Update(mpps);
                    DB.DataAccess.UpdateMPPS(ds);
                }
                else
                {
                    throw new Exception("Modality performed procedure step not found");
                }
            }
        }
예제 #2
0
        public WCFPPSInformation getPPS()
        {
            if (_pps == null)
            {
                _pps = new WCFPPSInformation();

                _pps.PPSDiscontinuationReasonCodeSequence = new List <PPSDiscontinuationReasonCodeSequence>()
                {
                };
                _pps.ProcedureCodeSequence = new List <ProcedureCodeSequence>()
                {
                };
                _pps.PerformedProtocolCodeSequence = new List <PerformedProtocolCodeSequence>()
                {
                };
                _pps.PPSRelationShip = new List <PPSRelationship>()
                {
                };
                _pps.PerformedSeriesSequence = new List <PerformedSeriesSequence>()
                {
                };
                _pps.ReferencedImageSequence = new List <WCFReferencedImageSequence>()
                {
                };
                _pps.ReferencedNonImageCompositeSequence = new List <ReferencedNonImageCompositeSequence>()
                {
                };
                _pps.UnscheduledPatient = new PatientInfoforUnscheduledPPS();
                _pps.Patient            = getPatient();
                _pps.StudyInstanceUID   = _adapter.IPC?.Study_Instance_UID.Read();
                if (string.IsNullOrEmpty(_pps.StudyInstanceUID))
                {
                    _pps.StudyInstanceUID = _adapter.Zxx?.Field_1.Read(0);
                }
                _pps.StudyID  = _adapter.Zxx?.Field_23.Read();
                _pps.Modality = _adapter.IPC?.Modality.Read();
                if (string.IsNullOrEmpty(_pps.Modality))
                {
                    _pps.Modality = _adapter.OBR?.Diagnostic_Serv_Sect_ID.Read();
                }
                if (!DicomValidation.IsValidModality(_pps.Modality))
                {
                    _pps.Modality = null;
                }
                _pps.CommentsonthePerformedProcedureStep = _adapter.Zxx?.Field_24.Read();
                _pps.PerformedProcedureTypeDescription   = _adapter.Zxx?.Field_25.Read();
                _pps.PerformedProcedureStepDescription   = _adapter.Zxx?.Field_26.Read();
                _pps.PerformedProcedureStepStatus        = _adapter.Zxx?.Field_27.Read();
                _pps.PerformedLocation        = _adapter.Zxx?.Field_28.Read();
                _pps.PerformedStationName     = _adapter.Zxx?.Field_29.Read();
                _pps.PerformedStationAETitle  = _adapter.Zxx?.Field_30.Read();
                _pps.PerformedProcedureStepID = _adapter.Zxx?.Field_31.Read();
                _pps.MPPSSOPInstanceUID       = _adapter.Zxx?.Field_32.Read();

                DefaultValuesProvider.Visit(_pps);
            }

            return(_pps);
        }
예제 #3
0
 public void AddMPPS(WCFPPSInformation mpps)
 {
     VerifyMpps(mpps);
     using (MPPSDataset ds = new MPPSDataset())
     {
         ds.AddMPPS(mpps);
         DB.DataAccess.UpdateMPPS(ds);
     }
 }
예제 #4
0
        public WCFPPSInformation FindMPPS(string mppsSOPInstanceUID)
        {
            WCFPPSInformation mpps = new WCFPPSInformation()
            {
                MPPSSOPInstanceUID = mppsSOPInstanceUID
            };

            Guard.ArgumentNotNullOrEmpty(mppsSOPInstanceUID, "mppsSOPInstanceUID");
            using (MPPSDataset ds = DB.DataAccess.FindMPPS(mpps))
            {
                if (ds?.PPSInformation.Rows.Count > 0)
                {
                    return(ds.ToPPSInformation());
                }
            }

            return(null);
        }
예제 #5
0
 public DeletePPSInformation(WCFPPSInformation pps)
 {
     _pps = pps;
 }
예제 #6
0
 public UpdatePPSInformation(WCFPPSInformation pps)
 {
     _pps = pps;
 }
예제 #7
0
 public AddPPSInformation(WCFPPSInformation pps)
 {
     _pps = pps;
 }
예제 #8
0
        private void VerifyMpps(WCFPPSInformation mpps)
        {
            Guard.ArgumentNotNullOrEmpty(mpps.MPPSSOPInstanceUID, "MPPSSOPInstanceUID");
            Guard.ArgumentNotNullOrEmpty(mpps.PerformedProcedureStepID, "PerformedProcedureStepID");
            Guard.ArgumentNotNullOrEmpty(mpps.PerformedStationAETitle, "PerformedStationAETitle");
            Guard.ArgumentNotNullOrEmpty(mpps.PerformedProcedureStepStartDate, "PerformedProcedureStepStartDate");
            Guard.ArgumentNotNullOrEmpty(mpps.PerformedProcedureStepStatus, "PerformedProcedureStepStatus");
            Guard.ArgumentNotNullOrEmpty(mpps.Modality, "Modality");
            Guard.ArgumentNotNullOrEmpty(mpps.StudyInstanceUID, "StudyInstanceUID");

            if (mpps.PPSDiscontinuationReasonCodeSequence != null)
            {
                foreach (PPSDiscontinuationReasonCodeSequence cs in mpps.PPSDiscontinuationReasonCodeSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.CodeValue, "PPSDiscontinuationReasonCodeSequence.CodeValue");
                    Guard.ArgumentNotNullOrEmpty(cs.CodingSchemeDesignator, "PPSDiscontinuationReasonCodeSequence.CodingSchemeDesignator");
                }
            }

            if (mpps.ProcedureCodeSequence != null)
            {
                foreach (ProcedureCodeSequence cs in mpps.ProcedureCodeSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.CodeValue, "ProcedureCodeSequence.CodeValue");
                    Guard.ArgumentNotNullOrEmpty(cs.CodingSchemeDesignator, "ProcedureCodeSequence.CodingSchemeDesignator");
                }
            }

            if (mpps.PerformedProtocolCodeSequence != null)
            {
                foreach (PerformedProtocolCodeSequence cs in mpps.PerformedProtocolCodeSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.CodeValue, "PerformedProtocolCodeSequence.CodeValue");
                    Guard.ArgumentNotNullOrEmpty(cs.CodingSchemeDesignator, "PerformedProtocolCodeSequence.CodingSchemeDesignator");
                }
            }

            if (mpps.PPSRelationShip != null)
            {
                foreach (PPSRelationship cs in mpps.PPSRelationShip)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.ScheduledProcedureStepID, "PPSRelationShip.ScheduledProcedureStepID");
                }
            }

            if (mpps.PerformedSeriesSequence != null)
            {
                foreach (PerformedSeriesSequence cs in mpps.PerformedSeriesSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.ProtocolName, "PerformedSeriesSequence.ProtocolName");
                    Guard.ArgumentNotNullOrEmpty(cs.SeriesInstanceUID, "PerformedSeriesSequence.SeriesInstanceUID");
                }
            }

            if (mpps.ReferencedImageSequence != null)
            {
                foreach (ReferencedImageSequence cs in mpps.ReferencedImageSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.ReferencedSOPClassUID, "ReferencedImageSequence.ReferencedSOPClassUID");
                    Guard.ArgumentNotNullOrEmpty(cs.ReferencedSOPInstanceUID, "ReferencedImageSequence.ReferencedSOPInstanceUID");
                }
            }

            if (mpps.ReferencedNonImageCompositeSequence != null)
            {
                foreach (ReferencedNonImageCompositeSequence cs in mpps.ReferencedNonImageCompositeSequence)
                {
                    Guard.ArgumentNotNullOrEmpty(cs.ReferencedSOPClassUID, "ReferencedNonImageCompositeSequence.ReferencedSOPClassUID");
                    Guard.ArgumentNotNullOrEmpty(cs.ReferencedSOPInstanceUID, "ReferencedNonImageCompositeSequence.ReferencedSOPInstanceUID");
                }
            }
        }