Ejemplo n.º 1
0
        public bool Import(IImportComponent component)
        {
            var connection = new SQLiteConnection(string.Format("Data Source={0};Version=3;", this.path));
            IEnumerable <PatientDto> result = new List <PatientDto>();

            try
            {
                this.OnLogged(Messages.Log_StartImporting);

                var patients = new PatientImporter(connection, component);
                patients.Logged          += (sender, e) => this.OnLogged(e.Data);
                patients.ProgressChanged += (sender, e) => this.OnProgressChanged(e.Data);

                patients.Import();

                this.OnLogged(Messages.Log_EndImporting);
                this.OnProgressChanged(100);
            }
            catch (Exception ex)
            {
                this.HandleError(ex);
            }
            finally
            {
                if (connection.State != ConnectionState.Closed)
                {
                    connection.Close();
                }
            }

            return(this.hasError);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        public WorkbenchViewModel()
        {
            this.component = PluginContext.ComponentFactory.GetInstance <IImportComponent>();
            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IImportComponent>();

            this.ChooseOldDbCommand = new RelayCommand(() => this.ChooseOldDb());
            this.ImportCommand      = new RelayCommand(() => this.Import(), () => this.CanImport());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        public WorkbenchViewModel()
        {
            this.component = PluginContext.ComponentFactory.GetInstance<IImportComponent>();
            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IImportComponent>();

            this.ChooseOldDbCommand = new RelayCommand(() => this.ChooseOldDb());
            this.ImportCommand = new RelayCommand(() => this.Import(), () => this.CanImport());
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public IllnessPeriodImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InsuranceImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public InsuranceImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component, "Insurance")
 {
 }
Ejemplo n.º 6
0
 public PatientImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReputationImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public ReputationImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component, "Reputation")
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReputationImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public PracticeImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component, "Practice")
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public MedicalRecordImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 10
0
 public TagImporter(SQLiteConnection connection, IImportComponent component, TagCategory category, string table)
     : base(connection, component, category.ToString())
 {
     this.Table    = table;
     this.Category = category;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleImporter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public SingleImporter(SQLiteConnection connection, IImportComponent component, string segragator)
     : base(connection, component)
 {
     this.Default    = default(T);
     this.Segragator = segragator;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public DoctorImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public PictureImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 14
0
 public BaseImporter(SQLiteConnection connection, IImportComponent component)
 {
     this.Logger     = LogManager.GetLogger(this.GetType());
     this.Connection = connection;
     this.Component  = component;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleImporter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public MultipleImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public PrescriptionImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 17
0
        public bool Import(IImportComponent component)
        {
            var connection = new SQLiteConnection(string.Format("Data Source={0};Version=3;", this.path));
            IEnumerable<PatientDto> result = new List<PatientDto>();
            try
            {
                this.OnLogged(Messages.Log_StartImporting);

                var patients = new PatientImporter(connection, component);
                patients.Logged += (sender, e) => this.OnLogged(e.Data);
                patients.ProgressChanged += (sender, e) => this.OnProgressChanged(e.Data);

                patients.Import();

                this.OnLogged(Messages.Log_EndImporting);
                this.OnProgressChanged(100);
            }
            catch (Exception ex)
            {
                this.HandleError(ex);
            }
            finally
            {
                if (connection.State != ConnectionState.Closed) connection.Close();
            }

            return this.hasError;
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReputationImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public PathologyImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component, "Pathology")
 {
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DoctorImporter"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public AppointmentImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
Ejemplo n.º 20
0
 public PatientImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }