Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The data is provided in a CSV file format. Each line represents a single dose of one of the four medicines and includes the following

The data is provided in a CSV file format. Each line represents a single dose of one of the four medicines and includes the following data:
A UUID of the patient
The patient's first and last names,
The patient's blood type (A, B, AB, or O)
An date/time when the medication was administered in the ISO 8601 format (so that it is lexicographically ordered)
The medicine and dosage (in mg)
An example:
e3aab55e-697b-4949-b312-42f6018f0daa,Tim,Carlson,A,2022-03-13T05:58:26,Xpensiv,220
Patients can and will appear multiple times (one for each dose of each medication they received). We have provided code that loads up data file(s) in this format in a data representation (see the provided files).
Report 1: Totals Report
Your first task is to produce a report of the total number of doses and total number of milligrams (mg) for each medication. Your report should look like the following.
Dose and Dosage Total Report
Nodiathol Kihpliva Xpensiv Playceibitol
Doses 3923810
Dosage 5230252011701520
Report 2: Blood Type Counts
We need to verify how many unique patients are in the data and how many of each blood type we have for further research. Take care: the same patient (identified by a UUID) may appear many times in the data and should not be counted more than once for this report.
Your report should look like the following:
Blood Type Patient Total Report
A 2
B 4
AB 3
O 4
Total 13
Report 3: Bad Dosage Data Report
The data provided was compiled from several different sources, including data entered by medical professionals, some reported by patients and from inventory records. It is possible that dosages were reported incorrectly. For that reason, LSP Inc has compiled a second set of data and wants you to find any differences between the two data sets.
In the first data set (the same one you used to produce the above reports), for each record: find the record in the second data set (identified by having the same patient UUID and date/time) and report it if either the medicine or the dosage is different or, if the record cannot be found in the second data set, report it as missing. Your report should look like the following and all data anomalies should be reported in order of patient (by UUID), then by date.
Bad Dosage Data Report:
Missing record:
Thomas, David (6ca06d8a-274e-4179-8a2f-20cf2510b18a, AB) Playceibitol 210mg on 2022-02-23T00:30:06
Incorrect Dosage:
Long, April (940ec4f3-6c32-4050-9998-9809fb9fd910, O) Nodiathol 220mg on 2022-04-27T02:48:32
Long, April (940ec4f3-6c32-4050-9998-9809fb9fd910, O) Nodiathol 210mg on 2022-04-27T02:48:32
Missing record:
Sanders, Brandy (f0a1c85b-78bd-40a0-9fd6-54d9745f2acf, O) Xpensiv 50mg on 2022-03-13T16:01:31
Incorrect Medicine:
Sanders, Brandy (f0a1c85b-78bd-40a0-9fd6-54d9745f2acf, O) Xpensiv 180mg on 2022-03-26T08:24:01
Sanders, Brandy (f0a1c85b-78bd-40a0-9fd6-54d9745f2acf, O) Nodiathol 180mg on 2022-03-26T08:24:01
Incorrect Dosage:
Anderson, Jeffrey (f496f9ad-a888-4ea6-8d98-4c8f3270bda4, O) Nodiathol 210mg on 2022-03-05T20:15:07
Anderson, Jeffrey (f496f9ad-a888-4ea6-8d98-4c8f3270bda4, O) Nodiathol 120mg on 2022-03-05T20:15:07
Incorrect Medicine:
Anderson, Jeffrey (f496f9ad-a888-4ea6-8d98-4c8f3270bda4, O) Nodiathol 170mg on 2022-08-16T05:59:56
Anderson, Jeffrey (f496f9ad-a888-4ea6-8d98-4c8f3270bda4, O) Xpensiv 170mg on 2022-08-16T05:59:56
Total Missing Patient Data records: 2
Total Incorrect Medicine records: 2
Total Incorrect Dosage records: 2
Take care: a naive, brute-force approach will not work.
Instructions
Write a program that accepts two input files as command line arguments, processes the two files, and outputs the reports above to the standard output. Two input examples have been provided for you to troubleshoot and debug your program. Your output should provide the same information as the output in this handout, but the exact formatting does not need to match.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

50 Tips And Tricks For MongoDB Developers Get The Most Out Of Your Database

Authors: Kristina Chodorow

1st Edition

1449304613, 978-1449304614

More Books

Students also viewed these Databases questions

Question

=+2. What are the organization's relationship goals on this issue?

Answered: 1 week ago