ilabafrica/iBLIS — pull request #77 by mapesa (2014-09-22 07:51:08+00:00)
Title: Create test view

@briankip, @ereng, @kitsao : Please read and comment.

This is long over due and fixes #63 .

To answer @ereng on where this link should be placed, I've placed it in the "patient-details" view. This is because we first need to select the patient for whom we wish to create a test.

Some dynamics (and assumptions) of this feature are as follows:
- To create a test you need a `visit_id, specimen_id, test_type_id`
- A **new visit is created for every test request**. This may present a **problem** in the case of in-patients since ideally they are on one and the same visit from when they are admitted to when they are discharged. This would also be the case for any patient who has tests requested at different times. Perhaps we'll have to think of explicitly closing visits. Any tests requested while there is an open visit are assigned to it.
- To get a `specimen_id`, we **have to create a default specimen record for each test** that can be updated at the reception (the reception process is yet to be implemented [new issue]). ![rr](https://cloud.githubusercontent.com/assets/998745/4352819/0a94cdea-422b-11e4-8c57-b6ee07983238.png) I think this answers @ereng 's question in #76. The default specimen and the confirmation form at the reception is necessary because of the many to many relationship between TestTypes and SpecimenTypes.

I also need your feedback on how you think we should **handle requesting physicians**.
- Should they be users existing on the system (`users` table or a new `physicians` table)? Thus we'll have a *drop down* where one (with appropriate permissions) can select the physician. If the user creating the test has no permissions allowing him to specify a requesting physician, we'll assume that the logged on user is also the requesting physician.
- Should we leave it as *free text* entry that accepts any input? Please bear in mind the full accountability required by the system.