public DeepLearningLabelMapConfiguration(IResourceQueryHandler <GetImageRecognitionLabelMap, string> getLabelMapsHandler)
 {
     if (getLabelMapsHandler == null)
     {
         throw new ArgumentNullException(nameof(getLabelMapsHandler));
     }
     _getLabelMapsHandler = getLabelMapsHandler;
 }
        public ImageDifferenceHandwrittenInputExtractor(
            IResourceQueryHandler <GetCanvasBitmapForTemplatePage, TemplatePageCanvasBitmapResource> canvasBitmapQueryHandler)
        {
            if (canvasBitmapQueryHandler == null)
            {
                throw new ArgumentNullException(nameof(canvasBitmapQueryHandler));
            }

            _canvasBitmapQueryHandler = canvasBitmapQueryHandler;
        }
        public DeepLearningHandwrittenInputRecognizer(
            DeepLearningLabelMapConfiguration labelMapConfiguration,
            IResourceQueryHandler <GetImageRecognitionModel, byte[]> getRecognitionModelHandler)
        {
            if (getRecognitionModelHandler == null)
            {
                throw new ArgumentNullException(nameof(getRecognitionModelHandler));
            }
            _labelMapConfiguration = labelMapConfiguration ?? throw new ArgumentNullException(nameof(labelMapConfiguration));

            _getRecognitionModelHandler = getRecognitionModelHandler;
        }
Ejemplo n.º 4
0
        public GetDocumentToProcessHandler(IImageProcessingPersistenceConfiguration persistenceConfiguration,
                                           IResourceQueryHandler <GetBitmapsForDocumentToProcess,
                                                                  FileStorageRequestResult <ICollection <OrderedBitmapResource> > > getDocumentBitmapsHandler,
                                           IQueryHandler <GetTemplateDefinitionById, TemplateDefinition> getTemplateById)
        {
            if (persistenceConfiguration == null)
            {
                throw new ArgumentNullException(nameof(persistenceConfiguration));
            }
            if (getDocumentBitmapsHandler == null)
            {
                throw new ArgumentNullException(nameof(getDocumentBitmapsHandler));
            }
            if (getTemplateById == null)
            {
                throw new ArgumentNullException(nameof(getTemplateById));
            }

            _persistenceConfiguration  = persistenceConfiguration;
            _getDocumentBitmapsHandler = getDocumentBitmapsHandler;
            _getTemplateById           = getTemplateById;
        }
        public FhirResponse Handle(IKey key)
        {
            Validate.HasTypeName(key);
            Validate.HasResourceId(key);
            Validate.HasNoVersion(key);
            Validate.Key(key);

            var hl7Type = key.TypeName.GetHl7ModelType();

            //Startup.AutofacContainer.Resolve<ISynapseResourceService<CorePerson>>();

            var modelFactory = this._provider.GetService(typeof(ResourceQueryHandlerFactory)) as ResourceQueryHandlerFactory;

            IResourceQueryHandler synapseModelHandler = modelFactory.GetHandler(hl7Type);

            var fhirParam = FHIRParam.Create(key.TypeName, key.ResourceId, key.VersionId);

            var resourceData = synapseModelHandler.Handle(fhirParam);

            var fhirResponseFactory = this._provider.GetService(typeof(IFhirResponseFactory)) as IFhirResponseFactory;

            return(fhirResponseFactory.GetFhirResponse(resourceData, key));
        }