Hospital Search Example 1

Searching by city and state

User input is in bold.

$ python3 search-hospital.py

To help consumers make informed decisions about health care,
the Centers for Medicare & Medicaid Services collects data
about the cost and quality of care at over 4,000 Medicare
qualified hospitals.

This program allows you to explore this data.

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 0
Invalid choice, try again.


1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 5
Invalid choice, try again.


1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 1

Enter city: Swarthmore
Enter state: PA

Sorry, no matches were found.

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 1

Enter city: Ames
Enter state: IA

            HOSPITAL NAME         CITY ST RATING HEART($) PNEUM($) HIPKN($)
------------------------- ------------ -- ------ -------- -------- --------
Mary Greeley Medical Cent         Ames IA      4    22543    16406    20960

1 match found

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 1

Enter city: Lincoln
Enter state: NE

            HOSPITAL NAME         CITY ST RATING HEART($) PNEUM($) HIPKN($)
------------------------- ------------ -- ------ -------- -------- --------
     Bryan Medical Center      Lincoln NE      3    26686    17552    22951
Chi Health Nebraska Heart      Lincoln NE      5    28251        0        0
  Chi Health St Elizabeth      Lincoln NE      3    24848    17908    20265
Lincoln Surgical Hospital      Lincoln NE     -1        0        0    19480

4 matches found
Average of reported ratings: 3.7 (-1 means not reported)

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 1

Enter city: Pittsburgh
Enter state: PA

            HOSPITAL NAME         CITY ST RATING HEART($) PNEUM($) HIPKN($)
------------------------- ------------ -- ------ -------- -------- --------
Allegheny General Hospita   Pittsburgh PA      1    25479    19793    18622
Children's Home Of Pittsb   Pittsburgh PA     -1        0        0        0
Magee Womens Hospital Of    Pittsburgh PA      3        0    16295    20613
        St Clair Hospital   Pittsburgh PA      5    23627    18211    21249
The Children's Institute    Pittsburgh PA     -1        0        0        0
Upmc Children's Hospital    Pittsburgh PA     -1        0        0        0
               Upmc Mercy   Pittsburgh PA      2    23720    20420    25478
           Upmc Passavant   Pittsburgh PA      4    23155    16813    22784
Upmc Presbyterian Shadysi   Pittsburgh PA      1    26543    18708    21361
         Upmc St Margaret   Pittsburgh PA      3    24766    17922    22229
       West Penn Hospital   Pittsburgh PA      3    27651    21367    21494

11 matches found
Average of reported ratings: 2.8 (-1 means not reported)

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 1

Enter city: Philadelphia
Enter state: PA

            HOSPITAL NAME         CITY ST RATING HEART($) PNEUM($) HIPKN($)
------------------------- ------------ -- ------ -------- -------- --------
Albert Einstein Medical C Philadelphia PA      1    24954    17784    26336
              Aria Health Philadelphia PA      2    24188    19259    23101
Cancer Treatment Centers  Philadelphia PA      3        0        0        0
   Chestnut Hill Hospital Philadelphia PA      3    24409    18808    24351
Children's Hospital Of Ph Philadelphia PA     -1        0        0        0
Hahnemann University Hosp Philadelphia PA      1    23575    19902    26404
Hospital Of Univ Of Penns Philadelphia PA      3    25346    18444        0
          Jeanes Hospital Philadelphia PA      4    24487    16806    23341
      Kensington Hospital Philadelphia PA     -1        0        0        0
        Nazareth Hospital Philadelphia PA      2    24009    19744    19691
Penn Presbyterian Medical Philadelphia PA      4    23340    16061    22936
    Pennsylvania Hospital Philadelphia PA      2    24667    16058    23603
Roxborough Memorial Hospi Philadelphia PA      2    24743    20956        0
Shriners Hospitals For Ch Philadelphia PA     -1        0        0        0
St Christopher's Hospital Philadelphia PA     -1        0        0        0
Temple University Hospita Philadelphia PA      2    25411    18759    23817
Thomas Jefferson Universi Philadelphia PA      1    23738    17427    18490
       Wills Eye Hospital Philadelphia PA     -1        0        0        0

18 matches found
Average of reported ratings: 2.3 (-1 means not reported)

1. Search by city and state
2. Search by hospital name
3. Quit
Choice: 3

Goodbye!