Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

ernonewman/CareHomeData

Repository files navigation

CareHomeData

Introduction

The things we do for friends, try 2.

Getting Started

You need to download and install the .Net Core SDK.

VS Code is the suggested minimum code editor but please feel free to use what ever editor you are comfortable with, most of the instructions here will be for compiling and running this application from the command line.

Start by cloning the repository and changing the working directory:

git clone https://github.com/ernonewman/CareHomeData.git
cd CareHomeData

Build and Test

First ensure you have restored all the dependencies:

dotnet restore

The compile and build the solution.

dotnet build

Lastly, to run the project type:

dotnet run --project CareHomeData.Ui.Console

Updating the ProviderDetail model

Just some quick instructions on making changes to the ProviderDetail model class in case you want to make updates.

  1. Ensure you have the .NET EF Core global tool installed:
dotnet tool install --global dotnet-ef
  1. Uncomment the property in the ProviderDetail.cs file.

  2. Copy and paste one of the "if" statements in the UpdateIndividualDetails method in the Worker.cs file and update with the property you uncommented.

  3. Add an Entity Framework migration script using the below command, substituting the "NameOfMigration" value with something appropriate.

dotnet ef migrations add NameOfMigration
  1. Update the database schema
dotnet ef database update

Now just re-run the program and the data should update.

Removing a property is basically the same instructions with you just needing to comment out the property and the existing "if" statement for it.

Exporting the data to a CSV

So we're just using a work-around for this currently by using the SQLite Manager for Google Chrome™ extension and then using the following instructions:

  1. Open the Extension page by clicking on it's icon in the Chrome toolbar.

  2. Click on/hover over the "File" button and select the "Open a Database" option.

  3. Browse to the location of CareHomeData.Ui.Console source code and select "cqc.db" file.

  4. Click on/hover over the "SQLite" button and from the "Querying Data" group, select the "Query all data from a table" option.

  5. Change the query text from SELECT * FROM table_name limit 100 to SELECT * FROM ProviderDetails and press the Enter/Return key.

  6. You will then get a pop-up warning from SQLite Manager for Google Chrome™ stating "Printing a large table in this view could make your browser unresponsive for several minutes..." which you can just click "OK" for.

  7. Depending on the table size, you might also get a pop-up warning from Chrome stating that "The Page has become unresponsive" for which you can just click on the "Wait" button for.

  8. Eventually the query will finish running and you will be presented with a table listing all the data.

  9. In the top, left-hand corner of the table there is a "Export" button which will create and download the data as a CSV file.

Contribute

Seeing I just built this quickly for Edon, I haven't though contribution instructions through. 🤷🏽‍♂️

About

The things we do for friends, try 2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages