public override StudyItemList Query(QueryParameters queryParams, object targetServer)
        {
            ApplicationEntity selectedServer = (ApplicationEntity)targetServer;

            StudyItemList list = new StudyItemList();

            foreach (var key in MINTApi.GetStudies(selectedServer.Host))
            {
                var item = new StudyItem(key.StudyUid, key, MINTApi.LoaderName);

                MINTApi.FillStudyItem(item, key);
                list.Add(item);
            }

            return(list);
        }
        public static IEnumerable <StudyKey> ParseStudiesResponse(string serviceUri, Stream xmlStream)
        {
            var doc = ReadDocFromStream(xmlStream);

            var keys = new List <StudyKey>();

            foreach (XmlNode child in doc.ChildNodes)
            {
                if (child.Name == "studySearchResults")
                {
                    var studyUIDNodes = child.ChildNodes;
                    if (studyUIDNodes == null)
                    {
                        continue;
                    }

                    foreach (XmlNode node in studyUIDNodes)
                    {
                        // Get MINT UID.
                        var studyUUID = node.Attributes.GetNamedItem("studyUUID");
                        if (studyUUID == null)
                        {
                            throw new LoadStudyException("Unknown", "MINT studyUUID is null");
                        }

                        string metaUri    = "/MINTServer/studies/" + studyUUID.Value + "/DICOM/metadata";
                        string summaryUri = "/MINTServer/studies/" + studyUUID.Value + "/DICOM/summary";

                        // Get the DICOM UID
                        string studyInstanceUID = MINTApi.GetStudyInstanceUID(serviceUri, studyUUID.Value);
                        if (studyInstanceUID == null)
                        {
                            throw new LoadStudyException(studyUUID.Value, "Study Instance UID attribute missing in summary");
                        }

                        keys.Add(new StudyKey(serviceUri, studyInstanceUID, metaUri, summaryUri));
                    }
                }
            }

            return(keys);
        }
        private static MINTApi.StudyKey MINTStudyKey(StudyItem studyItem)
        {
            MINTApi.StudyKey key = studyItem.Server as MINTApi.StudyKey;
            if (key == null && Properties.Settings.Default.EnableXRef)
            {
                //we must be looking at studies listed in another server - see if the study is available in
                //the MINT service and cache it if it is.
                if (!_cachedKeys.TryGetValue(studyItem.StudyInstanceUid, out key))
                {
                    key = MINTApi.GetStudyKey(Properties.Settings.Default.MINTHostname,
                                              studyItem.StudyInstanceUid);

                    if (key != null)
                    {
                        _cachedKeys[studyItem.StudyInstanceUid] = key;
                    }
                }
            }
            return(key);
        }
 private XmlDocument RetrieveHeaderXml()
 {
     return(MINTApi.GetStudyMetadata(_studyKey));
 }