pentominos:pidiod
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pentominos:pidiod [2009/04/27 09:46] – jsc | pentominos:pidiod [2010/04/27 12:03] (current) – jsc | ||
---|---|---|---|
Line 7: | Line 7: | ||
* Map Genuine IDs to locations | * Map Genuine IDs to locations | ||
* Detect if a Patient or Operator IDs are used instead of Pseudo IDs | * Detect if a Patient or Operator IDs are used instead of Pseudo IDs | ||
- | * Resolve | + | * Solve Locations to Patient and Operator |
+ | * Solve Pseudo IDs to Genuine | ||
* Automatic removal of expired maps | * Automatic removal of expired maps | ||
- | |||
- | ===== Failure ===== | ||
- | |||
- | * Pseudo ID not registered | ||
- | * Genuine ID invalid (out of scope) | ||
- | * Location has no mapped Operator ID and/or Genuine ID | ||
- | * Difference between ID types | ||
- | |||
- | ===== Design ===== | ||
==== Terminology ==== | ==== Terminology ==== | ||
Line 25: | Line 17: | ||
* Operator ID (op_id): A string s of 4 digits where s[0] > 3 | * Operator ID (op_id): A string s of 4 digits where s[0] > 3 | ||
* Patient ID (pa_id): A string s of 10 characters where s[0] < = 3 (how does this comply with dummy CPR?) | * Patient ID (pa_id): A string s of 10 characters where s[0] < = 3 (how does this comply with dummy CPR?) | ||
- | * Location: A logical | + | * Location: A location of an Apparatus |
+ | |||
+ | ===== Pitfalls ===== | ||
+ | |||
+ | * Pseudo ID not registered | ||
+ | * Genuine ID invalid (out of scope) | ||
+ | * Location has no mapped Operator ID and/or Genuine ID | ||
+ | * Difference between ID types (It must be possible to skelne between ID types) | ||
+ | |||
+ | ===== Design ===== | ||
==== Tables ==== | ==== Tables ==== | ||
- | * [A]: location_patientid_operatorid: (VARCHAR | + | * [A]: location: (VARCHAR |
- | * [B]: pseudoid_patientid: (VARCHAR ps_id, VARCHAR pa_id, TIMESTAMP create_time, | + | * [B]: idmap: (VARCHAR ps_id, VARCHAR pa_id, TIMESTAMP create_time, |
- | * [C]: pseudoid_operatorid: | + | |
+ | ==== Database maintenance ==== | ||
+ | |||
+ | Data maintenance is done every time a table is written too or read from. | ||
==== Protocol ==== | ==== Protocol ==== | ||
- | Format is as follow: ("< | + | Format is as follow: ("< |
Example: | Example: | ||
< | < | ||
Send: | Send: | ||
- | | + | |
- | "id: <my_id>\r\n" | + | "id1: <id> |
- | " | + | "id2: <another id> |
- | "ttl: <my_ttl>\r\n" | + | " |
- | "\r\n" | + | "ttl: <ttl> |
+ | " | ||
Answer (on success): | Answer (on success): | ||
- | "OK\r\n" | + | "status: |
+ | "msg: <STATUS MSG> | ||
+ | "\n" | ||
</ | </ | ||
- | Ie. every line terminated by "\r\n" and each parameter takes an argument and has its own line. The request is terminated by "\r\n". NOTE! An answer can be a list similar to input parameters. | + | Ie. every line terminated by " |
- | === (" | + | === (" |
- | Put ID (Genuine or Pseudo) on location with ttl. The server detects type of ID. | + | Put IDs (Genuine or Pseudo) on location with ttl. |
- | === (" | + | === (" |
- | Get list of Genuine IDs mapped to location. | + | Get list of IDs (Genuine IDs) mapped to location. |
- | === (" | + | === (" |
- | Clear location from Genuine IDs. | + | Clear all IDs (Genuine IDs) on location. |
- | === (" | + | === (" |
- | Map Pseudo ID to Genuine ID with ttl. | + | Map Pseudo ID to Genuine ID with ttl. Note! One of the IDs must be a Pseudo ID. |
- | === (" | + | === (" |
Unmap Pseudo ID from a genuine ID. | Unmap Pseudo ID from a genuine ID. | ||
+ | |||
+ | === (" | ||
+ | Lookup of ID mapped to id and its type (of the mapped to id). | ||
+ | |||
+ | |||
+ | ===== TODO ===== | ||
+ | |||
+ | ==== Next Version ==== | ||
+ | * {{: | ||
+ | * {{: | ||
+ | * {{: | ||
+ | * {{: | ||
+ | |||
+ | ==== Current Version ==== |
pentominos/pidiod.txt · Last modified: 2010/04/27 12:03 by jsc