Affects Version/s: None
Fix Version/s: OpenMRS 2.0
Sprint:RA Iteration 8
The demo data included in the core OpenMRS release is insufficient for showing the functionality of the reference application. (Particularly, it has no visit data.)
We need a demo dataset with visits, that can be optionally loaded up the first time you load the reference application.
This ticket must be implemented in a way that it takes no more than 2 days of work. It's okay to implement fewer features, but do not let the ticket expand to take more time.
Add functionality to the referencedemodata module to generate demo patients programmatically.
Add a "referencedemodata.createDemoPatientsOnNextStartup" global property, defaulting to 0.
In the referencedemodata activator, if the global property is set to a positive integer, then create that many demo patients, and clear that global property.
For each demo patient we create:
- Randomly generate the patient's name by combining some given and family names from a list
- Age of patients should be randomly between 16 years and 90 years, with birthdateEstimated = false
- Each patient should have (randomly) 0-10 visits
- random start datetime in the last 2 years (but not before patient's birthdate)
- Each visit should have a Vitals encounter (with random vitals) 1-60 minutes after visit startdatetime
- Each visit should have a Visit note (with 1-2 random coded diagnoses. 5% of the time, also add a non-coded diagnosis) 60-120 minutes after visit startdatetime
- 75% of these patients should have their visit stopDatetime set 30 minutes after their Visit Note encounter
- the other 25% of these patients should be admitted as inpatients, i.e. have an Admission encounter, then a Discharge encounter 1-3 days later (and the visit endDatetime the same as the discharge encounter's datetime)