Exemplo n.º 1
0
        public async Task <ConvertDataResponse> Process(ConvertDataRequest convertRequest, CancellationToken cancellationToken)
        {
            var templateCollection = await _convertDataTemplateProvider.GetTemplateCollectionAsync(convertRequest, cancellationToken);

            var result = GetConvertDataResult(convertRequest, new Hl7v2TemplateProvider(templateCollection), cancellationToken);

            return(new ConvertDataResponse(result));
        }
Exemplo n.º 2
0
        public async Task <ConvertDataResponse> Process(ConvertDataRequest convertRequest, CancellationToken cancellationToken)
        {
            var templateCollection = await _convertDataTemplateProvider.GetTemplateCollectionAsync(convertRequest, cancellationToken);

            ITemplateProvider templateProvider = GetTemplateProvider(convertRequest.InputDataType, templateCollection);

            if (templateProvider == null)
            {
                // This case should never happen.
                _logger.LogError("Invalid input data type for conversion.");
                throw new RequestNotValidException("Invalid input data type for conversion.");
            }

            var result = GetConvertDataResult(convertRequest, templateProvider, cancellationToken);

            return(new ConvertDataResponse(result));
        }