Patient List Design Discussion

Want to create a "Patient List". Therefore we need to retrieve "unassigned patients" from openMrs.

Steps:

  1. create a person.
  2. make person become a patient. 

    *person --> patient
    *needs identifier and location
    *each identifier needs to be unique in "space and time". 
    -sencha doesn't yet provide this directly. But we need this. **should figure a way to get unique identifier for a device
    -hlocation is tied to a different device. this means that each patient will be unique.

  3. each patient is going to have an associated "registration encounter". each patient can have another encounter type called "screener encounter"
    (we may be concerned that a screener should be able to request a flexible, variable set of observations (blood pressure, etc))

    REST call: /patientlist/uuid   <= here is the unique identifier for the patientlist type. one patientlist for registration, one for screener, one for doctor encounters
    name: screenerList (or registrationList, doctorList, etc)
    desc: Patients who have registration encounters today (or whichever date) but no screener encounter
    searchQuery: ?encounterType=registration&startDate=....&endDate=.....&inList=<uuid for registration list>&notInList=<uuid for screener list>
    --> to find the 'unscreened patients', we need to find everyone who is in the registration list, but not in the screener list (they have a registration encounter but no screener encounter)

    What should we return? The simplest solution is to return a list of patient resources. 
    But this means to find the observations we need to screen (such as BMI) we would have to do GET calls for each patient, total of possibly 100 GET calls just for screener list to load

    Instead, the Query should return not only a list of patients, but also all the observations linked to those patients and that encounterType
    --> for example, say a registration encounter recorded height and weight, we would return height and weight from the Query

Questions Discussed: 

**How to share views if 2 different modules use the same view? Best not to do any hard URL links, make all views within an app soft-linked. Use symbolic links to link to one shared javascript file. The controller code will be similar between the 2 apps, but loading time will be faster.

*how efficient is it to make extra rest calls per patient in the patient list (to retrieve BMI)... esp if e.g. 100 patients are being screened? Need to figure out limitations of making 100s of REST calls againts OpenMRS

*Related to 1st question... What information should we send back, exactly, when we return the patient list. Just ID, or more meta data? More metadata could make us have less rest calls. Decided on more meta data.