Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
project/local_settings.py

media/*
staticdev_bk/*
templates_bk/*
Expand All @@ -9,8 +10,19 @@ templates_bk/*
media
Icon
static/CACHE
static/node_modules
static/node_modules/
staticdev/CACHE
venv
.coverage
/static/css/.sass-cache/
/static/css/.sass-cache/
.venv
.vscode
*.pem
Dockerfile
.dockerignore
.venv/*
client-cert.pem
client-key.pem
server-ca.pem
project/settings.py

29 changes: 14 additions & 15 deletions apps/a1c_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
"""
from django.conf.urls import url

from a1c_app.views import *
from django.urls import re_path

urlpatterns = [
url(r'^(?P<a1c_id>\d+)/info$', get_a1c_info),
url(r'^(?P<value_id>\d+)/value_info$', get_observation_value_info),
url(r'^(?P<a1c_id>\d+)/add_note$', add_note),
url(r'^(?P<component_id>\d+)/add_value$', add_value),
url(r'^(?P<a1c_id>\d+)/patient_refused$', patient_refused),
url(r'^note/(?P<note_id>\d+)/edit$', edit_note),
url(r'^note/(?P<note_id>\d+)/delete$', delete_note),
url(r'^value/(?P<value_id>\d+)/delete$', delete_value),
url(r'^value/(?P<value_id>\d+)/edit$', edit_value),
url(r'^value/(?P<value_id>\d+)/add_note$', add_value_note),
url(r'^value/note/(?P<note_id>\d+)/edit$', edit_value_note),
url(r'^value/note/(?P<note_id>\d+)/delete$', delete_value_note),
url(r'^(?P<a1c_id>\d+)/track/click/$', track_a1c_click),
re_path(r"^(?P<a1c_id>\d+)/info$", get_a1c_info),
re_path(r"^(?P<value_id>\d+)/value_info$", get_observation_value_info),
re_path(r"^(?P<a1c_id>\d+)/add_note$", add_note),
re_path(r"^(?P<component_id>\d+)/add_value$", add_value),
re_path(r"^(?P<a1c_id>\d+)/patient_refused$", patient_refused),
re_path(r"^note/(?P<note_id>\d+)/edit$", edit_note),
re_path(r"^note/(?P<note_id>\d+)/delete$", delete_note),
re_path(r"^value/(?P<value_id>\d+)/delete$", delete_value),
re_path(r"^value/(?P<value_id>\d+)/edit$", edit_value),
re_path(r"^value/(?P<value_id>\d+)/add_note$", add_value_note),
re_path(r"^value/note/(?P<note_id>\d+)/edit$", edit_value_note),
re_path(r"^value/note/(?P<note_id>\d+)/delete$", delete_value_note),
re_path(r"^(?P<a1c_id>\d+)/track/click/$", track_a1c_click),
]
61 changes: 26 additions & 35 deletions apps/colons_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
"""

from django.conf.urls import url

from colons_app.views import *
from django.urls import re_path

urlpatterns = [
url(r'^(?P<colon_id>\d+)/info$', get_colon_info),
url(r'^(?P<colon_id>\d+)/refuse$', refuse),
url(r'^(?P<colon_id>\d+)/not_appropriate$', not_appropriate),

url(r'^study/(?P<study_id>\d+)/info$', get_study_info),
url(r'^(?P<colon_id>\d+)/add_study$', add_study),
url(r'^(?P<study_id>\d+)/edit_study$', edit_study),
url(r'^(?P<study_id>\d+)/delete_study$', delete_study),

url(r'^study/(?P<study_id>\d+)/upload_image$', upload_study_image),
url(r'^study/(?P<study_id>\d+)/addImage$', add_study_image),
url(r'^study/(?P<study_id>\d+)/image/(?P<image_id>\d+)/delete$', delete_study_image),

url(r'^(?P<colon_id>\d+)/add_factor$', add_factor),
url(r'^(?P<colon_id>\d+)/delete_factor$', delete_factor),


url(r'^(?P<colon_id>\d+)/add_note$', add_note),
url(r'^note/(?P<note_id>\d+)/edit$', edit_note),
url(r'^note/(?P<note_id>\d+)/delete$', delete_note),

url(r'^(?P<colon_id>\d+)/track/click$', track_colon_click),

re_path(r"^(?P<colon_id>\d+)/info$", get_colon_info),
re_path(r"^(?P<colon_id>\d+)/refuse$", refuse),
re_path(r"^(?P<colon_id>\d+)/not_appropriate$", not_appropriate),
re_path(r"^study/(?P<study_id>\d+)/info$", get_study_info),
re_path(r"^(?P<colon_id>\d+)/add_study$", add_study),
re_path(r"^(?P<study_id>\d+)/edit_study$", edit_study),
re_path(r"^(?P<study_id>\d+)/delete_study$", delete_study),
re_path(r"^study/(?P<study_id>\d+)/upload_image$", upload_study_image),
re_path(r"^study/(?P<study_id>\d+)/addImage$", add_study_image),
re_path(
r"^study/(?P<study_id>\d+)/image/(?P<image_id>\d+)/delete$", delete_study_image
),
re_path(r"^(?P<colon_id>\d+)/add_factor$", add_factor),
re_path(r"^(?P<colon_id>\d+)/delete_factor$", delete_factor),
re_path(r"^(?P<colon_id>\d+)/add_note$", add_note),
re_path(r"^note/(?P<note_id>\d+)/edit$", edit_note),
re_path(r"^note/(?P<note_id>\d+)/delete$", delete_note),
re_path(r"^(?P<colon_id>\d+)/track/click$", track_colon_click),
# new restURL
url(r'^(?P<colon_id>\d+)$', get_colon_info),
url(r'^(?P<colon_id>\d+)/studies$', get_colon_cancer_studies),
url(r'^(?P<colon_id>\d+)/studies/(?P<study_id>\d+)$', colon_cancer_study),

url(r'^(?P<colon_id>\d+)/risk-factors$', get_risk_factors),
url(r'^(?P<colon_id>\d+)/risk-factors/(?P<risk_factor_id>\d+)$', risk_factor),

url(r'^(?P<colon_id>\d+)/notes$', get_notes),
url(r'^(?P<colon_id>\d+)/notes/(?P<note_id>\d+)$', note),

re_path(r"^(?P<colon_id>\d+)$", get_colon_info),
re_path(r"^(?P<colon_id>\d+)/studies$", get_colon_cancer_studies),
re_path(r"^(?P<colon_id>\d+)/studies/(?P<study_id>\d+)$", colon_cancer_study),
re_path(r"^(?P<colon_id>\d+)/risk-factors$", get_risk_factors),
re_path(r"^(?P<colon_id>\d+)/risk-factors/(?P<risk_factor_id>\d+)$", risk_factor),
re_path(r"^(?P<colon_id>\d+)/notes$", get_notes),
re_path(r"^(?P<colon_id>\d+)/notes/(?P<note_id>\d+)$", note),
]
7 changes: 2 additions & 5 deletions apps/data_app/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
"""
from itertools import izip

from django.db import connection

from common.views import timeit
from django.db import connection
from emr.models import ObservationValue


Expand Down Expand Up @@ -56,7 +53,7 @@ def query_to_dicts(query_string, *query_args):
row = cursor.fetchone()
if row is None:
break
row_dict = dict(izip(col_names, row))
row_dict = dict(zip(col_names, row))
yield row_dict
return

Expand Down
44 changes: 25 additions & 19 deletions apps/data_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,33 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
"""
from django.conf.urls import url

from data_app.views import *
from django.urls import re_path

urlpatterns = [
url(r'^track/click$', track_observation_click),
url(r'^(?P<observation_id>\d+)/info$', get_observation_info),
url(r'^(?P<patient_id>\d+)/(?P<value_id>\d+)/individual_data_info$', get_individual_data_info),
url(r'^(?P<patient_id>\d+)/get_datas$', get_datas),
url(r'^(?P<patient_id>\d+)/add_new_data_type$', add_new_data_type),
url(r'^(?P<patient_id>\d+)/(?P<observation_id>\d+)/save_data_type$', save_data_type),
url(r'^(?P<patient_id>\d+)/(?P<observation_id>\d+)/delete_data$', delete_data),
url(r'^updateOrder$', update_order),
url(r'^(?P<observation_id>\d+)/get_pins$', get_pins),
url(r'^(?P<patient_id>\d+)/pin_to_problem$', obseration_pin_to_problem),
url(r'^(?P<patient_id>\d+)/(?P<component_id>\d+)/add_new_data$', add_new_data),
url(r'^(?P<patient_id>\d+)/(?P<value_id>\d+)/delete_individual_data$', delete_individual_data),
url(r'^(?P<patient_id>\d+)/(?P<value_id>\d+)/save_data$', save_data),
url(r'^update_graph$', update_graph),

re_path(r"^track/click$", track_observation_click),
re_path(r"^(?P<observation_id>\d+)/info$", get_observation_info),
re_path(
r"^(?P<patient_id>\d+)/(?P<value_id>\d+)/individual_data_info$",
get_individual_data_info,
),
re_path(r"^(?P<patient_id>\d+)/get_datas$", get_datas),
re_path(r"^(?P<patient_id>\d+)/add_new_data_type$", add_new_data_type),
re_path(
r"^(?P<patient_id>\d+)/(?P<observation_id>\d+)/save_data_type$", save_data_type
),
re_path(r"^(?P<patient_id>\d+)/(?P<observation_id>\d+)/delete_data$", delete_data),
re_path(r"^updateOrder$", update_order),
re_path(r"^(?P<observation_id>\d+)/get_pins$", get_pins),
re_path(r"^(?P<patient_id>\d+)/pin_to_problem$", obseration_pin_to_problem),
re_path(r"^(?P<patient_id>\d+)/(?P<component_id>\d+)/add_new_data$", add_new_data),
re_path(
r"^(?P<patient_id>\d+)/(?P<value_id>\d+)/delete_individual_data$",
delete_individual_data,
),
re_path(r"^(?P<patient_id>\d+)/(?P<value_id>\d+)/save_data$", save_data),
re_path(r"^update_graph$", update_graph),
# Allow to edit multiple observation component value
url(r'^(?P<patient_id>\d+)/delete$', delete_component_values),
url(r'(?P<observation_id>\d+)/values$', get_observation_values),
re_path(r"^(?P<patient_id>\d+)/delete$", delete_component_values),
re_path(r"(?P<observation_id>\d+)/values$", get_observation_values),
]
34 changes: 25 additions & 9 deletions apps/data_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,37 @@
"""
from math import pow

from common.views import *
from data_app.operations import (
get_observation_most_common_value,
get_observation_value_pair,
)
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models import *
from rest_framework.decorators import api_view

from common.views import *
from data_app.operations import get_observation_most_common_value, get_observation_value_pair
from emr.models import OBSERVATION_TYPES
from emr.models import Observation, ObservationComponent, ObservationOrder, \
PhysicianTeam, ObservationPinToProblem, Problem, ObservationUnit, ObservationValue, \
Inr, UserProfile
from emr.models import (
OBSERVATION_TYPES,
Inr,
Observation,
ObservationComponent,
ObservationOrder,
ObservationPinToProblem,
ObservationUnit,
ObservationValue,
PhysicianTeam,
Problem,
UserProfile,
)
from emr.operations import op_add_event
from inr_app.serializers import InrSerializer
from rest_framework.decorators import api_view
from users_app.views import permissions_accessed
from .serializers import ObservationSerializer, ObservationPinToProblemSerializer, ObservationValueSerializer

from .serializers import (
ObservationPinToProblemSerializer,
ObservationSerializer,
ObservationValueSerializer,
)


@login_required
Expand Down
33 changes: 16 additions & 17 deletions apps/document_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
"""
from django.conf.urls import url

from django.urls import re_path
from document_app.views import *

urlpatterns = [
url(r'^$', get_document_list),
url(r'^upload_document$', upload_document),
url(r'^info/(?P<document_id>\d+)$', document_info),
url(r'^pin/patient$', pin_patient_2_document),
url(r'^pin/label$', pin_label_2_document),
url(r'^remove/label$', remove_document_label),
url(r'^pin/todo$', pin_todo_2_document),
url(r'^unpin/todo$', unpin_document_todo),
url(r'^pin/problem$', pin_problem_2_document),
url(r'^unpin/problem$', unpin_document_problem),
url(r'^search_patient$', search_patient),
url(r'^(?P<patient_id>\d+)/get_pinned_document$', get_patient_document),
url(r'^delete/(?P<document_id>\d+)$', delete_document),
url(r'^remove/(?P<document_id>\d+)$', remove_document),
url(r'^(?P<document_id>\d+)/name$', update_name)
re_path(r"^$", get_document_list),
re_path(r"^upload_document$", upload_document),
re_path(r"^info/(?P<document_id>\d+)$", document_info),
re_path(r"^pin/patient$", pin_patient_2_document),
re_path(r"^pin/label$", pin_label_2_document),
re_path(r"^remove/label$", remove_document_label),
re_path(r"^pin/todo$", pin_todo_2_document),
re_path(r"^unpin/todo$", unpin_document_todo),
re_path(r"^pin/problem$", pin_problem_2_document),
re_path(r"^unpin/problem$", unpin_document_problem),
re_path(r"^search_patient$", search_patient),
re_path(r"^(?P<patient_id>\d+)/get_pinned_document$", get_patient_document),
re_path(r"^delete/(?P<document_id>\d+)$", delete_document),
re_path(r"^remove/(?P<document_id>\d+)$", remove_document),
re_path(r"^(?P<document_id>\d+)/name$", update_name),
]
6 changes: 4 additions & 2 deletions apps/emr/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
"""

from django.utils.deprecation import MiddlewareMixin

from .models import AccessLog


class AccessLogMiddleware(object):
class AccessLogMiddleware(MiddlewareMixin):

def process_request(self, request):
if request.user.is_authenticated() and not request.path.startswith('/list_of') and not request.path.endswith(
if request.user.is_authenticated and not request.path.startswith('/list_of') and not request.path.endswith(
'/encounter/status'):
access_log = AccessLog(user=request.user, summary=request.path)
access_log.save()
Loading