Beispiel #1
0
        public CernerHelper()
        {
            if (String.IsNullOrEmpty(_whichSection))
            {
                _whichSection = "SmartOnFhirConfiguration";
            }

            SMARTonFhirConfigurationSection configSection =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/" + _whichSection);

            string myBaseFhirUrl = configSection.FhirDataTargets.BaseFhirUrl;

            cci.ClientId = configSection.FhirTokens.AppClientId;

            cci.BaseURL           = configSection.FhirDataTargets.BaseFhirUrl;
            cci.ServiceIdentifier = configSection.FhirDataTargets.ServiceIdentifier;
            cci.AppSecret         = configSection.FhirTokens.AppSecret;
            cci.FHIRVersionFolder = configSection.FhirDataTargets.FHIRVersionFolder;

            //BaseURI = baseUri;
            cci.ServiceURI = new Uri(new Uri(cci.BaseURL), cci.FHIRVersionFolder + cci.ServiceIdentifier);

            string tempServiceIdentifier = @"/" + cci.ServiceIdentifier + @"/metadata";

            //cci.ConformanceUrl = cci.ServiceURL
            //cci.ConformanceUri = new Uri(cci.ServiceURL tempServiceIdentifier);
            string tempString01 = cci.ServiceUrl;
            string tempUri01    = (tempServiceIdentifier);
        }
        public void CernerConfigGetFhirVersionFolder01()
        {
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration01");

            string myFhirVersionFolder = sfconfig.FhirDataTargets.FHIRVersionFolder;

            Assert.AreEqual("dstu2/", myFhirVersionFolder);
        }
        public void CernerConfigGetBaseFhirUrl01()
        {
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration01");

            string myBaseFhirUrl = sfconfig.FhirDataTargets.BaseFhirUrl;

            Assert.AreEqual("https://fhir-ehr.sandboxcerner.com/dstu2", myBaseFhirUrl);
        }
        public void CernerConfigGetAppSecret01()
        {
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration01");

            string myAppSecret = sfconfig.FhirTokens.AppSecret;

            Assert.AreEqual(testAppSecret, myAppSecret);
        }
        public void CernerConfigGetServiceIdentifier01()
        {
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration01");

            string myServiceIdentifier = sfconfig.FhirDataTargets.ServiceIdentifier;

            Assert.AreEqual(testServiceIdentifier, myServiceIdentifier);
        }
Beispiel #6
0
        public void CernerConfigGetAppClientId01()
        {
            SMARTonFhirConfigurationSection tempSfconfig = new SMARTonFhirConfigurationSection();

            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration");

            string myAppClientId = sfconfig.FhirTokens.AppClientId;

            Assert.AreEqual(testAppClientId, myAppClientId);
        }
        public void CernerConfigGetAppClientId02()
        {
            string configSectionToGet = "SMARTonFhirConfigurationGroup/" + _whichSectionToGet;

            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    configSectionToGet);

            string myAppClientId = sfconfig.FhirTokens.AppClientId;

            Assert.AreEqual(testAppClientId, myAppClientId);
        }
        public void CernerConfigGetGroup01()
        {
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
                    "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration01");

            string myBaseFhirUrl = sfconfig.FhirDataTargets.BaseFhirUrl;

            //Count of parent level items.
            Assert.AreEqual(3, sfconfig.ElementInformation.Properties.Count);
            //Count of items under FhirDataTargets.
            Assert.AreEqual(3, sfconfig.FhirDataTargets.ElementInformation.Properties.Count);
            //Count of items under FhirTokens.
            Assert.AreEqual(2, sfconfig.FhirTokens.ElementInformation.Properties.Count);
        }
        public CernerHelper()
        {
            //cci.ClientId = ConfigurationManager.AppSettings["ida:AppClientId"];

            //cci.BaseURL = ConfigurationManager.AppSettings["ida:BaseFhirUrl"];
            //cci.ServiceIdentifier = ConfigurationManager.AppSettings["ida:ServiceIdentifier"];
            //cci.AppSecret = ConfigurationManager.AppSettings["ida:AppSecret"];
            //cci.FHIRVersionFolder = ConfigurationManager.AppSettings["ida:FHIRVersionFolder"];
            _whichSectionToGet = ConfigurationManager.AppSettings["WhichSmartOnFhirConfigurationToUse"];

            //SMARTonFhirConfigurationSection sfconfig =
            //  (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(
            //  "SMARTonFhirConfigurationGroup/SmartOnFhirConfiguration");
            string configSectionToGet = "SMARTonFhirConfigurationGroup/" + _whichSectionToGet;
            SMARTonFhirConfigurationSection sfconfig =
                (SMARTonFhirConfigurationSection)ConfigurationManager.GetSection(configSectionToGet);

            cci.ClientId = sfconfig.FhirTokens.AppClientId;

            cci.BaseURL           = sfconfig.FhirDataTargets.BaseFhirUrl;
            cci.ServiceIdentifier = sfconfig.FhirDataTargets.ServiceIdentifier;
            cci.AppSecret         = sfconfig.FhirTokens.AppSecret;
            cci.FHIRVersionFolder = sfconfig.FhirDataTargets.FHIRVersionFolder;

            //BaseURI = baseUri;
            cci.ServiceURI = new Uri(new Uri(cci.BaseURL), cci.FHIRVersionFolder + cci.ServiceIdentifier);

            string tempServiceIdentifier = @"/" + cci.ServiceIdentifier + @"/metadata";

            //cci.ConformanceUrl = cci.ServiceURL
            //cci.ConformanceUri = new Uri(cci.ServiceURL tempServiceIdentifier);
            string tempString01 = cci.ServiceUrl;
            string tempUri01    = (tempServiceIdentifier);

            //cci.ConformanceUri = new Uri(tempString01, tempUri01);  //tempServiceIdentifier);

            //cci.ConformanceUri = new Uri(tempString01, tempServiceIdentifier);
        }