gov.va.medora.mdws.AccountLib.visitSites C# (CSharp) Method

visitSites() public method

Visit multiple data sources after a login.
Requires a previous login so the credentials are already in mySession and are not altered. Can visit a single source or multiple sources. Sources may be VAMCs, VISNs, some combination of VAMCs and VISNs, or the entire VHA. See the sourceList parameter.
public visitSites ( string pwd, string sourceList, string permissionString ) : TaggedTextArray
pwd string Client app's BSE security phrase
sourceList string /// A comma-delimited list of station numbers and/or VISN IDs, as in /// "402,550" or "V12,V22" or "V1,V2,456". To visit all VistA systems set the param /// to "*". Duplicate station #'s are ignored. ///
permissionString string If blank defaults to CPRS context
return gov.va.medora.mdws.dto.TaggedTextArray
        public TaggedTextArray visitSites(string pwd, string sourceList, string permissionString)
        {
            TaggedTextArray result = new TaggedTextArray();

            if (mySession == null || mySession.SiteTable == null)
            {
                result.fault = new FaultTO("No site table");
            }
            else if (sourceList == "")
            {
                result.fault = new FaultTO("Missing sitelist");
            }
            else if (mySession.Credentials == null)
            {
                result.fault = new FaultTO("Cannot use this method without previous login");
            }
            if (result.fault != null)
            {
                return result;
            }

            Site[] sites = MdwsUtils.parseSiteList(mySession.SiteTable, sourceList);
            List<DataSource> sources = new List<DataSource>(sites.Length);
            for (int i = 0; i < sites.Length; i++)
            {
                for (int j = 0; j < sites[i].Sources.Length; j++)
                {
                    if (sites[i].Sources[j].Protocol == "VISTA" ||
                        sites[i].Sources[j].Protocol == "FHIE" || sites[i].Sources[j].Protocol == "XVISTA")
                    {
                        sources.Add(sites[i].Sources[j]);
                    }
                }
            }
            return setupMultiSourceQuery(pwd, sources, permissionString);
        }

Same methods

AccountLib::visitSites ( string pwd, string sourceList, string userSitecode, string userName, string DUZ, string permissionStr ) : TaggedTextArray
AccountLib::visitSites ( string pwd, string sourceList, string userSitecode, string userName, string DUZ, string SSN, string permissionStr ) : TaggedTextArray

Usage Example

Ejemplo n.º 1
0
        public TaggedTextArray sitesHavePatch(string sitelist, string patchId)
        {
            TaggedTextArray result = new TaggedTextArray();

            //if (mySession.ConnectionSet.Count == 0 || !mySession.ConnectionSet.IsAuthorized)
            //{
            //    result.fault = new FaultTO(NO_CONNECTIONS);
            //}
            if (String.IsNullOrEmpty(sitelist))
            {
                result.fault = new FaultTO("Missing sitelist");
            }
            else if (String.IsNullOrEmpty(patchId))
            {
                result.fault = new FaultTO("Missing patchId");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                AccountLib      acctLib = new AccountLib(mySession);
                TaggedTextArray sites   = acctLib.visitSites(mySession.MdwsConfiguration.AllConfigs[ConfigFileConstants.PRIMARY_CONFIG_SECTION][MdwsConfigConstants.SERVICE_ACCOUNT_PASSWORD],
                                                             sitelist, MdwsConstants.CPRS_CONTEXT);

                ToolsApi         api = new ToolsApi();
                IndexedHashtable t   = api.hasPatch(mySession.ConnectionSet, patchId);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            finally
            {
                mySession.ConnectionSet.disconnectAll();
            }
            return(result);
        }
All Usage Examples Of gov.va.medora.mdws.AccountLib::visitSites