API Docs¶
Models¶
-
class
users.
TaskGroup
(title, description, task_group_type[, hospital, users, is_health_care_provider=True, is_active=True, related_task_groups]) → task_group object¶ Parameters: - title (str) – the task group title
- description (str) – the task group specialization
- task_group_type (choice str :: 'SP' | 'HF') – the task group type: ‘SP’ for Service Provider, ‘HF’ for Health Care Facilities.
- hospital (str or None) – the task group hospital
- users (list of MostUser objects or None) – list of MostUser belonging to the task group
- is_health_care_provider (boolean or None) – True if the task group provides health care services, False otherwise
- is_active (boolean or None) – True if the task group is active, False otherwise
- related_task_groups (list of TaskGroup objects or None) – list of TaskGroup objects allowed to use the health care service
Returns: created object
Return type:
-
class
users.
TaskGroup
(django.db.models.Model) -
TASK_GROUP_TYPES
¶
-
ACTIVATION_STATES
¶
-
clinicians_count
()¶
-
clean
()¶
-
__unicode__
()¶
-
to_dictionary
([exclude_users=False, exclude_related_task_groups=False])¶
-
-
class
users.
MostUserManager
¶ -
create_user
(username, first_name, last_name, email, user_type[, password=None])¶ Parameters: - username –
- first_name –
- last_name –
- email –
- user_type –
- password –
-
create_superuser
(username, first_name, last_name, email, user_type, password)¶ Parameters: - username –
- first_name –
- last_name –
- email –
- user_type –
- password –
-
-
MostUser extends django.db.models.Model
Parameters: - username – the user nickname. Max length 30
- first_name (str) – the user first name. Max length 50
- last_name (str) – the user last name. Max length 50
- email (str) – the user email. Max length 250
- birth_date (datetime or None) – the user birth date
- is_staff (boolean) – True if the user is staff member, False otherwise. Default to True
- is_active (boolean) – True if the user is active, False otherwise. Default to True
- is_admin (boolean) – True if the user has administrator privileges. Default to False
- uid (str) – the user Unique Identification Number. Auto-generated string of 40 hexadecimal digits
- numeric_password (string or None. Max length 4) – the user pin. String of 4 numbers
- user_type (choice str :: 'AD' | 'TE' | 'CL' | 'ST') – the user type: ‘AD’ for Administrative, ‘TE’ for Technician, ‘CL’ for Clinician, ‘ST’ for Student
- gender (choice str :: 'M' | 'F' | 'U') – the user gender: ‘M’ for Male, ‘F’ for Female, ‘U’ for Unknown
- phone (str) – the user phone number. Max length 20
- mobile (str) – the user mobile phone number. Max length 20
- certified_email (str) – the user legal mail. Max length 255
- creation_timestamp (datetime) – the auto-generated user record creation timestamp
- last_modified_timestamp (datetime) – the auto-generated user record last modification timestamp
- deactivation_timestamp (datetime) – the auto-generated user record last deactivation timestamp
Returns: created object
Return type: MostUser
-
users.
USER_TYPES
¶
-
users.
GENDER_CHOICES
¶
-
users.
get_full_name
()¶
-
users.
get_short_name
()¶
-
users.
__unicode__
()¶
-
users.
to_dictionary
()¶
-
static
users.
is_staff
()¶
-
users.
clean
()¶
-
users.
has_module_perms
()¶
-
class
users.
ClinicianUser
¶
REST API reference¶
API Methods¶
MostUser¶
POST
/users/user/new/
¶Create new user.
Parameters:
- username (str) – the user nickname. Max length 30
- first_name (str) – the user first name. Max length 50
- last_name (str) – the user last name. Max length 50
- email (str) – the user email. Max length 250
- birth_date (datetime) – the user birth date
- is_staff (boolean) – True if the user is staff member, False otherwise. Default to True
- is_active (boolean) – True if the user is active, False otherwise. Default to True
- is_admin (boolean) – True if the user has administrator privileges. Default to False
- numeric_password (int) – the user pin. String of 4 numbers
- user_type (str) – the user type: ‘AD’ for Administrative, ‘TE’ for Technician, ‘CL’ for Clinician, ‘ST’ for Student
- gender (str) – the user gender: ‘M’ for Male, ‘F’ for Female, ‘U’ for Unknown
- phone (str) – the user phone number. Max length 20
- mobile (str) – the user mobile phone number. Max length 20
- certified_email (str) – the user legal mail. Max length 255
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully created. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the created user data in json format
POST
/users/user/login/
¶Log a user in the system
Parameters:
- username (str) – the user nickname
- password (str) – the user password
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully logged in. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the logged user data in json format
GET
/users/user/logout/
¶Log a user out of the system
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully logged out. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems
GET
/users/user/
(user_id)/get_user_info/
¶Get the information of the user identified by user_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the data of user identified by user_id, in json format
GET
/users/user/search/
¶Get a list of users matching a query string in fields: username, last_name, first_name, email or certified_email
Parameters:
- query_string (str) – the query string to search
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if users matching the query string are found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the a list of data of users matching the query string, in json format
POST
/users/user/
(user_id)/edit/
¶Edit the information of the user identified by user_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully found and updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the updated data of user identified by user_id, in json format
POST
/users/user/
(user_id)/deactivate/
¶Deactivate the user identified by user_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully deactivated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys id (for the user id) and is_active (for the activation state):
POST
/users/user/
(user_id)/activate/
¶Activate the user identified by user_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the user is successfully activated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys id (for the user id) and is_active (for the activation state)
ClinicianUser¶
POST
/users/clinician_user/new/
¶Create new clinician user.
Parameters:
- user (int) – the user id of the related user
- clinician_type (str) – the clinician user type: ‘DR’ for Doctor or ‘OP’ for Operator
- specialization (str) – the clinician user specialization. Max length 50
- is_health_care_provider (boolean) – True if the clinician user is health care provider, False otherwise
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the clinician user is successfully created. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the created user data in json format
GET
/users/clinician_user/
(user_id)/is_provider/
¶Investigate if the clinician user, with related user identified by user_id, is health care provider
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the clinician user is successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys user_id (for the related user id) and is_health_care_provider (for the health care provider state)
POST
/users/clinician_user/
(user_id)/set_provider/
¶Set the clinician user, with related user identified by user_id, health care provider state to True
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the clinician user is successfully updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys user_id (for the related user id) and is_health_care_provider (for the health care provider state)
GET
/users/clinician_user/search/
¶Get a list of clinician users matching a query string in fields: username, last_name, first_name, email, certified_email or specialization
Parameters:
- query_string (str) – the query string to search
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if clinician users matching the query string are found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the a list of data of clinician users matching the query string, in json format
GET
/users/clinician_user/
(user_id)/get_user_info/
¶Get the information of the clinician user, with related user identified by user_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the clinician user is successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the data of clinician user, with related user identified by user_id, in json format
TaskGroup¶
POST
/users/task_group/new/
¶Create new task group
Parameters:
- title (str) – the task group title. Max length 100
- description (str) – the task group description. Max length 100
- task_group_type (str) – the task group type: ‘SP’ for Service Provider and ‘HF’ for Health Care Facilities
- hospital (str) – the task group hospital. Max length 100
- users (array) – the list of users that belong to task group
- is_health_care_provider (boolean) – True if the task group is health care provider, False otherwise.
- is_active (boolean) – True if the user is active, False otherwise.
- related_task_groups (array) – the list of task groups that may benefit of health care services
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the task group is successfully created. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the created task group data in json format
GET
/users/task_group/search/
¶Get a list of task group matching a query string in fields: title, description or hospital
Parameters:
- query_string (str) – the query string to search
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task groups matching the query string are found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the a list of data of task groups matching the query string, in json format
POST
/users/task_group/
(task_group_id)/edit/
¶Edit the information of the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the task group is successfully found and updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the updated data of task group identified by task_group_id, in json format
GET
/users/task_group/list_available_states/
¶Get a list of available state of activation
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if states are successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains an array of available activation states in json format
POST
/users/task_group/
(task_group_id)/set_active_state/
(active_state)/
¶Set the activation state active_state (active or inactive) to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found and updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys id (for the task group id) and is_active (for the activation state), in json format
GET
/users/task_group/
(task_group_id)/is_provider/
¶Investigate if the task group identified by task_group_id is health care provider
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if the task group is successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys id (for the task group id) and is_health_care_provider (for the health care provider state)
POST
/users/task_group/
(task_group_id)/set_provider/
¶Set the task group identified by task_group_id as health care provider
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found and updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys id (for the task group id) and is_active (for the activation state), in json format
POST
/users/task_group/
(task_group_id)/add_user/
(user_id)/
¶Add the user identified by user_id to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and user_id (for the user just added to the task group), in json format
POST
/users/task_group/
(task_group_id)/remove_user/
(user_id)/
¶Remove the user identified by user_id from the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and user_id (for the user just removed from the task group), in json format
GET
/users/task_group/
(task_group_id)/list_users/
¶List all users that belong to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains an array of data of users that belong to the task group, in json format
Add the related task group identified by related_task_group_id to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and related_task_group_id (for the related task group just added to the task group), in json format
Remove the related task group identified by related_task_group_id from the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is updated. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and related_task_group_id (for the related task group just removed from the task group), in json format
List all related task groups that belong to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains an array of data of related task groups that belong to the task group, in json format
GET
/users/task_group/
(task_group_id)/has_clinicians/
¶Investigate if the task group identified by task_group_id has clinician users
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if clinician users are successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and clinicians_count (for the number of clinician user that belong to task group)
GET
/users/task_group/
(task_group_id)/list_clinicians/
¶List all related clinician users that belong to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains an array of data of clinician users that belong to the task group, in json format
GET
/users/task_group/
(task_group_id)/has_clinician_provider/
¶Investigate if the task group identified by task_group_id has health care provider clinician users
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if health care providers are successfully found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains the keys task_group_id (for the task group id) and clinicians_count (for the number of health care provider clinician user that belong to task group)
GET
/users/task_group/
(task_group_id)/list_clinician_providers/
¶List all health care provider clinician users that belong to the task group identified by task_group_id
Request Headers:
- Authorization – login required
Response Headers:
- Content-Type –
application/json
parameter boolean success: True if task group is found. False otherwise parameter str message: a feedback string that would be displayed to the connected user parameter str errors: an error string that explains the raised problems parameter json data: if success is True, it contains an array of data of health care provider clinician users that belong to the task group, in json format