예제 #1
0
        private StudyHistoryUpdateColumns CreateStudyHistoryRecord(StudyEditedEventArgs context)
        {
            Platform.CheckForNullReference(context.OriginalStudyStorageLocation, "context.OriginalStudyStorageLocation");
            Platform.CheckForNullReference(context.NewStudyStorageLocation, "context.NewStudyStorageLocation");

            _studyInfo  = StudyInformation.CreateFrom(context.OriginalStudy);
            _changeDesc = new WebEditStudyHistoryChangeDescription
            {
                UpdateCommands = context.EditCommands,
                TimeStamp      = Platform.Time,
                UserId         = context.UserId,
                Reason         = context.Reason,
                EditType       = context.EditType
            };

            var columns = new StudyHistoryUpdateColumns
            {
                InsertTime           = Platform.Time,
                StudyStorageKey      = context.OriginalStudyStorageLocation.GetKey(),
                DestStudyStorageKey  = context.NewStudyStorageLocation.GetKey(),
                StudyData            = XmlUtils.SerializeAsXmlDoc(_studyInfo),
                StudyHistoryTypeEnum =
                    context.EditType == EditType.WebEdit
                                                        ? StudyHistoryTypeEnum.WebEdited
                                                        : StudyHistoryTypeEnum.ExternalEdit
            };

            XmlDocument doc = XmlUtils.SerializeAsXmlDoc(_changeDesc);

            columns.ChangeDescription = doc;
            return(columns);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            StudyInformation studyinformation = db.StudyInfos.Find(id);

            db.StudyInfos.Remove(studyinformation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            StudyInformation studyinformation = db.StudyInfos.GetById(id);

            db.StudyInfos.Remove(studyinformation);
            db.Commit();
            return(RedirectToAction("Index"));
        }
        protected override void ProcessItem(Model.WorkQueue item)
        {
            Platform.CheckMemberIsSet(StorageLocation, "StorageLocation");
            Platform.CheckForNullReference(Study, "Study doesn't exist");

            if (WorkQueueUidList.Count == 0)
            {
                // we are done. Just need to cleanup the duplicate folder
                Platform.Log(LogLevel.Info, "{0} is completed. Cleaning up duplicate storage folder. (GUID={1}, action={2})",
                             item.WorkQueueTypeEnum, item.GetKey().Key, _processDuplicateEntry.QueueData.Action);

                CleanUpReconcileFolders();

                PostProcessing(item, WorkQueueProcessorStatus.Complete, WorkQueueProcessorDatabaseUpdate.ResetQueueState);
            }
            else
            {
                Platform.Log(LogLevel.Info, "Processing {0} entry (GUID={1}, action={2})",
                             item.WorkQueueTypeEnum, item.GetKey().Key, _processDuplicateEntry.QueueData.Action);

                Platform.CheckTrue(Directory.Exists(DuplicateFolder), String.Format("Duplicate Folder {0} doesn't exist.", DuplicateFolder));

                LogWorkQueueInfo();

                EnsureStorageLocationIsWritable(StorageLocation);

                _currentStudyInfo = StudyInformation.CreateFrom(Study);

                ImageSetDetails duplicateSopDetails = null;

                // If deleting duplicates then don't log the history
                if (_processDuplicateEntry.QueueData.Action != ProcessDuplicateAction.Delete && !HistoryLogged)
                {
                    duplicateSopDetails = LoadDuplicateDetails();
                }

                try
                {
                    UpdateStudyOrDuplicates();

                    int count = ProcessUidList();

                    // If deleting duplicates then don't log the history
                    if (_processDuplicateEntry.QueueData.Action != ProcessDuplicateAction.Delete &&
                        !HistoryLogged && duplicateSopDetails != null && count > 0)
                    {
                        LogHistory(duplicateSopDetails);
                    }

                    PostProcessing(item, WorkQueueProcessorStatus.Pending, WorkQueueProcessorDatabaseUpdate.None);
                }
                finally
                {
                    UpdateQueueData();
                }
            }
        }
        //
        // GET: /StudyInformation/Delete/5

        public ActionResult Delete(int id = 0)
        {
            StudyInformation studyinformation = db.StudyInfos.Find(id);

            if (studyinformation == null)
            {
                return(HttpNotFound());
            }
            return(View(studyinformation));
        }
 public ActionResult Edit(StudyInformation studyinformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studyinformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudyId = new SelectList(db.Studies, "Id", "Name", studyinformation.StudyId);
     return(View(studyinformation));
 }
        //
        // GET: /StudyInformation/Edit/5

        public ActionResult Edit(int id = 0)
        {
            StudyInformation studyinformation = db.StudyInfos.Find(id);

            if (studyinformation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StudyId = new SelectList(db.Studies, "Id", "Name", studyinformation.StudyId);
            return(View(studyinformation));
        }
        public ActionResult Create(StudyInformation studyinformation)
        {
            if (ModelState.IsValid)
            {
                db.StudyInfos.Add(studyinformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.StudyId = new SelectList(db.Studies, "Id", "Name", studyinformation.StudyId);
            return(View(studyinformation));
        }
예제 #9
0
 public void OnStudyEditing(WebEditStudyContext context)
 {
     _studyInfo  = StudyInformation.CreateFrom(context.OriginalStudy);
     _changeDesc = new WebEditStudyHistoryChangeDescription
     {
         UpdateCommands = context.EditCommands,
         TimeStamp      = Platform.Time,
         UserId         = context.UserId,
         Reason         = context.Reason,
         EditType       = context.EditType
     };
 }
예제 #10
0
        public InconsistentDataSIQRecord(StudyIntegrityQueue queue)
        {
            _queueItem = queue;
            ReconcileStudyWorkQueueData data = XmlUtils.Deserialize <ReconcileStudyWorkQueueData>(queue.Details);

            _conflictingImageDetails    = data.Details;
            _conflictingImageDescriptor = XmlUtils.Deserialize <ImageSetDescriptor>(queue.StudyData);
            StudyStorage storage = StudyStorage.Load(HttpContextData.Current.ReadContext, queue.StudyStorageKey);
            Study        study   = storage.LoadStudy(HttpContextData.Current.ReadContext);

            _existingStudyInfo = new StudyInformation(new ServerEntityAttributeProvider(study));
        }
        private StudyInformation GetStudyInformation(ClientQueryDataSet.StudiesRow study)
        {
            StudyInformation studyInfo = new StudyInformation(study.IsPatientIDNull( ) ? string.Empty : study.PatientID,
                                                              study.StudyInstanceUID);

            studyInfo.AccessionNumber        = study.IsAccessionNumberNull( )  ? string.Empty : study.AccessionNumber;
            studyInfo.PatientBirthDate       = study.IsPatientBirthDateNull( ) ? string.Empty : study.PatientBirthDate;
            studyInfo.PatientName            = study.IsPatientNameNull( )      ? string.Empty : study.PatientName;
            studyInfo.PatientSex             = study.IsPatientSexNull( )       ? string.Empty : study.PatientSex;
            studyInfo.ReferringPhysicianName = study.IsReferDrNameNull( )      ? string.Empty : study.ReferDrName;
            studyInfo.StudyDate        = study.IsStudyDateNull( )        ? string.Empty : study.StudyDate;
            studyInfo.StudyDescription = study.IsStudyDescriptionNull( ) ? string.Empty : study.StudyDescription;

            return(studyInfo);
        }
        private SeriesInformation GetSeriesInformation(StudyInformation studyInfo, ClientQueryDataSet.SeriesRow series)
        {
            string patientID         = studyInfo.PatientID;
            string studyInstanceUID  = studyInfo.StudyInstanceUID;
            string seriesInstanceUID = series.SeriesInstanceUID;
            string seriesDescription = series.IsSeriesDescriptionNull( ) ? string.Empty : series.SeriesDescription;

            SeriesInformation seriesInfo = new SeriesInformation(patientID, studyInstanceUID, seriesInstanceUID, seriesDescription);

            seriesInfo.Modality = series.IsModalityNull( ) ? string.Empty : series.Modality;
            seriesInfo.NumberOfSeriesRelatedInstances = series.IsFrameCountNull( ) ? string.Empty : series.FrameCount;
            seriesInfo.SeriesDate   = series.IsSeriesDateNull( ) ? string.Empty : series.SeriesDate;
            seriesInfo.SeriesNumber = series.IsSeriesNumberNull( ) ? string.Empty : series.SeriesNumber;
            seriesInfo.SeriesTime   = series.IsSeriesTimeNull( ) ? string.Empty : series.SeriesTime;

            return(seriesInfo);
        }
예제 #13
0
        public ActionResult Edit(StudyInformation studyinformation)
        {
            if (ModelState.IsValid)
            {
                db.StudyInfos.GetById(studyinformation.Id).Study   = studyinformation.Study;
                db.StudyInfos.GetById(studyinformation.Id).Content = studyinformation.Content;
                db.StudyInfos.GetById(studyinformation.Id).StudyId = studyinformation.StudyId;
                db.StudyInfos.GetById(studyinformation.Id).Title   = studyinformation.Title;
                db.StudyInfos.GetById(studyinformation.Id).Study   = studyinformation.Study;

                // db.Entry(studyinformation).State = EntityState.Modified;
                db.Commit();
                return(RedirectToAction("Index"));
            }
            ViewBag.StudyId = new SelectList(db.Studies.GetAll(), "Id", "Name", studyinformation.StudyId);
            return(View(studyinformation));
        }
예제 #14
0
        private static void SetValuesToStudyInfoParameters(KeyDataCollection studyParameters, out StudyInformation studyInformation)
        {
            studyInformation = new StudyInformation()
            {
                PatientBirthdate = DateTime.ParseExact(studyParameters["DOB"], "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy"),
                Patientssn       = studyParameters["PATIENTID"],
                PatientFirstName = studyParameters["PATIENTNAME"].Substring(studyParameters["PATIENTNAME"].IndexOf(",", StringComparison.Ordinal) + 1),
                PatientLastName  = studyParameters["PATIENTNAME"].Substring(0, studyParameters["PATIENTNAME"].IndexOf(",", StringComparison.Ordinal)),
                StudyDate        = DateTime.ParseExact(studyParameters["STUDYDATE"], "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy HH:mm"),
                ContainerCount   = 0
            };
            if (ParametersContainKey(studyParameters, "SAMPLENUMBER", out var studyInfoParameter))
            {
                studyInformation.SampleNumber = studyInfoParameter;
            }

            if (ParametersContainKey(studyParameters, "ACCESSIONNUMBER", out studyInfoParameter))
            {
                studyInformation.StudyNumber = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "REFERRINGPHYSICIANSNAME", out studyInfoParameter))
            {
                studyInformation.RefSenderDoctor = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "STUDYID", out studyInfoParameter))
            {
                studyInformation.StudyId = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "STUDYPERFORMER", out studyInfoParameter))
            {
                studyInformation.StudyPerformer = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "STUDYTYPE", out studyInfoParameter))
            {
                studyInformation.StudyTypeName = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "STUDYCODE", out studyInfoParameter))
            {
                studyInformation.StudyTypeCode = studyInfoParameter;
            }
            if (ParametersContainKey(studyParameters, "STUDYINSTANCEUID", out studyInfoParameter))
            {
                studyInformation.StudyInstanceUid = studyInfoParameter;
            }
        }
 // PUT api/StudyInformation/5
 public void Put(int id, [FromBody] StudyInformation value)
 {
 }
 public StudyNodeInformation(StudyInformation studyInfo)
     : base(studyInfo.PatientID, studyInfo.StudyInstanceUID)
 {
 }
예제 #17
0
 public void OnSeriesDeleting(WebDeleteProcessorContext context, Series series)
 {
     _studyInfo = StudyInformation.CreateFrom(context.StorageLocation.Study);
 }
 // POST api/StudyInformation
 public void Post([FromBody] StudyInformation value)
 {
 }