public DocumentsServices(IOptions <ExternalApiSetting> externalApiSetting, IOptions <ApiSetting> apiSetting, ISdsService sdsService, IFhirConnector fhirConnector)
 {
     _spineSettings = externalApiSetting.Value;
     _apiSettings   = apiSetting.Value;
     _sdsService    = sdsService;
     _fhirConnector = fhirConnector;
 }
 public DocumentReferenceServices(IOptions <ExternalApiSetting> externalApiSetting, IOptions <ApiSetting> apiSetting, IMemoryCache cache)
 {
     _spineSettings = externalApiSetting.Value;
     _apiSettings   = apiSetting.Value;
     _cache         = cache;
 }
Exemplo n.º 3
0
 public OrganisationServices(IOptions <ExternalApiSetting> externalApiSetting)
 {
     _odsSettings = externalApiSetting.Value;
 }
 public OrganisationServices(IOptions <ExternalApiSetting> externalApiSetting, IFhirConnector fhirConnector)
 {
     _odsSettings   = externalApiSetting.Value;
     _fhirConnector = fhirConnector;
 }
Exemplo n.º 5
0
        public DocumentsServiceTests()
        {
            var extApiOpts = new ExternalApiSetting
            {
                NrlsServerUrl = new Uri("http://nrl-server.com"),

                NrlsSecureServerUrl = new Uri("http://nrl-secure-server.com"),

                NrlsUseSecure = false,

                NrlsDefaultprofile = "nrl-profile",

                SspServerUrl = new Uri("http://ssp-server.com"),

                SspSecureServerUrl = new Uri("http://ssp-secure-server.com"),

                SspUseSecure = false,

                SspSslThumbprint = "ssp-thumbprint",

                PdsServerUrl = new Uri("http://ssp-server.com"),

                PdsSecureServerUrl = new Uri("http://ssp-secure-server.com"),

                PdsUseSecure = false,

                PdsDefaultprofile = "pds-profile",

                OdsServerUrl = new Uri("http://ssp-server.com"),

                OdsSecureServerUrl = new Uri("http://ssp-secure-server.com"),

                OdsUseSecure = false,

                OdsDefaultprofile = "ods-profile",

                SpineAsid = "9999999999",

                SpineThumbprint = "SpineThumbprint",
            };

            var apiOpts = new ApiSetting
            {
                BaseUrl               = "://localhost",
                Secure                = false,
                SecureOnly            = false,
                DefaultPort           = "55448",
                SecurePort            = "55443",
                SupportedContentTypes = new List <string> {
                    "application/fhir+xml", "application/fhir+json"
                }
            };

            var extApiMock = new Mock <IOptions <ExternalApiSetting> >();

            extApiMock.Setup(op => op.Value).Returns(extApiOpts);

            var apiMock = new Mock <IOptions <ApiSetting> >();

            apiMock.Setup(op => op.Value).Returns(apiOpts);

            var sdsMock = new Mock <ISdsService>();

            sdsMock.Setup(op => op.GetFor(It.IsAny <string>())).Returns((SdsViewModel)null);
            sdsMock.Setup(op => op.GetFor(It.Is <string>(x => x == "20000000017"))).Returns(SdsViewModels.SdsAsid20000000017);
            sdsMock.Setup(op => op.GetFor(It.Is <string>(x => x == "002"))).Returns(SdsViewModels.SdsAsid002);

            sdsMock.Setup(op => op.GetFor(It.IsAny <string>(), null)).Returns((SdsViewModel)null);
            sdsMock.Setup(op => op.GetFor(It.Is <string>(x => x == "X27"), It.IsAny <string>())).Returns(SdsViewModels.SdsAsid888);

            var resource = new Binary
            {
                ContentType = "application/pdf",
                Content     = Encoding.UTF8.GetBytes("pdf.bytes")
            };

            var fhirConnectorMock = new Mock <IFhirConnector>();

            fhirConnectorMock.Setup(op => op.RequestOneFhir <CommandRequest, Resource>(It.IsAny <CommandRequest>())).Returns(SystemTasks.Task.Run(() => resource as Resource));

            _extApiMock        = extApiMock.Object;
            _apiMock           = apiMock.Object;
            _sdsMock           = sdsMock.Object;
            _fhirConnectorMock = fhirConnectorMock.Object;
        }
Exemplo n.º 6
0
 public PatientServices(IOptions <ExternalApiSetting> externalApiSetting, IFhirConnector fhirConnector)
 {
     _pdsSettings   = externalApiSetting.Value;
     _fhirConnector = fhirConnector;
 }
Exemplo n.º 7
0
 public PatientServices(IOptions <ExternalApiSetting> externalApiSetting)
 {
     _pdsSettings = externalApiSetting.Value;
 }
 public ClientAsidHelper(IOptions <ExternalApiSetting> apiSettings, IMemoryCache memoryCache)
 {
     _apiSettings = apiSettings.Value;
     _cache       = memoryCache;
 }