public IActionResult CreateCustomer([FromBody] searchRequest req)
        {
            var res  = new SingleRsp();
            var reqq = _svc.SearchRequest();

            res.Data = reqq;
            return(Ok(res));
        }
        public virtual async System.Threading.Tasks.Task <SearchResult> searchAsync(SearchRecord searchRecord)
        {
            var request = new searchRequest()
            {
                passport          = passport,
                tokenPassport     = tokenPassport,
                applicationInfo   = applicationInfo,
                partnerInfo       = partnerInfo,
                searchPreferences = searchPreferences,
                searchRecord      = searchRecord,
            };
            var response = await((NetSuitePortType)this).searchAsync(request);

            return(response.searchResult);
        }
Beispiel #3
0
 public virtual searchResponse Search(searchRequest request)
 {
     throw new NotImplementedException();
 }
 public override searchResponse Search(searchRequest request)
 {
     var results = _.MusicRepository.Search(request.term);
     return new searchResponse(results.ToMediaList(request.index, request.count));
 }
Beispiel #5
0
 public virtual searchResponse Search(searchRequest request)
 {
     throw new NotImplementedException();
 }
        // NEW WITH Win 8 - Calls to TriageTrak/PL Search functions:
        /// <summary>
        /// Gets all reports for the specified event, from the current hospital.  Caller must filter more, to narrow. To get reports from all orgs, set myOrgOnly=false.
        /// </summary>     
        public async Task<string> GetReportsForOutboxImpl(string eventShortName, bool myOrgOnly) // was, but now uses global token: (string userPL, string passwordPL)
        {
            App.MyAssert(App.pd.plToken != null && App.pd.plToken.Length == 128); // token is 128 char long SHA-512
            //searchWithAuthRequest sarin = new searchWithAuthRequest(); // Before V31: named searchCompleteWithAuth
            //searchWithAuthResponse sarout = new searchWithAuthResponse();
            searchRequest srin = new searchRequest();
            searchResponse srout = new searchResponse();
            srin.token = App.pd.plToken;
            //sarin.username = userPL;
            //sarin.password = passwordPL;
            // "sarin" replaced by "srin", "sarout" replaced by "srout" many places below
            srin.eventShortname = eventShortName; // moved to caller Feb 2015: App.CurrentDisaster.EventShortName;
            // was v33: srin.filterAgeAdult = srin.filterAgeChild = srin.filterAgeUnknown = true;
            // was v33: srin.filterGenderMale = srin.filterGenderFemale = srin.filterGenderComplex = srin.filterGenderUnknown = true;
            string Uuid = "";
            if(myOrgOnly)
                Uuid = "all";
            else
            {
                string Name = App.CurrentOrgContactInfo.OrgName;
                Uuid = App.OrgDataList.GetOrgUuidFromOrgName(Name);
                if (Uuid == "") // couldn't find match
                {
                    App.MyAssert(false);
                    //Uuid = App.OrgDataList.First().OrgUuid;
                    //Name = App.OrgDataList.First().OrgName;
                }
            }
            // was v33: srin.filterHospital = Uuid; // instead of "" or "all" = don't filter on orgs.
            srin.filters = PackageFiltersIntoSearchParameter(Uuid);
            // WAS before v32: sarin.filterHospitalSH = sarin.filterHospitalWRNMMC = sarin.filterHospitalOther = true;
            // was v33: srin.filterStatusAlive = srin.filterStatusInjured = srin.filterStatusDeceased = srin.filterStatusMissing = srin.filterStatusUnknown = srin.filterStatusFound = true;
            // was v33: srin.filterHasImage = false;  // true would return ONLY reports with images
            srin.pageStart = 0; // was v33: "0";
            srin.perPage = 250; // was v33: "250"; // "1000";  If you change this, change it too in TP_PatientReportsSource.cs.  1000 seemed to be running out of memory
            srin.sortBy = ""; // = updated desc, score desc
            srin.query = ""; // was v33: srin.searchTerm = "";
            srin.photo = ""; // if empty, means "use query instead".
            try
            {
                SetPLEndpointAddress(App.pl); //read the configured endpoint address

                if(App.BlockWebServices)
                    throw new Exception(PHONY_COMMUNICATIONS_EXCEPTION);

                // Win 7: responseData = App.pl.getEventListUser(userPL, passwordPL, out errorCode, out errorMessage);
                //sarout = await App.pl.searchWithAuthAsync(sarin);
                srout = await App.pl.searchAsync(srin);
            }
            // Also available with v34, but not used here: srout.recordsFound; srout.timeElapsed
            catch (Exception e)
            {
                srout.resultSet = "ERROR: " + e.Message; // Win 7: responseData = "ERROR: " + e.Message;
            }

            return ChangeToErrorIfNull(srout.resultSet);
        }
        // NEW July, 2015:
        /// <summary>
        /// Does a quick checks if candidate Patient ID is already in use for current event, independent of submitter or submitting organization.
        /// This is to supplement check of local data (which is limited to this submitter in the case of Outbox, or may be stale in the case of All Stations.
        /// </summary>
        /// <param name="patientID"></param>
        /// <returns>-1 = don't know; 0 = no; 1 = yes</returns>
        public async Task<int> IsPatientIdAlreadyInUseForCurrentEvent(string patientID)
        {
            // This is a variant of GetReportsFromAllStationsCurrentEvent()
            App.MyAssert(App.pd.plToken != null && App.pd.plToken.Length == 128); // token is 128 char long SHA-512
            searchRequest srin = new searchRequest();
            searchResponse srout = new searchResponse();
            srin.token = App.pd.plToken;
            srin.eventShortname = App.CurrentDisaster.EventShortName;
            // NOT WORKING AS CLAIMED, ACTS AS IF hasImage=true
            // srin.filters = ""; // Spec says this means all filters are true, except hasImage is false and hospital defaults to "all".
            // Equivalently in effect, if not in verbosity:
            srin.filters = PackageFiltersIntoSearchParameter("all");
            srin.pageStart = 0;
            srin.perPage = 250;
            srin.sortBy = ""; // = updated desc, score desc
            srin.query = patientID;
            srin.photo = ""; // if empty, means "use query instead".
            try
            {
                SetPLEndpointAddress(App.pl); //read the configured endpoint address

                if (App.BlockWebServices)
                    throw new Exception(PHONY_COMMUNICATIONS_EXCEPTION);

                srout = await App.pl.searchAsync(srin);
            }
            // Also available with v34, but not used here: srout.recordsFound; srout.timeElapsed
            catch (Exception)
            {
                return -1; // Error. Don't know
            }
            if (srout.resultSet == null || srout.errorCode != 0)
                return -1; // Error. Don't know

            if ((srout.resultSet == "") || (srout.recordsFound == 0))
                return 0;

            return 1; // 1 or more records found. In theory multiple means some problem, but let's ignore that for now
        }
        // NEW WITH Win 8 - Calls to PL Search functions:
        /// <summary>
        /// Gets all reports for the current event, independent of submitter or submitting organization.
        /// This is in support of client-side filtering.
        /// </summary>
        public async Task<string> GetReportsFromAllStationsCurrentEvent()// was, but not needed now: (string userPL, string passwordPL)
        {
            App.MyAssert(App.pd.plToken != null && App.pd.plToken.Length == 128); // token is 128 char long SHA-512
            //searchWithAuthRequest sarin = new searchWithAuthRequest(); // Before V31: named searchCompleteWithAuth
            //searchWithAuthResponse sarout = new searchWithAuthResponse();
            searchRequest srin = new searchRequest();
            searchResponse srout = new searchResponse();
            //sarin.username = userPL;
            //sarin.password = passwordPL;
            srin.token = App.pd.plToken;
            //sarin.eventShortname = App.CurrentDisaster.EventShortName;
            // v33, replace "sarin" with "srin" many times below
            srin.eventShortname = App.CurrentDisaster.EventShortName;
            // NOT WORKING AS CLAIMED, ACTS AS IF hasImage=true
            // srin.filters = ""; // Spec says this means all filters are true, except hasImage is false and hospital defaults to "all".
            // Equivalently in effect, if not in verbosity:
            srin.filters = PackageFiltersIntoSearchParameter("all");
            // was v33: srin.filterAgeAdult = srin.filterAgeChild = srin.filterAgeUnknown = true;
            // was v33: srin.filterGenderMale = srin.filterGenderFemale = srin.filterGenderComplex = srin.filterGenderUnknown = true;
/* NO.  Always get all records here.  Filter later
            if(App.OutboxCheckBoxMyOrgOnly)
            {
                string Name = App.CurrentOrgContactInfo.OrgName;
                string Uuid = App.OrgDataList.GetOrgUuidFromOrgName(Name);
                if (Uuid == "") // couldn't find match
                {
                    App.MyAssert(false);
                    //Uuid = App.OrgDataList.First().OrgUuid;
                    //Name = App.OrgDataList.First().OrgName;
                }
                sarin.filterHospital = Uuid;
            }
            else
            {
                // spec says: sarin.filterHospital = ""; // empty = don't filter on orgs; otherwise, [but not implemeneted] comma-separated org shortnames
                // What Greg chose to implement instead is single hospital uuid  */
                // was v 33: srin.filterHospital = "all"; // temporary workaround
            //}
            // WAS before V32: sarin.filterHospitalSH = sarin.filterHospitalWRNMMC = sarin.filterHospitalOther = true;
            // was v33: srin.filterStatusAlive = srin.filterStatusInjured = srin.filterStatusDeceased = srin.filterStatusMissing = srin.filterStatusUnknown = srin.filterStatusFound = true;
            // was v33: srin.filterHasImage = false; // true would return ONLY reports with images
            srin.pageStart = 0; // was v33: "0";
            srin.perPage = 250; // was v33: "250"; // 1000 gave out of memory problems
            srin.sortBy = ""; // = updated desc, score desc
            srin.query = ""; // was v 33: srin.searchTerm = "";
            srin.photo = ""; // if empty, means "use query instead".
            try
            {
                SetPLEndpointAddress(App.pl); //read the configured endpoint address

                if(App.BlockWebServices)
                    throw new Exception(PHONY_COMMUNICATIONS_EXCEPTION);

                // Win 7: responseData = App.pl.getEventListUser(userPL, passwordPL, out errorCode, out errorMessage);
                //sarout = await App.pl.searchWithAuthAsync(sarin);
                srout = await App.pl.searchAsync(srin);
            }
            // Also available with v34, but not used here: srout.recordsFound; srout.timeElapsed
            catch (Exception e)
            {
                // WAS: sarout
                srout.resultSet = "ERROR: " + e.Message; // Win 7: responseData = "ERROR: " + e.Message;
            }

            return ChangeToErrorIfNull(srout.resultSet); // WAS before v33: sarout
        }
Beispiel #9
0
        public override searchResponse Search(searchRequest request)
        {
            var results = _.MusicRepository.Search(request.term);

            return(new searchResponse(results.ToMediaList(request.index, request.count)));
        }
Beispiel #10
0
        public override searchResponse Search(searchRequest request)
        {
            var results = MusicRepository().Search(request.term);

            return(new searchResponse(results.DirectoryToSonosResponse(request.index, request.count)));
        }