Depending on how unscheduled visits are displayed on the x-axis, the chart can have some unintended behavior.
(See related issue for Results Over Time: RhoInc/safety-results-over-time#43)
If visits are displayed purely chronologically, the challenge is that you end up creating a new event type that shows up in the middle of the data, but for only a small number of data points. See example of visits 2.1 and 4.1 below:
![image](https://user-images.githubusercontent.com/10886203/34954341-08e08bfa-f9ee-11e7-8ba5-b5fa2dd45047.png)
Our primary medical monitor user has proposed that to fix this, we sort all Unscheduled visits to the far right end of the chart, where they are still visible, but they don't interfere with seeing the data flow through expected visits. The problem here is that the chart sometimes connects these points in a non-linear way:
![example2](https://user-images.githubusercontent.com/10886203/34954556-d23ae194-f9ee-11e7-9c94-9aaf9f0b5146.jpg)
Proposed solutions:
- Retain visits in numerical order, but create a toggle that lets the user "Hide unscheduled visits"
- Force the chart to connect the dots in the same order as the axis is drawn
Test notes
Test out the new "Visits without data" and "Unscheduled visits" controls in CAT with the safetyData/ADBDS.csv data file (not safetyData-queries/ADBDS.csv).
Confirm that:
- Unscheduled Visits and Visits with no data are shown/hidden when the toggle changes.
- Change measure to "Alkaline Phosphatase (ALP)" and confirm that visits with no data are shown/hidden when the toggle changes.
- Test with the above with groups active (settings: {groups:["RACE"]})
- Unscheduled visits are shown on initial load with {"unscheduled_visits":true}
- Visits with no data are shown on initial load with {"visits_without_data": false}
- Only the visits are hidden/shown when explicitly specified using {unscheduled_visit_values:["Unscheduled 2.1","Screening"]}