Exemplo n.º 1
0
        private QueryResponse ExecuteQuery(string query)
        {
            if (string.IsNullOrWhiteSpace(query))
            {
                throw new ArgumentException("message", nameof(query));
            }


            var headerParams  = Expressions.Constants.HeaderDefault.Headers;
            var serviceConfig = _integrationServicesConfiguration.GetConfigurationService(IntegrationServicesConfiguration.ConfigurationServicesName.SNOWSTORM);
            var endpoint      = serviceConfig.GetEndPoint(IntegrationService.ConfigurationEndPointName.SNOWSTORM_FIND_CONCEPTS);

            var urlFriendly = $"{endpoint.FriendlyURL}?{query}";
            var url         = $"{endpoint.URL}?{query}";

            var client = new HttpConsumer.SnowstormRequest(headerParams);
            var ret    = client.Get <QueryResponse>(url);

            var activityLog = new ActivityLog
            {
                ActivityRequest          = $"{url}",
                ActivityRequestUI        = $"{urlFriendly}",
                ActivityTypeDescriptorId = (int)Entities.Activity.ActivityType.SNOWSTORM_FIND_CONCEPTS,
                ActivityResponse         = $"Conceptos obtenidos Limite:{ret.Limit} sobre un Total de:{ret.Total}",
                RequestIsURL             = true
            };

            _currentContext.RegisterActivityLog(activityLog);

            return(ret);
        }
Exemplo n.º 2
0
        public RefsetQueryCie10MapResponse RunQueryCie10MapRefset(string sctConceptId)
        {
            if (string.IsNullOrWhiteSpace(sctConceptId))
            {
                throw new ArgumentException("message", nameof(sctConceptId));
            }

            var referenceSetId = "447562003"; //CIE10 Mapeo de Snowmed a CIE10.

            var query         = $"referenceSet={referenceSetId}&referencedComponentId={sctConceptId}&active=true&offset={0}&limit={50}";
            var serviceConfig = _integrationServicesConfiguration.GetConfigurationService(IntegrationServicesConfiguration.ConfigurationServicesName.SNOWSTORM);
            var endpoint      = serviceConfig.GetEndPoint(IntegrationService.ConfigurationEndPointName.SNOWSTORM_REFSET_MEMBERS);

            var urlFriendly = $"{endpoint.FriendlyURL}?{query}";
            var url         = $"{endpoint.URL}?{query}";

            var client = new HttpConsumer.SnowstormRequest(Expressions.Constants.HeaderDefault.Headers);
            var ret    = client.Get <RefsetQueryCie10MapResponse>(url);

            var activityLog = new ActivityLog
            {
                RequestIsURL             = true,
                ActivityRequest          = url,
                ActivityRequestUI        = urlFriendly,
                ActivityTypeDescriptorId = (int)Entities.Activity.ActivityType.SNOWSTORM_FIND_CONCEPTS,
                ActivityResponse         = $"Buesqueda Mapeo CIE10. Conceptos obtenidos Limite:{ret.Limit} sobre un Total de:{ret.Total}"
            };

            _currentContext.RegisterActivityLog(activityLog);

            return(ret);
        }