Database Structure

This database structure describes the Person and Group Database (pink) and the Tracking and Tracing Database (yellow) for a Victim Identification, Tracking and Tracing Framework (VITA) in Sahana.

Overview

Entities

PERSON ENTITY

PersonEntity “ This table holds the commomn features of all type of groups and person”

It has 3 fields
UUID : unique identifier
type (foreign key) : Gets type_id from PEType.id, It specifies the type of Person Entity i.e a Group  or an Individual
member : It indicates the number of members in the Person Entity (0 where Type = Individual)

Association “ This table holds the associations between the person entities be it individual to individual or individual to group ” It has 6 fields

pe1_id (foreign): Gets pe_id from PersonEntity.uuid
pe2_id (foreign): Gets pe_id from PersonEntity.uuid
type: Type of association
valid_from: date since when the association exists
valid_till: date till when the association will exist
role: role of associated people

PersonToContact “ This table holds the contact information associated with a Person Entity”

It has 2 fields
pe_id (foreign): Gets pe_id from PersonEntity.uuid
contact_id (foreign): Gets contact_id from ContactDetails.id

ContactDetails “ This table holds all the contact details”

It has 5 fields
id: identifier for the Entity
contact_type (foreign): Gets type_id from ContactType.id
details: contact detail (contact number/email address)
service: Service provider (Gmail, Yahoo,.. / AIRTEL, AT&T)
description: other notes if any

Person “ The table to hold persons”

It has 2 fields
pe_id (foreign): Gets pe_id from PersonEntity.uuid
type (foreign): Gets type_id from PersonType.id, It specifies the PersonType

PersonIdentity “ This table holds all the Identities available for a Person”

It has 3 fields
pe_id (foreign): Gets pe_id from Person.pe_id
type (foreign): Gets type_id from IdentityType.id
detail: details about identity (ID number/link to other features)

PersonName “ This table holds all possible names assigned to a Person”

It has 3 fields
pe_id (foreign): Gets pe_id from Person.pe_id
type (foreign): Gets type_id from NameType.id
name: Name of the person

Group “ This table holds Group details”

It has 7 fields
pe_id (foreign): Gets pe_id from PersonEntity.id
type (foreign): Gets type_id from GroupType.id
female_adults: Number of female adults
male_adults: Number of male adults
female_children: Number of female children
male_children: Number of male children
description: Any specific information/comments about the group

API Specification for Person Entity

There will be following functions:

individual(): This function will create a new entry in PersonEntity table with “type = individual” and “members=0” when performing create and get the UUID that will be inserted in Person table and ask for type of individual from user. And will give options to call functions name(), identity() and contact() with CRUD operations.

name(): This function can be called with any entry in the Person table. It will give options to perform CRUD in PersonName (first name/ last name/preffered name/nick name and so on).

identity(): This function can be called with any entry in Person table. It will give options to perform CRUD in PersonIdentity to add/list/search identity numbers/code that may be obtained from Driving license, SSN, Passport, etc.

contact(): This function can be called for any entry in PersonEntity (group/individual). This function will populate ContactDetails and call contact_pe() function on create.

contact_pe(): This function will do Many2Many CRUD operation for PersonToContact and associates PersonEntity and ContactDetails.

group(): This function will perform CRUD for entries in PersonEntity table with “type = group” and get the UUID that will be inserted in Group table and ask for type of Group from user and number of members (in adult_mail, adult_female,..) and the total will be put in PersonEntity.members. And will give options to call contact().

association(): This function performs Many2Many CRUD controller for associating PersonEntities

individual_id Reusable field for other tables to refer

group_id Reusable field for other tables to refer

These reusable fields can be used as attributes (foreign keys) in any module that requires to CRUD person related information.

PERSON ITEM, TAGGING AND TRACING

PersonItem “ This table stores evidences and items associated with a PersonEntity”

It has 2 fields
uuid: unique identifier
type (foreign): gets type_id from ItemType.id

Tag “ This table stores the distinct tags assigned to the Person Items”

It has 3 fields
type (foreign): Gets type_id from TagType.id
label: text assigned for the tag
evi_id (foreign): Gets item_id from PersonItem.uuid

PEToEvi “ This table stores association of the PersonEntity with PersonItem”

It has 2 fields
evi_id (foreign): gets item_id from PersonItem.uuid
pe_id (foreign): gets pe_id from PersonEntity.uuid

Composition “ This table stores the composition of the items i.e which item belongs to other items”

It has 2 fields
item1_id (foreign): gets item_id from PersonItem.uuid
item2_id (foreign): gets item_id from PersonItem.uuid

Presence “This table holds all the tracking information about an item or person”

It has 12 fields
id: identifier for the Entity
item (foreign): gets item_id from PersonItem.uuid 
location (foreign): gets location_id from Location.id
currentness (foreign): gets type_id from Currentness.id
time_start: date/time when an item/person arrived at a location
time_end: date/time when an item/person was removed from the location
observer (foreign): gets obs_id from Observer.id
reporter (foreign): gets rep_id from Reporter.id
obs_time: date/time when presence of an item/person was observed
rep_time: date/time when presence of an item/person was reported
location_radius
condition (foreign): gets condition_id from Condition.id 

Role “This table stores the type of roles a PersonEntity or PersonItem can play”

It has 2 fields
id: Identifier for the entity
description : possible values for roles

ItemToRole “ This table stores the Roles associated with the Person and thus PersonItem”

It has 2 fields
item_id (foreign): gets item_id from PersonItem.uuid
role_id (foreign): gets role_id from Role.id

Process “This table stores the type of processes a PersonEntity or PersonItem undergoes”

It has 2 fields
id: Identifier for the Entity
description: Possible Process Names

RoleToProcess “ This table stores the Processes associated with the Roles”

It has 2 fields
process_id (foreign): gets process_id from Process.id
role_id (foreign): gets role_id from Role.id

StatusTransition “ This table stores all possible status transitions”

It has 3 fields
id: Identifier for the Entity
old_status
new_status

ProcessToST “ This table stores the association of StatusTransition and the Process”

It has 5 fields
id: Identifier for the Entity
st_id (foreign): gets st_id from StatusTransition.id 
process_id (foreign): gets process_id from Process.id

TransitionATPresence “ This table stores the status transitions that occur with in a Presence”

It has 2 fields
presence_id (foreign): gets presence_id from Presence.id 
transition_id (foreign): gets transition_id from ProcessToST.id
time_start: start time for the transition at the presence
time_end: end time for the transition at the presence

Location “ This table stores the description of physical locations”

It has 13 fields
id: Identifier for the Entity
type (foreign): gets type_id from LocationType.id
Lat: Latitude of the location (for GIS mapping)
Lon: Longitude of the location (for GIS mapping)
address1: Address of the location 
address2: Second line for Address 
postcode: Postcode of the location
city: City name
state: State name
country: Country name
description: Other description (if any)
name: name of the location (if any)
contact: contact for the location

Observer “ It stores the information about the person/group who observes the presence”

It has 4 fields
uuid: Unique identifier
type (foreign): gets type_id from ObserverType.id 
person (foreign): gets pe_id from PersonEntity.id
srv (foreign): gets srv_id from Service.uuid

Reporter “It stores the information about the persons/group who reports the presence”

It has 4 fields
uuid: Unique identifier
type (foreign): gets type_id from ReporterType.id 
person (foreign): gets pe_id from PersonEntity.id
srv (foreign): gets srv_id from Service.uuid

API Specification for Tracking and Tracing

item() This function calls RESTlike CRUD controller on PersonItem table and gives options to call function tag().

tag() This function calls RESTlike CRUD controller on Tag table.

observer() This function calls RESTlike CRUD controller on Observer table.

reporter() This function calls RESTlike CRUD controller on Reporter table.

presence() This function calls RESTlike CRUD controller on Presence table. And calls function transition_at_presence() on create

process() This function calls RESTlike CRUD controller on process table.

role() This function calls RESTlike CRUD controller on role table.

status_transition() This function calls Restlike CRUD controller on Status_Transition table.

transition_presence() This function calls Many2Many CRUD controller on TransitionAtPresence table to record status transitions in a presence of an item.

process_st() This function calls Many2Many CRUD controller on ProcessToST table to record status transitions during a Process.

role_process() This function calls Many2Many CRUD controller on RoleToProcess table to record Processes applicable to a specific Role.

presence_id Reusable field for other modules to refer

item_id Reusable field for other modules to refer


Navigation
QR Code
QR Code dev:vita:tracking_tracing (generated for current page)