Permalink
Browse files

Merge branch 'master' into dev

Conflicts:
	project/epi2/models.py
  • Loading branch information...
2 parents 6794592 + 5012ca7 commit dcb0e3a25b012e057c547d180b03916d70020637 @shapiromatron committed Oct 11, 2015
Showing with 2,898 additions and 6,591 deletions.
  1. +23 −31 project/animal/exports.py
  2. +1 −1 project/animal/migrations/0011_auto_20150723_1600.py
  3. +2 −2 project/assessment/models.py
  4. +4 −10 project/assessment/views.py
  5. +28 −5 project/epi/admin.py
  6. +22 −10 project/epi/api.py
  7. +111 −217 project/epi/exports.py
  8. +251 −251 project/{epi2 → epi}/fixtures/countries.json
  9. +9 −9 project/{epi2 → epi}/fixtures/ethnicity.json
  10. +23 −23 project/{epi2 → epi}/fixtures/resultmetric.json
  11. +571 −498 project/epi/forms.py
  12. +42 −74 project/epi/lookups.py
  13. +186 −210 project/epi/migrations/0001_initial.py
  14. +0 −54 project/epi/migrations/0002_auto_20150629_1327.py
  15. +7 −7 project/{epi2 → epi}/migrations/0002_load_fixtures.py
  16. +0 −25 project/epi/migrations/0003_auto_20150723_1544.py
  17. +818 −1,346 project/epi/models.py
  18. +120 −126 project/epi/serializers.py
  19. +94 −122 project/epi/urls.py
  20. +208 −289 project/epi/views.py
  21. 0 project/epi2/__init__.py
  22. +0 −36 project/epi2/admin.py
  23. +0 −41 project/epi2/api.py
  24. +0 −159 project/epi2/exports.py
  25. +0 −796 project/epi2/forms.py
  26. +0 −88 project/epi2/lookups.py
  27. +0 −327 project/epi2/migrations/0001_initial.py
  28. 0 project/epi2/migrations/__init__.py
  29. +0 −186 project/epi2/serializers.py
  30. +0 −136 project/epi2/urls.py
  31. +0 −349 project/epi2/views.py
  32. +23 −29 project/epimeta/exports.py
  33. +3 −3 project/epimeta/forms.py
  34. +9 −9 project/epimeta/migrations/0001_initial.py
  35. +6 −6 project/epimeta/models.py
  36. +3 −3 project/epimeta/serializers.py
  37. +1 −1 project/epimeta/views.py
  38. +0 −1 project/hawc/settings/base.py
  39. +0 −2 project/hawc/urls.py
  40. +32 −36 project/invitro/exports.py
  41. +6 −6 project/static/epi/js/{models2.js → models.js}
  42. +3 −3 project/static/epimeta/js/models.js
  43. +136 −122 project/static/summary/js/data_pivot.js
  44. +3 −3 project/study/models.py
  45. +14 −7 project/summary/forms.py
  46. +22 −8 project/summary/models.py
  47. +1 −1 project/templates/assessment/assessment_downloads.html
  48. +1 −1 project/templates/assessment/baseendpoint_list.html
  49. +1 −1 project/templates/base.html
  50. +0 −21 project/templates/epi/_epistudy_list.html
  51. +0 −40 project/templates/epi/_study_population_list.html
  52. 0 project/templates/{epi2 → epi}/adjustmentfactor_form.html
  53. +0 −15 project/templates/epi/assessedoutcome_confirm_delete.html
  54. +0 −39 project/templates/epi/assessedoutcome_copy_selector.html
  55. +0 −56 project/templates/epi/assessedoutcome_detail.html
  56. +0 −89 project/templates/epi/assessedoutcome_form.html
  57. +0 −47 project/templates/epi/assessedoutcome_list.html
  58. +0 −76 project/templates/epi/assessedoutcome_versions.html
  59. +1 −1 project/templates/{epi2 → epi}/comparisonset_confirm_delete.html
  60. +2 −2 project/templates/{epi2 → epi}/comparisonset_detail.html
  61. 0 project/templates/{epi2 → epi}/comparisonset_form.html
  62. +2 −2 project/templates/{epi2 → epi}/comparisonset_outcome_copy_selector.html
  63. +2 −2 project/templates/{epi2 → epi}/comparisonset_sp_copy_selector.html
  64. 0 project/templates/{epi2 → epi}/criteria_form.html
  65. +5 −6 project/templates/epi/exposure_confirm_delete.html
  66. +1 −7 project/templates/epi/exposure_copy_selector.html
  67. +20 −47 project/templates/epi/exposure_detail.html
  68. +7 −48 project/templates/epi/exposure_form.html
  69. +0 −48 project/templates/epi/factor_form.html
  70. +1 −1 project/templates/{epi2 → epi}/group_detail.html
  71. 0 project/templates/{epi2 → epi}/group_form.html
  72. +1 −1 project/templates/{epi2 → epi}/outcome_confirm_delete.html
  73. +2 −2 project/templates/{epi2 → epi}/outcome_copy_selector.html
  74. +6 −6 project/templates/{epi2 → epi}/outcome_detail.html
  75. 0 project/templates/{epi2 → epi}/outcome_form.html
  76. 0 project/templates/{epi2 → epi}/outcome_list.html
  77. +1 −1 project/templates/{epi2 → epi}/result_confirm_delete.html
  78. +2 −2 project/templates/{epi2 → epi}/result_copy_selector.html
  79. +2 −2 project/templates/{epi2 → epi}/result_detail.html
  80. +1 −1 project/templates/{epi2 → epi}/result_form.html
  81. +0 −48 project/templates/epi/studycriteria_form.html
  82. +5 −6 project/templates/epi/studypopulation_confirm_delete.html
  83. +31 −43 project/templates/epi/studypopulation_detail.html
  84. +18 −15 project/templates/epi/studypopulation_form.html
  85. +0 −14 project/templates/epi2/exposure2_confirm_delete.html
  86. +0 −36 project/templates/epi2/exposure2_detail.html
  87. +0 −20 project/templates/epi2/exposure2_form.html
  88. +0 −33 project/templates/epi2/exposure_copy_selector.html
  89. +0 −14 project/templates/epi2/studypopulation_confirm_delete.html
  90. +0 −39 project/templates/epi2/studypopulation_copy_selector.html
  91. +0 −47 project/templates/epi2/studypopulation_detail.html
  92. +0 −40 project/templates/epi2/studypopulation_form.html
  93. +4 −4 project/templates/study/study_detail.html
