Ejemplo n.º 1
0
        public async Task <ActionResult <ConceptEquivalentHint> > SearchEquivalent(
            string term,
            [FromServices] IConceptHintSearchEngine searchEngine
            )
        {
            log.LogInformation("Searching Equivalent Concept Codes By Term:{Term}", term);
            try
            {
                var hints = await searchEngine.SearchEquivalentAsync(term);

                return(Ok(hints));
            }
            catch (Exception ex)
            {
                log.LogError("Could not search concept equivalent hint. Term:{Term} Error:{Error}", term, ex.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <ConceptHint> > > SearchHints(
            [FromQuery] Guid?rootParentId,
            [FromQuery] string term,
            [FromServices] IConceptHintSearchEngine searchEngine
            )
        {
            log.LogInformation("Searching Concepts By Term:{Term}", term);
            try
            {
                var terms = term.Split(' ');
                var hints = await searchEngine.SearchAsync(rootParentId, terms);

                return(Ok(hints));
            }
            catch (Exception ex)
            {
                log.LogError("Could not search concept hints. Term:{Term} Error:{Error}", term, ex.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }