From 410a91f104c76a35b22f534fbdce0e89878ab996 Mon Sep 17 00:00:00 2001 From: amuleke Date: Tue, 10 Sep 2019 02:50:21 +0300 Subject: [PATCH 1/2] Create solution.md file A file to give a description of the solution needed --- proposals/solution.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 proposals/solution.md diff --git a/proposals/solution.md b/proposals/solution.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/proposals/solution.md @@ -0,0 +1 @@ + From 539785cbd52ed901ae2e223bce01437a009fe207 Mon Sep 17 00:00:00 2001 From: amuleke Date: Tue, 10 Sep 2019 04:11:16 +0300 Subject: [PATCH 2/2] Creation of the solution proposal --- proposals/solution.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/proposals/solution.md b/proposals/solution.md index 8b13789..4b88c16 100644 --- a/proposals/solution.md +++ b/proposals/solution.md @@ -1 +1,21 @@ +# MedHack Solution Proposal +### The Process + +To convert the raw CSV's to the provided standard format I would take the following steps: + +- Using a python script I would recursively read each line of the CSV to check if its a header row by checking for delimition e.g comma or pipe using Regex. The script will allow for the delimeter to be specified, but the default will be a comma. Any line that is read and found not to be a header row will deleted until the header row is found. +- Once the header row has been found, the next step will be to align the file's columns to MedHack's standard format. +- I will start by identifying the required fields [itemName, hospitalId, Currency, Price] using a script that uses regex and string functions to evaluate the header row's columns +- I will then attempt to extract any additional optional fields that will be available as per the standard format. +- I will then create a column map for the raw CSV file that is aligned with MedHack's standard format +- Finally, once the column map is ready, I will proceed to generate a new file that has the data in the raw CSV in MedHack's required standard format. + +### Tools & Utilities + +The tools I have used before for similar tasks and ones I am likely to use inlcude: + +- Bash, Awk & Sed +- Python +- PHP +- Pentaho