{"action":"opened","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/1079","repository_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/1079/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/1079/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/1079/events","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/issues/1079","id":195793421,"number":1079,"title":"(design) Barcodes for Entities using Partial UUIDs","user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"labels":[{"id":317367720,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels/design","name":"design","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T12:27:50Z","updated_at":"2016-12-15T12:27:50Z","closed_at":null,"body":"In bhima, we provide both globally unique identifiers and human readable identifiers (#1069) in a one-to-one mapping, to allow efficient lookups of data by both users and code.  These are being re-examined to provide a better and more uniform user experience in #1069.\r\n\r\nA fast, efficient way to store and retrieve information is via barcodes (#1066).  We cannot use either UUIDs or human readable ids for barcodes because:\r\n 1. UUIDs are 32 characters long and are therefore impractical.\r\n 2. Human Readable IDs do not have a size constraint on them and will grow logarithmically in size.\r\n\r\n**Proposal**\r\nAn acceptable compromise might be to store only a subset of the characters of the UUID.  Coupled with the Human-Readable prefix, we can have a standard way creating barcodes.\r\n\r\nThe barcodes will consist of:\r\n ```\r\n${Human Readable Prefix}${First 12 characters of the UUID}\r\n```\r\nfor a total of 14 characters to be rendered.  All dashes are stripped from the UUID before conversion.  All barcodes will be rendered in [CODE128](https://en.wikipedia.org/wiki/Code_128).\r\n\r\n_Example_\r\nGiven the Patient Invoice LUK12 with UUID `007a20fa-d01c-4c68-ad0d-67a7f3b4fa06` in the current system, our barcode would be `IV007a20fad01c`.\r\n\r\nNote that by only using partial UUIDs, we may run into a duplication.  This is not a problem for rendering the barcode, but all modules scanning the barcode should be sure to return a `Barcode Unreadable` error if there are more than one match - the user will have to put in the Human Readable ID to have a completely unique match."}}
{"actor":{"display_login":"jniles"}}