View
@@ -89,19 +89,16 @@ class EndpointFlatDataPivot(FlatFileExporter):
def _get_header_row(self):
return [
- 'study',
- 'study_url',
- 'Study HAWC ID',
- 'Study Published',
-
- 'Experiment ID',
- 'experiment',
- 'experiment_url',
+ 'study id',
+ 'study name',
+ 'study published',
+
+ 'experiment id',
+ 'experiment name',
'chemical',
- 'Animal Group ID',
- 'animal_group',
- 'animal_group_url',
+ 'animal group id',
+ 'animal group name',
'lifestage exposed',
'lifestage assessed',
'species',
@@ -114,20 +111,19 @@ def _get_header_row(self):
'treatment period',
'duration exposure',
- 'endpoint_name',
- 'endpoint_url',
+ 'endpoint id',
+ 'endpoint name',
'system',
'organ',
'effect',
'effect subtype',
'diagnostic',
'tags',
- 'observation_time',
- 'data_type',
+ 'observation time',
+ 'data type',
'doses',
- 'dose_units',
- 'response_units',
- 'Endpoint Key',
+ 'dose units',
+ 'response units',
'low_dose',
'NOEL',
@@ -141,16 +137,16 @@ def _get_header_row(self):
'BMDU',
'CSF',
- 'Row Key',
- 'dose_index',
+ 'key',
+ 'dose index',
'dose',
- 'n',
+ 'N',
'incidence',
'response',
- 'stdev',
- 'percentControlMean',
- 'percentControlLow',
- 'percentControlHigh'
+ 'variance',
+ 'percent control mean',
+ 'percent control low',
+ 'percent control high'
]
def _get_data_rows(self):
@@ -201,19 +197,16 @@ def get_tags(e):
# build endpoint-group independent data
row = [
- ser['animal_group']['experiment']['study']['short_citation'],
- ser['animal_group']['experiment']['study']['url'],
ser['animal_group']['experiment']['study']['id'],
+ ser['animal_group']['experiment']['study']['short_citation'],
ser['animal_group']['experiment']['study']['published'],
ser['animal_group']['experiment']['id'],
ser['animal_group']['experiment']['name'],
- ser['animal_group']['experiment']['url'],
ser['animal_group']['experiment']['chemical'],
ser['animal_group']['id'],
ser['animal_group']['name'],
- ser['animal_group']['url'],
ser['animal_group']['lifestage_exposed'],
ser['animal_group']['lifestage_assessed'],
ser['animal_group']['species'],
@@ -227,8 +220,8 @@ def get_tags(e):
ser['animal_group']['dosing_regime']),
ser['animal_group']['dosing_regime']['duration_exposure_text'],
+ ser['id'],
ser['name'],
- ser['url'],
ser['system'],
ser['organ'],
ser['effect'],
@@ -240,7 +233,6 @@ def get_tags(e):
get_doses_str(doses),
get_dose_units(doses),
ser['response_units'],
- ser['id']
]
# dose-group specific information
@@ -9,7 +9,7 @@ class Migration(migrations.Migration):
dependencies = [
('animal', '0010_auto_20150723_1536'),
('bmd', '0002_auto_20150723_1557'),
- ('epi', '0003_auto_20150723_1544'),
+ ('epi', '0001_initial'),
('invitro', '0002_auto_20150723_1542'),
('summary', '0003_auto_20150723_1557'),
]
@@ -473,8 +473,8 @@ def get_json(self, *args, **kwargs):
return an empty object.
"""
d = {}
- if hasattr(self, 'assessedoutcome'):
- d = self.assessedoutcome.get_json(*args, **kwargs)
+ if hasattr(self, 'outcome'):
+ d = self.outcome.get_json(*args, **kwargs)
elif hasattr(self, 'endpoint'):
d = self.endpoint.d_response(*args, **kwargs)
elif hasattr(self, 'ivendpoint'):
@@ -325,17 +325,12 @@ def get_context_data(self, **kwargs):
.filter(assessment_id=self.assessment.id)\
.count()
- aos = self.model.assessedoutcome\
+ os = self.model.outcome\
.related.related_model.objects\
.filter(assessment_id=self.assessment.id)\
.count()
- aos2 = self.model.outcome\
- .related.related_model.objects\
- .filter(assessment_id=self.assessment.id)\
- .count()
-
- mrs = get_model('epi', 'metaresult')\
+ mrs = get_model('epimeta', 'metaresult')\
.objects\
.filter(protocol__study__assessment_id=self.assessment.id)\
.count()
@@ -345,13 +340,12 @@ def get_context_data(self, **kwargs):
.filter(assessment_id=self.assessment.id)\
.count()
- alleps = eps + aos + aos2 + mrs + iveps
+ alleps = eps + os + mrs + iveps
context.update({
"ivendpoints": iveps,
"endpoints": eps,
- "assessed_outcomes": aos,
- "outcomes": aos2,
+ "outcomes": os,
"meta_results": mrs,
"total_endpoints": alleps
})
View
@@ -3,11 +3,34 @@
from . import models
-class StatisticalMetricAdmin(admin.ModelAdmin):
- list_display = ('metric', 'abbreviation', 'isLog', 'order', )
+class CriteriaAdmin(admin.ModelAdmin):
+ pass
- def has_delete_permission(self, request, obj=None):
- return False
+class CountryAdmin(admin.ModelAdmin):
-admin.site.register(models.StatisticalMetric, StatisticalMetricAdmin)
+ search_fields = (
+ 'name',
+ )
+
+
+class AdjustmentFactorAdmin(admin.ModelAdmin):
+ pass
+
+
+class EthnicityAdmin(admin.ModelAdmin):
+ pass
+
+
+class ResultMetricAdmin(admin.ModelAdmin):
+ list_display = (
+ "metric", "abbreviation", "showForestPlot",
+ "isLog", "reference_value", "order",
+ )
+
+
+admin.site.register(models.Criteria, CriteriaAdmin)
+admin.site.register(models.Country, CountryAdmin)
+admin.site.register(models.AdjustmentFactor, AdjustmentFactorAdmin)
+admin.site.register(models.Ethnicity, EthnicityAdmin)
+admin.site.register(models.ResultMetric, ResultMetricAdmin)
View
@@ -5,12 +5,6 @@
from . import models, serializers
-class MetaResult(AssessmentViewset):
- assessment_filter_args = "protocol__study__assessment"
- model = models.MetaResult
- serializer_class = serializers.MetaResultSerializer
-
-
class StudyPopulation(AssessmentViewset):
assessment_filter_args = "study__assessment"
model = models.StudyPopulation
@@ -20,10 +14,28 @@ class StudyPopulation(AssessmentViewset):
class Exposure(AssessmentViewset):
assessment_filter_args = "study_population__study__assessment"
model = models.Exposure
- serializer_class = serializers.ExposureVerboseSerializer
+ serializer_class = serializers.ExposureSerializer
-class AssessedOutcome(AssessmentViewset):
+class Outcome(AssessmentViewset):
assessment_filter_args = "assessment"
- model = models.AssessedOutcome
- serializer_class = serializers.AssessedOutcomeSerializer
+ model = models.Outcome
+ serializer_class = serializers.OutcomeSerializer
+
+
+class Result(AssessmentViewset):
+ assessment_filter_args = "outcome__assessment"
+ model = models.Result
+ serializer_class = serializers.ResultSerializer
+
+
+class ComparisonSet(AssessmentViewset):
+ assessment_filter_args = "assessment" # todo: fix
+ model = models.ComparisonSet
+ serializer_class = serializers.ComparisonSetSerializer
+
+
+class Group(AssessmentViewset):
+ assessment_filter_args = "assessment" # todo: fix
+ model = models.Group
+ serializer_class = serializers.GroupSerializer
Oops, something went wrong.

0 comments on commit dcb0e3a

Please sign in to comment.