public string LaunchProviderPortal()
        {
            if (!System.IO.Directory.Exists(LaunchDirectory))
            {
                System.IO.Directory.CreateDirectory(LaunchDirectory);
            }
            ConfigProfileCollection ConfigProfileList = SerializerSupport.DeserializeFrom <ConfigProfileCollection>(ConfigProfileFilePath);
            var CurrentProfile             = ConfigProfileList.ProfileList.SingleOrDefault(x => x.Key == ConfigProfileList.SelectedProfileKey);
            X509Certificate2      Cert     = CertificateSupport.GetCertificate(CurrentProfile.CertificateFingerPrint, X509FindType.FindByThumbprint, StoreName.My, StoreLocation.CurrentUser, true);
            MhrRestClient         Client   = new MhrRestClient(CurrentProfile.Endpoint, CurrentProfile.ClientId, Cert, CurrentProfile.ProductName, CurrentProfile.ProductVersion);
            MhrRestClientResponse Response = Client.GetAccessToNpp(CurrentProfile.Hpio, CurrentProfile.Hpii, LauncherVM.Dob.ToString("dd-MM-yyyy"), LauncherVM.Gender, LauncherVM.Family, LauncherVM.Ihi, LauncherVM.MedicareNumber, LauncherVM.DvaNumber);

            if (Response.HttpStatus == System.Net.HttpStatusCode.OK)
            {
                System.IO.StreamWriter sw = new System.IO.StreamWriter(FastPassLauncherHtmlFileName);
                sw.WriteLine(Response.Content);
                sw.Close();
                System.Diagnostics.Process.Start(FastPassLauncherHtmlFileName);
                return(string.Empty);
            }
            else
            {
                return($"{Response.Message}");
            }
        }
        public void SaveProfile()
        {
            if (!System.IO.Directory.Exists(ConfigDirectory))
            {
                System.IO.Directory.CreateDirectory(ConfigDirectory);
            }
            var x = new ConfigProfileCollection();

            x.ProfileList        = ConfigVM.ConfigProfileList.ToList();
            x.SelectedProfileKey = ConfigVM.SelectedConfigProfile.Key;
            var SelectedItem = x.ProfileList.Single(y => y.Key == x.SelectedProfileKey);

            SelectedItem.ProfileName = ConfigVM.ProfileName;
            if (ConfigVM.Cert == null)
            {
                SelectedItem.CertificateFingerPrint = "";
            }
            else
            {
                SelectedItem.CertificateFingerPrint = ConfigVM.Cert.FingerPrint ?? "";
                SelectedItem.Hpio = ConfigVM.Cert.Hpio ?? "";
            }

            SelectedItem.Hpii           = ConfigVM.Hpii;
            SelectedItem.ProductName    = ConfigVM.ProductName;
            SelectedItem.ProductVersion = ConfigVM.ProductVersion;
            SelectedItem.ClientId       = ConfigVM.ClientId;
            SelectedItem.Endpoint       = ConfigVM.Endpoint;
            SerializerSupport.SerializeTo(ConfigProfileFilePath, x, x.GetType());
            LoadProfiles();
        }
        public void SaveProfile()
        {
            if (!System.IO.Directory.Exists(ConfigDirectory))
            {
                System.IO.Directory.CreateDirectory(ConfigDirectory);
            }
            var x = new LauncherProfileCollection();

            x.ProfileList        = LauncherVM.LauncherProfileList.ToList();
            x.SelectedProfileKey = LauncherVM.SelectedLauncherProfile.Key;
            var SelectedItem = x.ProfileList.Single(y => y.Key == x.SelectedProfileKey);

            SelectedItem.ProfileName    = LauncherVM.ProfileName;
            SelectedItem.Dob            = LauncherVM.Dob;
            SelectedItem.DvaNumber      = LauncherVM.DvaNumber;
            SelectedItem.Family         = LauncherVM.Family;
            SelectedItem.Gender         = LauncherVM.Gender;
            SelectedItem.Ihi            = LauncherVM.Ihi;
            SelectedItem.MedicareNumber = LauncherVM.MedicareNumber;
            SerializerSupport.SerializeTo(PatientProfileFilePath, x, x.GetType());
            LoadProfiles();
        }
        public void LoadProfiles()
        {
            LauncherProfileCollection LoadedProfiles = SerializerSupport.DeserializeFrom <LauncherProfileCollection>(PatientProfileFilePath);

            if (LoadedProfiles != null)
            {
                var LauncherProfileList = new System.Collections.ObjectModel.ObservableCollection <LauncherProfile>(LoadedProfiles.ProfileList);
                LauncherVM.SelectedProfileName     = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey).ProfileName;
                LauncherVM.LauncherProfileList     = LauncherProfileList;
                LauncherVM.SelectedLauncherProfile = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey);
                LauncherVM.ProfileName             = LauncherVM.SelectedLauncherProfile.ProfileName;
                LauncherVM.Dob            = LauncherVM.Dob;
                LauncherVM.DvaNumber      = LauncherVM.SelectedLauncherProfile.DvaNumber;
                LauncherVM.Family         = LauncherVM.SelectedLauncherProfile.Family;
                LauncherVM.Gender         = LauncherVM.SelectedLauncherProfile.Gender;
                LauncherVM.Ihi            = LauncherVM.SelectedLauncherProfile.Ihi;
                LauncherVM.MedicareNumber = LauncherVM.SelectedLauncherProfile.MedicareNumber;
            }
            else
            {
                NewProfile();
            }
        }
        public void LoadProfiles()
        {
            ConfigProfileCollection LoadedProfiles = SerializerSupport.DeserializeFrom <ConfigProfileCollection>(ConfigProfileFilePath);

            if (LoadedProfiles != null)
            {
                var ConfigProfileList = new System.Collections.ObjectModel.ObservableCollection <ConfigProfile>(LoadedProfiles.ProfileList);
                ConfigVM.SelectedProfileName   = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey).ProfileName;
                ConfigVM.ConfigProfileList     = ConfigProfileList;
                ConfigVM.SelectedConfigProfile = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey);
                ConfigVM.ProfileName           = ConfigVM.SelectedConfigProfile.ProfileName;
                ConfigVM.Cert           = ConfigVM.HpioCertList.SingleOrDefault(x => x.FingerPrint == ConfigVM.SelectedConfigProfile.CertificateFingerPrint);
                ConfigVM.Hpii           = ConfigVM.SelectedConfigProfile.Hpii;
                ConfigVM.ProductName    = ConfigVM.SelectedConfigProfile.ProductName;
                ConfigVM.ProductVersion = ConfigVM.SelectedConfigProfile.ProductVersion;
                ConfigVM.ClientId       = ConfigVM.SelectedConfigProfile.ClientId;
                ConfigVM.Endpoint       = ConfigVM.SelectedConfigProfile.Endpoint;
            }
            else
            {
                NewProfile();
            }
        }