logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Dan CurnowwComputer science
(5/5)

519 Answers

Hire Me
expert
David BennettBusiness
(5/5)

723 Answers

Hire Me
expert
Wayne FlynnManagement
(5/5)

538 Answers

Hire Me
expert
Manall ChiiguerNursing
(5/5)

773 Answers

Hire Me
Others
(5/5)

load the dictionary you will have to parse each line by finding the first and second spaces

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 

1.       From the file PatientsName.txt, load a dictionary of key-value pairs: ID (key), Name (value).  Store the name as "last, first".

2.       After adding the line of code to ignore the first line in the data file, to load the dictionary you will have to parse each line by finding the first and second spaces.  (The spaces are shown here using yellow.)

           FB2ABB23 Levy Cody

3.       Having used the slice method to obtain the ID (0:8), the lastName (firstSpPos+1:secondSpPos), and the firstName (secondSpPos:), make the appropriate addition to the dictionary as follows:
                ID_Names_dict[ID] = lastName + ', ' + firstName

 
4.       Then use the strategy found on page 135 of the textbook to sort the dictionary by value (the names, in this case), and then write out the first ten to demonstrate that your code works properly.  Sample output is shown below.

 

Part B

What is the name of a patient with a specific ID?

1.       Use the dictionary you built in 13a above to help answer this question.

2.       Write a code segment to find the patient name of the following IDs: 69CC25ED, C65A4ADE,  98F593D2.  Also look up 11111111 which doesn't exist; the program should respond with "No patient with that ID.” Keep looking up patient names until “done” is entered as an ID.

The following strategy will guide the process:

# Strategy
#  From the file PatientsName.txt, load a dictionary of ID, Name ("last, first") pairs
#  prompt the user for an ID,
#  use the ID to find the name in the dictionary
#    terminate on ID of 'done'
#    use the looping strategy on page 71 of the text book to solicit the ID (or            "done")

 
 Sample output is shown in the 13B screen shot.
 Part C

What are the names (and IDs) of the patients with a diagnosis including the term “adrenal?”

 

The Diagnoses.txt file contains the patient ID, an admit ID, the ICD-10 code, and the diagnosis code textual description.  Loop through the file, finding the lines containing the word “adrenal”.  From that line, extract the ID.  Then use the dictionary you created in 13a above to get the name.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme