Ejemplo n.º 1
0
        //Parameter hos (Hospital)
        private static void SerializeHospital(NciUrl url, CTSSearchParams searchParams)
        {
            HospitalLocationSearchParams locParams = (HospitalLocationSearchParams)searchParams.LocationParams;

            if (locParams.IsFieldSet(FormFields.Hospital))
            {
                url.QueryParameters.Add("hos", HttpUtility.UrlEncode(locParams.Hospital));
            }
        }
Ejemplo n.º 2
0
        //Parameter hos (Hospital)
        private static void AddAnalyticsHospital(List <string> waList, CTSSearchParams searchParams)
        {
            string value = "none";
            HospitalLocationSearchParams locParams = (HospitalLocationSearchParams)searchParams.LocationParams;

            if (locParams.IsFieldSet(FormFields.Hospital))
            {
                value = locParams.Hospital;
            }
            waList.Add(value);
        }
Ejemplo n.º 3
0
        // TODO: refactor and clean up names

        /// <summary>
        /// Build the list of query abbreviations from completed search fields.
        /// </summary>
        /// <param name="waList"></param>
        /// <param name="searchParams"></param>
        private static void AddAllUsedParams(List <string> waList, CTSSearchParams searchParams)
        {
            //Parameter t (Main Cancer Type)
            if (searchParams.IsFieldSet(FormFields.MainType))
            {
                waList.Add("t");
            }

            //Parameter st (SubTypes)
            if (searchParams.IsFieldSet(FormFields.SubTypes))
            {
                waList.Add("st");
            }

            //Parameter stg (Stages)
            if (searchParams.IsFieldSet(FormFields.Stages))
            {
                waList.Add("stg");
            }

            //Parameter fin (Findings)
            if (searchParams.IsFieldSet(FormFields.Findings))
            {
                waList.Add("fin");
            }

            // Parameter a (Age)
            if (searchParams.IsFieldSet(FormFields.Age))
            {
                waList.Add("a");
            }

            //Parameter q (Keyword/Phrase)
            if (searchParams.IsFieldSet(FormFields.Phrase))
            {
                waList.Add("q");
            }

            // Parameter g (Gender)
            if (searchParams.IsFieldSet(FormFields.Gender))
            {
                waList.Add("g");
            }

            // Parameter loc (Location, and AtNIH if loc=nih)
            if (searchParams.IsFieldSet(FormFields.Location) || searchParams.IsFieldSet(FormFields.IsVAOnly))
            {
                waList.Add("loc");

                if (searchParams.IsVAOnly)
                {
                    waList.Add("va");
                }

                switch (searchParams.Location)
                {
                case LocationType.Zip:
                {
                    ZipCodeLocationSearchParams locParams = (ZipCodeLocationSearchParams)searchParams.LocationParams;
                    if (locParams.IsFieldSet(FormFields.ZipCode))
                    {
                        waList.Add("z");
                    }
                    if (locParams.IsFieldSet(FormFields.ZipRadius))
                    {
                        waList.Add("zp");
                    }
                    break;
                }

                case LocationType.CountryCityState:
                {
                    CountryCityStateLocationSearchParams locParams = (CountryCityStateLocationSearchParams)searchParams.LocationParams;
                    if (locParams.IsFieldSet(FormFields.Country))
                    {
                        waList.Add("lcnty");
                    }
                    if (locParams.IsFieldSet(FormFields.State))
                    {
                        waList.Add("lst");
                    }
                    if (locParams.IsFieldSet(FormFields.City))
                    {
                        waList.Add("lcty");
                    }
                    break;
                }

                case LocationType.Hospital:
                {
                    HospitalLocationSearchParams locParams = (HospitalLocationSearchParams)searchParams.LocationParams;
                    if (locParams.IsFieldSet(FormFields.Hospital))
                    {
                        waList.Add("hos");
                    }
                    break;
                }

                case LocationType.None:
                {
                    //If the user performed a VA search, then leave loc in place.
                    if (!searchParams.IsVAOnly)
                    {
                        waList.Remove("loc");
                    }
                    break;
                }
                } // End switch
            }     // End if

            // Parameter tt (Trial Type)
            if (searchParams.IsFieldSet(FormFields.TrialTypes))
            {
                waList.Add("tt");
            }

            //Parameter d (Drugs)
            if (searchParams.IsFieldSet(FormFields.Drugs))
            {
                waList.Add("d");
            }

            //Parameter i (Other treatments / interventions)
            if (searchParams.IsFieldSet(FormFields.OtherTreatments))
            {
                waList.Add("i");
            }

            //Parameter i (Other treatments / interventions)
            if (searchParams.IsFieldSet(FormFields.HealthyVolunteers))
            {
                waList.Add("hv");
            }

            // Parameter tp (Trial Phase)
            if (searchParams.IsFieldSet(FormFields.TrialPhases))
            {
                waList.Add("tp");
            }

            // Parameter tid (Trial IDs)
            if (searchParams.IsFieldSet(FormFields.TrialIDs))
            {
                waList.Add("tid");
            }

            // Parameter in (Investigator)
            if (searchParams.IsFieldSet(FormFields.Investigator))
            {
                waList.Add("in");
            }

            // Parameter lo (Lead Org)
            if (searchParams.IsFieldSet(FormFields.LeadOrg))
            {
                waList.Add("lo");
            }
        }