As you can see we are working with the Medicare payment data used in the previous 2 assignments. We will be taking the StateMedicareLedger class built as part of Assignment 9, and enhancing it further. Our changes will make it a little less "state" centric, and so more generic. As a result, we will change its name to MedicareLedger. (Remember, a ledger is an entity that manages detailed Medicare records and produces summary data from the detail.) The primary focus of this assignment will be to allow exploring the Outpatient Services Counts. These Outpatient Services Counts can be explored from many different angles. One way is to segment/stratify this data by combinations of Ambulatory Payment Classification (APC) and Hospital Referral Region (HRR), The interface should allow selecting a specific APC in combination with a specific HRR, and calculate the sum of all Outpatient Services Counts for that combination. The interface should also allow selecting the largest and smallest summary Outpatient Services Counts and display them along with associated APCs and HRRs.
You are being given 3 classes: MedicarePayment, MedicareLedger, and MedicareGUI. Much of the logic in these class is already complete. In order to complete this assignment, you must understand the existing instance variables and methods in each of the classes, and then "add in" any missing logic/code to make the classes function and interact properly so that the program works correctly overall and returns the right results.
Completing this assignment involves:
Leveraging as needed the already created 2 dimensional array in the ledger that stores summary Outpatient Services Counts for each unique combination of APC and HRR.
Modifying the MedicarePayment class' compareTo method to allow for different sorting on different object attributes. This will be done by leveraging static protected class variables.
Writing various missing methods in MedicareLedger. (MedicareLedger class builds on and includes much of the work already done for the StateMedicareLedger class we worked with in Assignment 9). More specifically you must:
Write method to "set" up list of sorted, distinct APCs
Write method to "set" up list of sorted, distinct HRRs
Write method to "get" list of sorted, distinct APCs - will be used to populate combo box as well as index into two dimensional array
Write method to "get" list of sorted, distinct HRRs - will be used to populate combo box as well as index into two dimensional array
Write method to retrieve a specific values from two dimensional array
Write a method to retrieve the smallest summary Outpatient Services counts given a "bottom" limit provided by the end user
The GUI has already been designed. You must add the logic to make it work, by invoking the appropriate class methods.
Two different input files containing medicare payment records are provided. These are the same files used in Assignment 8 and 9. The first is named MedicareData.txt, and contains 2,595 records. The second, named MedicareDataTest.txt, contains 20 records. You should use this second file to simplify your testing and debugging as it has so few records. You should familiarize yourself with these 20 records. As a general rule of thumb, you should also check that data from the first record and last record is handled appropriately, as handling these unique conditions are often where problems arise.
Background Knowledge:
When stratifying by combination of APC and HRR, there will likely by multiple MedicarePayment objects whose Outpatient Services counts will need to be summed
It is therefore prudent to build another array in the ledger to hold summarized OutpatientServices counts. This array will have 2 dimensions, one to index on APC, and the second to index on HRR. Building this 2 dimensional array and storing data in it at the start of the program should improve the overall performance of the interface because it will minimize the need for real-time calculations.
User Interface:
Don't worry too much about making the GUI interface nice. See my simple sample screenprint below - Dont let that constrain your creativity. Use it to help understand what I see as inputs and outputs.
APC and HRR should be selected from combo boxes that are dynamically loaded from the array of objects at the start of your program. They should be in ascending sort order, and contain no duplicates.
Set the font property for text areas displaying top and bottom results to a monospace font, such as Courier. If you combine this with formatting of strings to be placed in these boxes as you build them, the output will appear columnar and be easier to digest.
Count limit should be an integer
Task Details:
Make sure you read the Javadoc documentation on the MedicarePayment class, which can be found in Canvas.
Make sure you read the documentation on the MedicareLedger class, and use as the template for your implementation of the MedicareLedger class.
The skeletons for MedicarePayment class, MedicareLedge class, and MedicareGUI class are all in the same package in the zip file. This should simplify building the project. It's not what you will be wanting to do for later bigger projects, but for right now its OK.
As mentioned for previous assignments, the input file contains one line for every Medicare payment. If you read in a line at a time you are well on your way to creating the ArrayList of medicare payments. There is a MedicarePayment constructor that will be very valuable for creating an object from a string, so consider using it.
Items appearing in RED below are parts you will need to write and add in to the existing classes.
A large part of this assignment is working with a sorted set of objects. You will need to sort in a number of different ways. The means for doing this is two-fold:
Notice that the MedicarePayment class has been revised to include an enumerated type named SortOrder. This enumeration works hand-in-hand with the variable names sortBy. Notice this variable is declared as static, which means it can be referenced at the class level, without declaring an object of the class. Notice it is also declared as protected, which means that other classes in the same package can reference this variable. (Review textbook and Powerpoints slides on static and protected variables - these concepts are critical to your implementation.)
implements Comparable interface and the compareTo method of the MedicarePayment class will once again (as in Assignment 9) be used to implement sorting of MedicarePayment objects. But in this case, you will need to write compareTo method that will need to reference the sortBy variable to determine which field to sort on. SortOrder.APC -- you should sort on APC SortOrder.HRR -- you should sort on HRR SortOrder.STATE - you should sort on State SortOrder.STATEAPC -- you should sort first by State, then by APC
The MedicareLedger class should contain the array list of MedicarePayment objects, same as was done for Assignment 9. Additions to the MedicareLedger class for this assignment include
An array list to hold all APCs, named allApcs
You will need to write a "set" method that sorts MedicarePayments objects by APC. and then loops through the MedicarePayment objects, extracting distinct APC values and adding them to the allApcs list. Extra logic will be needed to avoid adding duplicates.
You will need to write a "get" method that gets all APCs from the list. This is the method the GUI will need to call to populate the APC combo box.
An array list to hold all HRRs, named allHrrs
You will need to write a "set" method that sorts MedicarePayments objects by HRR. and then loops through the MedicarePayment objects, extracting distinct HRR values and adding them to the allHrrs list. Extra logic will be needed to avoid adding duplicates.
You will need to write a "get" method that gets all HRRS from the list. This is the method the GUI will need to call to populate the HRR combo box
The two dimensional array containing summary outpatient services counts stratified by APC and HRR, named apcHrrOutpatientCounts. This 2 dimensional array of integers should have the first dimension represent an APC, and its second dimension represent an HRR. The size of the first dimension should be the number of APCs found in the allApcs list; the size of the second dimension should be the number of HRRs found in the allHrrs list.
You will be provided the "set" method that instantiates the array, and initializes it to all zeroes. It will loop through all MedicarePayment objects and extract APC, HRR, and OutpatientServices count. It will then find the index for APC from allApcs and the index for HRR from allHrrs, and use these indexes to access apcHrrOutpatientCounts and add in the value of OutpatientServices.
You will be provided the "get" method that when passed an APC and HRR as parameters, translates these into indexes, and uses the indexes to return the corresponding value from apcHrrOutpatientCounts
You will need to write a "get" method that when passed an index for the first dimension and an index for the second dimension, uses these indexes to return the corresponding value from apcHrrOutpatientCounts
A method will be provided to "get" the top values in the apcHrrOutpatientCounts array, where top limit is a user specified input. This method creates a copy of apcHrrOutpatientCounts array, find the largest value in it, process it (concatenates value, APC, and HRR combination to growing output string), and resest value in array so that successive iterations to find the top set will ignore this value which has already been processed.
You will need to write a method to "get" the bottom values in the apcHrrOutpatientCounts array, where bottom limit is a user specified input. This method will likely need to create a copy of apcHrrOutpatientCounts array, find the smallest value in it, process it (concatenate value, APC, and HRR combination to growing output string), and reset value in array so that successive iterations to find the bottom set will ignore this value which has already been processed.
You will need to write portions of the GUI class, which should
instantiate the ledger
call method to build list of APCs and then uses that list to populate APC combo box
call method to build list of HRRs and then uses that list to populate HRR combo box
handle logic needed to achieve button actions (calls to various MedicareLedger and MedicarePayments methods)
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.