public static void WithSeries(this IEnumerable<CFindResponse> cFinds, DICOMSCU scu, Entity daemon) { var iods = cFinds.Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData) .Where(r => r.Data.Elements.Any(e => e.Tag == TagHelper.STUDY_INSTANCE_UID)) .Where(r => !string.IsNullOrEmpty(r.Data.Elements.First(e => e.Tag == TagHelper.STUDY_INSTANCE_UID).DData as string)) .Select(r => r.GetIOD()) .ToList(); iods.ForEach(i=>i.QueryLevel = QueryLevel.SERIES); foreach (var iod in iods) { var req = new CFindRequest(iod, Root.STUDY); var seriesUids = scu.GetResponse(req, daemon) .Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData) .Where(r => r.Data.Elements.Any(e => e.Tag == TagHelper.SERIES_INSTANCE_UID)) .Select(r => new { // Study = study, Series = r.Data.GetSelector().SeriesInstanceUID.Data, Modality = r.Data.GetSelector().Modality.Data }) .ToList(); System.Console.Write(""); } }
public IEnumerable <CFindStudyIOD> GetStudyUids(string patientId) { var query = CFind.CreateStudyQuery(patientId); var studyUids = _scu.GetResponse(query, _scp) // Studies .Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData); return(studyUids.Select(r => r.GetIOD <CFindStudyIOD>())); }
/// <summary> /// Emits a CMove operation to an entity which moves an image from the entity to the specified AETitle /// </summary> /// <param name="scp">the provider which will perform the move</param> /// <param name="sopUid">the uid of the image to be moved</param> /// <param name="patientId">the patient id of the image</param> /// <param name="toAETite">the entity title which will receive the image</param> /// <param name="msgId">the message id</param> /// <returns>the move response</returns> public CMoveResponse SendCMove(CFindInstanceIOD iod, string toAETite, ref ushort msgId) { var result = new CMoveIOD { QueryLevel = QueryLevel.IMAGE, SOPInstanceUID = iod.SOPInstanceUID }; var request = new CMoveRequest(result, toAETite, Root.STUDY, Core.Enums.Priority.MEDIUM, msgId); return(_scu.GetResponse <CMoveResponse, CMoveRequest>(request, callingEntity, ref msgId)); }
/// <summary> /// Emits a CStore operation to an entity which moves an image to the specified entity /// </summary> /// <param name="dcm">the DICOM object to send</param> /// <param name="msgId">the message Id of this message</param> /// <returns>a C-Store response of the operation</returns> public CStoreResponse SendCStore(DICOMObject dcm, ref ushort msgId) { dcm.RemoveMetaHeader(); var request = GenerateCStoreRequest(dcm, msgId); return(_scu.GetResponse <CStoreResponse, CStoreRequest>(request, callingEntity, ref msgId)); }
public static void WithSeries(this IEnumerable <CFindResponse> cFinds, DICOMSCU scu, Entity daemon) { var iods = cFinds.Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData) .Where(r => r.Data.Elements.Any(e => e.Tag == TagHelper.STUDY_INSTANCE_UID)) .Where(r => !string.IsNullOrEmpty(r.Data.Elements.First(e => e.Tag == TagHelper.STUDY_INSTANCE_UID).DData as string)) .Select(r => r.GetIOD()) .ToList(); iods.ForEach(i => i.QueryLevel = QueryLevel.SERIES); foreach (var iod in iods) { var req = new CFindRequest(iod, Root.STUDY); var seriesUids = scu.GetResponse(req, daemon) .Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData) .Where(r => r.Data.Elements.Any(e => e.Tag == TagHelper.SERIES_INSTANCE_UID)) .Select(r => new { // Study = study, Series = r.Data.GetSelector().SeriesInstanceUID.Data, Modality = r.Data.GetSelector().Modality.Data }) .ToList(); System.Console.Write(""); } }
public List <StudyResult> GetStudyUids(string patientId) { var query = new CFindIOD(QueryLevel.STUDY) { PatientId = patientId }; var req = new CFindRequest(query, Root.STUDY); var studyUids = _scu.GetResponse(req, _scp) // Studies .Where(r => r.Status == (ushort)Status.PENDING) .Where(r => r.HasData) .ToList(); return(studyUids.Select(r => new StudyResult() { PatientId = query.PatientId, StudyUid = r.Data.GetSelector().StudyInstanceUID.Data }) .ToList()); }