Esempio n. 1
0
        public TaggedLabTestArrays getLabTests(string target)
        {
            TaggedLabTestArrays result = new TaggedLabTestArrays();

            if (MdwsUtils.isAuthorizedConnection(mySession) != "OK")
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }

            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                LabsApi api = new LabsApi();
                return(new TaggedLabTestArrays(api.getTests(mySession.ConnectionSet, target)));
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return(result);
        }
Esempio n. 2
0
    /// <summary>
    /// US:852
    /// transfers static lab test information from mdws to the vappct database
    /// </summary>
    /// <param name="strSearch"></param>
    /// <returns></returns>
    public CStatus GetMDWSLabTests(string strSearch)
    {
        if (String.IsNullOrEmpty(strSearch))
        {
            return(new CStatus(false, k_STATUS_CODE.Failed, "TODO"));
        }

        //check to make sure the MDWS connection is valid
        CStatus status = IsMDWSValid();

        if (!status.Status)
        {
            return(status);
        }

        string strNextSearch = strSearch.Substring(0, 1).ToUpper();
        string strSrch       = strNextSearch;

        while (true)
        {
            TaggedLabTestArrays la = GetMDWSSOAPClient().getLabTests(strSrch);
            if (la == null || la.fault != null)
            {
                //return new CMDWSStatus(la.fault);
                return(new CStatus(false, k_STATUS_CODE.Failed, "TODO"));
            }

            //transfer the patients to the checklist db
            long          lCount   = 0;
            CMDWSTransfer transfer = new CMDWSTransfer(this);
            status = transfer.TransferLabTestArray(
                la,
                out lCount,
                out strNextSearch);
            if (!status.Status)
            {
                return(status);
            }

            /*
             * this was not working?
             * if (String.IsNullOrEmpty(strNextSearch)
             || strNextSearch.Substring(0, 1).ToUpper() == strSearch.Substring(0, 1).ToUpper())
             ||{
             || break;
             ||}*/

            if (String.IsNullOrEmpty(strNextSearch))
            {
                break;
            }

            if (strNextSearch.Substring(0, 1).ToUpper() != strSearch.Substring(0, 1).ToUpper())
            {
                break;
            }

            strSrch = strNextSearch;
        }

        return(status);
    }