Beispiel #1
0
        public static void AddImagingServiceRequest(this MWLDataset ds, Patient patient, ImagingServiceRequest request)
        {
            MWLDataset.ImagingServiceRequestRow ir = ds.ImagingServiceRequest.NewImagingServiceRequestRow();

            request.CopyTo <MWLDataset.ImagingServiceRequestRow>(ir);
            ir.PatientID         = patient.PatientID;
            ir.IssuerOfPatientID = patient.IssuerOfPatientID;
            ds.ImagingServiceRequest.AddImagingServiceRequestRow(ir);
        }
Beispiel #2
0
        public void AddRequestedProcedure(string userName, string accessionNumber, WorklistRequestedProcedure procedure)
        {
            ImagingServiceRequest imgRequest = new ImagingServiceRequest()
            {
                AccessionNumber = accessionNumber
            };

            Check.ArgumentNotNullOrEmpty(accessionNumber, "accessionNumber");
            Check.ArgumentNotNullOrEmpty(procedure.RequestedProcedureID, "RequestedProceureID");
            Check.ArgumentNotNullOrEmpty(procedure.RequestedProcedureDescription, "RequestedProcedureDescription");

            if (string.IsNullOrEmpty(procedure.StudyInstanceUID))
            {
                procedure.StudyInstanceUID = DicomUtilities.GenerateDicomUniqueIdentifier();
            }

            if (procedure.RequestedProcedureCodeSequence != null)
            {
                Check.ArgumentNotNullOrEmpty(procedure.RequestedProcedureCodeSequence.CodeValue, "RequestedProcedureCodeSequence.CodeValue");
                Check.ArgumentNotNullOrEmpty(procedure.RequestedProcedureCodeSequence.CodingSchemeDesignator, "RequestedProcedureCodeSequence.CodingSchemeDesignator");
            }

            if (procedure.ReferencedStudySequence != null)
            {
                foreach (ReferencedStudySequence rs in procedure.ReferencedStudySequence)
                {
                    Check.ArgumentNotNullOrEmpty(rs.ReferencedSOPClassUID, "ReferencedStudySequence.ReferencedSOPClassUID");
                    Check.ArgumentNotNullOrEmpty(rs.ReferencedSOPInstanceUID, "ReferencedStudySequence.ReferencedSOPInstanceUID");
                }
            }

            using (MWLDataset ds = _DataAccessAgent.Find(imgRequest))
            {
                ImagingServiceRequest isr = new ImagingServiceRequest();

                imgRequest.CopyTo(isr);
                ds.AddRequestedProcedure(isr, procedure);
                _DataAccessAgent.UpdateMWL(ds);
            }
        }