Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Backend
Commits
587acf94
Commit
587acf94
authored
Apr 23, 2020
by
Jonathan Christopher Jakub
Browse files
Implement monitoring case checking date
parent
db490dcd
Changes
4
Hide whitespace changes
Inline
Side-by-side
apps/cases/migrations/0011_monitoring_checking_date.py
0 → 100644
View file @
587acf94
# Generated by Django 3.0.1 on 2020-04-22 15:35
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'cases'
,
'0010_auto_20200420_2300'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'monitoringcase'
,
name
=
'checking_date'
,
field
=
models
.
DateField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'monitoringcasehistory'
,
name
=
'checking_date'
,
field
=
models
.
DateField
(
blank
=
True
,
null
=
True
),
),
]
apps/cases/models.py
View file @
587acf94
...
...
@@ -160,6 +160,7 @@ class MonitoringCaseHistory(HistoryModel):
treatment_start_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
treatment_end_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
medication_outcome
=
models
.
CharField
(
max_length
=
256
,
blank
=
True
,
null
=
True
)
checking_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
author
=
models
.
ForeignKey
(
Account
,
blank
=
True
,
...
...
@@ -193,6 +194,7 @@ class MonitoringCase(HistoryEnabledModel):
treatment_start_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
treatment_end_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
medication_outcome
=
models
.
CharField
(
max_length
=
256
,
blank
=
True
,
null
=
True
)
checking_date
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
author
=
models
.
ForeignKey
(
Account
,
blank
=
True
,
...
...
apps/cases/serializers.py
View file @
587acf94
...
...
@@ -111,6 +111,7 @@ class MonitoringCaseSummarySerializer(serializers.ModelSerializer):
"treatment_start_date"
,
"treatment_end_date"
,
"medication_outcome"
,
"checking_date"
,
"author"
,
]
...
...
@@ -129,6 +130,7 @@ class MonitoringCaseSerializer(serializers.ModelSerializer):
"treatment_start_date"
,
"treatment_end_date"
,
"medication_outcome"
,
"checking_date"
,
]
def
save
(
self
):
...
...
apps/cases/tests/test_units/test_monitoring_cases.py
View file @
587acf94
...
...
@@ -97,7 +97,8 @@ class MonitoringCaseViewTest(APITestCase):
"medication_outcome"
:
""
,
"regular_medicine_intake"
:
"[]"
,
"treatment_start_date"
:
"1111-11-11"
,
"treatment_end_date"
:
"1111-11-12"
"treatment_end_date"
:
"1111-11-12"
,
"checking_date"
:
"1111-11-13"
,
}
response
=
self
.
client
.
post
(
path
=
url
,
data
=
data
,
format
=
"json"
,)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment