Implemented assigning pids on save
Changed get-next-patient-id to return the patient id instead of the entire document
Revert "Changed get-next-patient-id to return the patient id instead of the entire document"

This reverts commit 9721a63091104f2a09f3ef2e6f305ce7663b0640.