Spaces:
Sleeping
Sleeping
sachin
commited on
Commit
·
6951757
1
Parent(s):
9702c04
add dummy tables
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- doctorappointmentapp/__init__.py +0 -0
- doctorappointmentapp/admin.py +4 -0
- doctorappointmentapp/apps.py +6 -0
- doctorappointmentapp/migrations/0001_initial.py +25 -0
- doctorappointmentapp/migrations/0002_auto_20241122_0024.py +19 -0
- doctorappointmentapp/migrations/__init__.py +0 -0
- doctorappointmentapp/models.py +9 -0
- doctorappointmentapp/serializers.py +7 -0
- doctorappointmentapp/tests.py +3 -0
- doctorappointmentapp/urls.py +11 -0
- doctorappointmentapp/views.py +25 -0
- prescriptionapp/__init__.py +0 -0
- prescriptionapp/admin.py +4 -0
- prescriptionapp/apps.py +6 -0
- prescriptionapp/migrations/0001_initial.py +27 -0
- prescriptionapp/migrations/0002_auto_20241121_2327.py +74 -0
- prescriptionapp/migrations/__init__.py +0 -0
- prescriptionapp/models.py +11 -0
- prescriptionapp/serializers.py +7 -0
- prescriptionapp/tests.py +3 -0
- prescriptionapp/urls.py +11 -0
- prescriptionapp/views.py +25 -0
- sanjeevini/settings.py +7 -1
- sanjeevini/urls.py +7 -0
- userappointmentapp/__init__.py +0 -0
- userappointmentapp/admin.py +4 -0
- userappointmentapp/apps.py +6 -0
- userappointmentapp/migrations/0001_initial.py +25 -0
- userappointmentapp/migrations/0002_auto_20241119_0922.py +19 -0
- userappointmentapp/migrations/__init__.py +0 -0
- userappointmentapp/models.py +9 -0
- userappointmentapp/serializers.py +7 -0
- userappointmentapp/tests.py +3 -0
- userappointmentapp/urls.py +11 -0
- userappointmentapp/views.py +25 -0
- userdiabetesapp/__init__.py +0 -0
- userdiabetesapp/admin.py +4 -0
- userdiabetesapp/apps.py +6 -0
- userdiabetesapp/migrations/0001_initial.py +30 -0
- userdiabetesapp/migrations/0002_auto_20241121_2352.py +88 -0
- userdiabetesapp/migrations/__init__.py +0 -0
- userdiabetesapp/models.py +15 -0
- userdiabetesapp/serializers.py +7 -0
- userdiabetesapp/tests.py +3 -0
- userdiabetesapp/urls.py +11 -0
- userdiabetesapp/views.py +25 -0
- userheartapp/__init__.py +0 -0
- userheartapp/admin.py +4 -0
- userheartapp/apps.py +6 -0
- userheartapp/migrations/0001_initial.py +28 -0
doctorappointmentapp/__init__.py
ADDED
File without changes
|
doctorappointmentapp/admin.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import DoctorAppointmentApp
|
3 |
+
|
4 |
+
admin.site.register(DoctorAppointmentApp)
|
doctorappointmentapp/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class DoctorappointmentappConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'doctorappointmentapp'
|
doctorappointmentapp/migrations/0001_initial.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 21:42
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
|
8 |
+
initial = True
|
9 |
+
|
10 |
+
dependencies = [
|
11 |
+
]
|
12 |
+
|
13 |
+
operations = [
|
14 |
+
migrations.CreateModel(
|
15 |
+
name='DoctorAppointmentApp',
|
16 |
+
fields=[
|
17 |
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
18 |
+
('appointment_day', models.DateField()),
|
19 |
+
('appointment_time', models.TimeField()),
|
20 |
+
('patient_name', models.CharField(max_length=255)),
|
21 |
+
('status', models.CharField(max_length=255)),
|
22 |
+
('observations', models.TextField()),
|
23 |
+
],
|
24 |
+
),
|
25 |
+
]
|
doctorappointmentapp/migrations/0002_auto_20241122_0024.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-19 09:22
|
2 |
+
|
3 |
+
from django.db import migrations
|
4 |
+
|
5 |
+
def add_default_entries(apps, schema_editor):
|
6 |
+
DoctorAppointmentApp = apps.get_model('doctorappointmentapp', 'DoctorAppointmentApp')
|
7 |
+
DoctorAppointmentApp.objects.create(appointment_day='2024-11-19', appointment_time='10:00:00', patient_name='User 001', status='Pending', observations='Follow-up appointment')
|
8 |
+
DoctorAppointmentApp.objects.create(appointment_day='2024-11-21', appointment_time='14:30:00', patient_name='User 002', status='Confirmed', observations='Routine check-up')
|
9 |
+
DoctorAppointmentApp.objects.create(appointment_day='2024-12-04', appointment_time='09:00:00', patient_name='User 003', status='Cancelled', observations='Patient unavailable')
|
10 |
+
|
11 |
+
class Migration(migrations.Migration):
|
12 |
+
|
13 |
+
dependencies = [
|
14 |
+
('doctorappointmentapp', '0001_initial'),
|
15 |
+
]
|
16 |
+
|
17 |
+
operations = [
|
18 |
+
migrations.RunPython(add_default_entries),
|
19 |
+
]
|
doctorappointmentapp/migrations/__init__.py
ADDED
File without changes
|
doctorappointmentapp/models.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import models
|
2 |
+
|
3 |
+
class DoctorAppointmentApp(models.Model):
|
4 |
+
id = models.BigAutoField(primary_key=True)
|
5 |
+
appointment_day = models.DateField()
|
6 |
+
appointment_time = models.TimeField()
|
7 |
+
patient_name = models.CharField(max_length=255)
|
8 |
+
status = models.CharField(max_length=255)
|
9 |
+
observations = models.TextField()
|
doctorappointmentapp/serializers.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from rest_framework import serializers
|
2 |
+
from .models import DoctorAppointmentApp
|
3 |
+
|
4 |
+
class DoctorAppointmentAppSerializer(serializers.ModelSerializer):
|
5 |
+
class Meta:
|
6 |
+
model = DoctorAppointmentApp
|
7 |
+
fields = '__all__'
|
doctorappointmentapp/tests.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from django.test import TestCase
|
2 |
+
|
3 |
+
# Create your tests here.
|
doctorappointmentapp/urls.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.urls import path, include
|
2 |
+
from rest_framework.routers import DefaultRouter
|
3 |
+
from .views import DoctorAppointmentAppViewSet
|
4 |
+
|
5 |
+
router = DefaultRouter()
|
6 |
+
router.register(r'', DoctorAppointmentAppViewSet)
|
7 |
+
|
8 |
+
urlpatterns = [
|
9 |
+
# ... other URL patterns
|
10 |
+
path('', include(router.urls)),
|
11 |
+
]
|
doctorappointmentapp/views.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.shortcuts import render
|
2 |
+
from django.core.files.storage import FileSystemStorage
|
3 |
+
import django_filters
|
4 |
+
from rest_framework import viewsets
|
5 |
+
from rest_framework.decorators import action
|
6 |
+
from rest_framework.response import Response
|
7 |
+
from rest_framework.pagination import LimitOffsetPagination
|
8 |
+
from django.utils import timezone
|
9 |
+
from datetime import datetime, timedelta
|
10 |
+
import requests
|
11 |
+
|
12 |
+
from .models import DoctorAppointmentApp
|
13 |
+
from .serializers import DoctorAppointmentAppSerializer
|
14 |
+
|
15 |
+
from rest_framework.pagination import PageNumberPagination
|
16 |
+
|
17 |
+
class DoctorAppointmentAppPagination(PageNumberPagination):
|
18 |
+
page_size = 10
|
19 |
+
page_size_query_param = 'page_size'
|
20 |
+
max_page_size = 100
|
21 |
+
|
22 |
+
class DoctorAppointmentAppViewSet(viewsets.ModelViewSet):
|
23 |
+
queryset = DoctorAppointmentApp.objects.all().order_by('id')
|
24 |
+
serializer_class = DoctorAppointmentAppSerializer
|
25 |
+
pagination_class = DoctorAppointmentAppPagination
|
prescriptionapp/__init__.py
ADDED
File without changes
|
prescriptionapp/admin.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import PrescriptionApp
|
3 |
+
|
4 |
+
admin.site.register(PrescriptionApp)
|
prescriptionapp/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class PrescriptionappConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'prescriptionapp'
|
prescriptionapp/migrations/0001_initial.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 22:00
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
class Migration(migrations.Migration):
|
6 |
+
|
7 |
+
initial = True
|
8 |
+
|
9 |
+
dependencies = [
|
10 |
+
]
|
11 |
+
|
12 |
+
operations = [
|
13 |
+
migrations.CreateModel(
|
14 |
+
name='PrescriptionApp',
|
15 |
+
fields=[
|
16 |
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
17 |
+
('issue_date', models.DateField()),
|
18 |
+
('expiration_date', models.DateField(blank=True, null=True)),
|
19 |
+
('doctor_full_name', models.CharField(max_length=255)),
|
20 |
+
('medication', models.CharField(max_length=255)),
|
21 |
+
('dosage', models.CharField(max_length=255)),
|
22 |
+
('frequency', models.CharField(max_length=255)),
|
23 |
+
('refill_info', models.CharField(blank=True, max_length=255, null=True)),
|
24 |
+
('instructions', models.TextField(blank=True, null=True)),
|
25 |
+
],
|
26 |
+
),
|
27 |
+
]
|
prescriptionapp/migrations/0002_auto_20241121_2327.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 23:27
|
2 |
+
|
3 |
+
from django.db import migrations
|
4 |
+
from django.utils import timezone
|
5 |
+
from datetime import timedelta
|
6 |
+
|
7 |
+
|
8 |
+
def add_default_entries(apps, schema_editor):
|
9 |
+
PrescriptionApp = apps.get_model('prescriptionapp', 'PrescriptionApp')
|
10 |
+
|
11 |
+
PrescriptionApp.objects.create(
|
12 |
+
issue_date=timezone.now().date(),
|
13 |
+
expiration_date=(timezone.now() + timedelta(days=30)).date(),
|
14 |
+
doctor_full_name='Dr. John Doe',
|
15 |
+
medication='Ibuprofen',
|
16 |
+
dosage='200mg',
|
17 |
+
frequency='Twice daily',
|
18 |
+
refill_info='3 refills remaining',
|
19 |
+
instructions='Take with food'
|
20 |
+
)
|
21 |
+
|
22 |
+
PrescriptionApp.objects.create(
|
23 |
+
issue_date=timezone.now().date(),
|
24 |
+
expiration_date=(timezone.now() + timedelta(days=60)).date(),
|
25 |
+
doctor_full_name='Dr. Jane Smith',
|
26 |
+
medication='Lisinopril',
|
27 |
+
dosage='10mg',
|
28 |
+
frequency='Once daily',
|
29 |
+
refill_info='5 refills remaining',
|
30 |
+
instructions='Take in the morning'
|
31 |
+
)
|
32 |
+
|
33 |
+
PrescriptionApp.objects.create(
|
34 |
+
issue_date=timezone.now().date(),
|
35 |
+
expiration_date=(timezone.now() + timedelta(days=90)).date(),
|
36 |
+
doctor_full_name='Dr. Robert Johnson',
|
37 |
+
medication='Metformin',
|
38 |
+
dosage='500mg',
|
39 |
+
frequency='Twice daily',
|
40 |
+
refill_info='2 refills remaining',
|
41 |
+
instructions='Take before meals'
|
42 |
+
)
|
43 |
+
|
44 |
+
PrescriptionApp.objects.create(
|
45 |
+
issue_date=timezone.now().date(),
|
46 |
+
expiration_date=(timezone.now() + timedelta(days=45)).date(),
|
47 |
+
doctor_full_name='Dr. Emily Davis',
|
48 |
+
medication='Atorvastatin',
|
49 |
+
dosage='10mg',
|
50 |
+
frequency='Once daily',
|
51 |
+
refill_info='4 refills remaining',
|
52 |
+
instructions='Take at bedtime'
|
53 |
+
)
|
54 |
+
|
55 |
+
PrescriptionApp.objects.create(
|
56 |
+
issue_date=timezone.now().date(),
|
57 |
+
expiration_date=(timezone.now() + timedelta(days=120)).date(),
|
58 |
+
doctor_full_name='Dr. Michael Wilson',
|
59 |
+
medication='Amoxicillin',
|
60 |
+
dosage='500mg',
|
61 |
+
frequency='Three times daily',
|
62 |
+
refill_info='6 refills remaining',
|
63 |
+
instructions='Take with food'
|
64 |
+
)
|
65 |
+
|
66 |
+
class Migration(migrations.Migration):
|
67 |
+
|
68 |
+
dependencies = [
|
69 |
+
('prescriptionapp', '0001_initial'),
|
70 |
+
]
|
71 |
+
|
72 |
+
operations = [
|
73 |
+
migrations.RunPython(add_default_entries),
|
74 |
+
]
|
prescriptionapp/migrations/__init__.py
ADDED
File without changes
|
prescriptionapp/models.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import models
|
2 |
+
class PrescriptionApp(models.Model):
|
3 |
+
id = models.BigAutoField(primary_key=True)
|
4 |
+
issue_date = models.DateField()
|
5 |
+
expiration_date = models.DateField(blank=True, null=True)
|
6 |
+
doctor_full_name = models.CharField(max_length=255)
|
7 |
+
medication = models.CharField(max_length=255)
|
8 |
+
dosage = models.CharField(max_length=255)
|
9 |
+
frequency = models.CharField(max_length=255)
|
10 |
+
refill_info = models.CharField(max_length=255, blank=True, null=True)
|
11 |
+
instructions = models.TextField(blank=True, null=True)
|
prescriptionapp/serializers.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from rest_framework import serializers
|
2 |
+
from .models import PrescriptionApp
|
3 |
+
|
4 |
+
class PrescriptionAppSerializer(serializers.ModelSerializer):
|
5 |
+
class Meta:
|
6 |
+
model = PrescriptionApp
|
7 |
+
fields = '__all__'
|
prescriptionapp/tests.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from django.test import TestCase
|
2 |
+
|
3 |
+
# Create your tests here.
|
prescriptionapp/urls.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.urls import path, include
|
2 |
+
from rest_framework.routers import DefaultRouter
|
3 |
+
from .views import PrescriptionAppViewSet
|
4 |
+
|
5 |
+
router = DefaultRouter()
|
6 |
+
router.register(r'', PrescriptionAppViewSet)
|
7 |
+
|
8 |
+
urlpatterns = [
|
9 |
+
# ... other URL patterns
|
10 |
+
path('', include(router.urls)),
|
11 |
+
]
|
prescriptionapp/views.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.shortcuts import render
|
2 |
+
from django.core.files.storage import FileSystemStorage
|
3 |
+
import django_filters
|
4 |
+
from rest_framework import viewsets
|
5 |
+
from rest_framework.decorators import action
|
6 |
+
from rest_framework.response import Response
|
7 |
+
from rest_framework.pagination import LimitOffsetPagination
|
8 |
+
from django.utils import timezone
|
9 |
+
from datetime import datetime, timedelta
|
10 |
+
import requests
|
11 |
+
|
12 |
+
from .models import PrescriptionApp
|
13 |
+
from .serializers import PrescriptionAppSerializer
|
14 |
+
|
15 |
+
from rest_framework.pagination import PageNumberPagination
|
16 |
+
|
17 |
+
class PrescriptionAppPagination(PageNumberPagination):
|
18 |
+
page_size = 10
|
19 |
+
page_size_query_param = 'page_size'
|
20 |
+
max_page_size = 100
|
21 |
+
|
22 |
+
class PrescriptionAppViewSet(viewsets.ModelViewSet):
|
23 |
+
queryset = PrescriptionApp.objects.all().order_by('id')
|
24 |
+
serializer_class = PrescriptionAppSerializer
|
25 |
+
pagination_class = PrescriptionAppPagination
|
sanjeevini/settings.py
CHANGED
@@ -44,7 +44,13 @@ INSTALLED_APPS = [
|
|
44 |
'rest_framework.authtoken',
|
45 |
'userapp',
|
46 |
'doctorapp',
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
]
|
49 |
|
50 |
MIDDLEWARE = [
|
|
|
44 |
'rest_framework.authtoken',
|
45 |
'userapp',
|
46 |
'doctorapp',
|
47 |
+
'doctorappointmentapp',
|
48 |
+
'prescriptionapp',
|
49 |
+
'userappointmentapp',
|
50 |
+
'userdiabetesapp',
|
51 |
+
'userheartapp',
|
52 |
+
'usermaternityapp',
|
53 |
+
'userweightapp',
|
54 |
]
|
55 |
|
56 |
MIDDLEWARE = [
|
sanjeevini/urls.py
CHANGED
@@ -25,4 +25,11 @@ urlpatterns = [
|
|
25 |
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
26 |
path('api/v1/userapp/', include('userapp.urls')),
|
27 |
path('api/v1/doctorapp/', include('doctorapp.urls')),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
]
|
|
|
25 |
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
26 |
path('api/v1/userapp/', include('userapp.urls')),
|
27 |
path('api/v1/doctorapp/', include('doctorapp.urls')),
|
28 |
+
path('api/v1/doctorappointmentapp/', include('doctorappointmentapp.urls')),
|
29 |
+
path('api/v1/prescriptionapp/', include('prescriptionapp.urls')),
|
30 |
+
path('api/v1/userappointmentapp/', include('userappointmentapp.urls')),
|
31 |
+
path('api/v1/userdiabetesapp/', include('userdiabetesapp.urls')),
|
32 |
+
path('api/v1/userheartapp/', include('userheartapp.urls')),
|
33 |
+
path('api/v1/usermaternityapp/', include('usermaternityapp.urls')),
|
34 |
+
path('api/v1/userweightapp/', include('userweightapp.urls')),
|
35 |
]
|
userappointmentapp/__init__.py
ADDED
File without changes
|
userappointmentapp/admin.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import UserAppointmentApp
|
3 |
+
|
4 |
+
admin.site.register(UserAppointmentApp)
|
userappointmentapp/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class UserappointmentappConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'userappointmentapp'
|
userappointmentapp/migrations/0001_initial.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 21:42
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
|
8 |
+
initial = True
|
9 |
+
|
10 |
+
dependencies = [
|
11 |
+
]
|
12 |
+
|
13 |
+
operations = [
|
14 |
+
migrations.CreateModel(
|
15 |
+
name='UserAppointmentApp',
|
16 |
+
fields=[
|
17 |
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
18 |
+
('appointment_day', models.DateField()),
|
19 |
+
('appointment_time', models.TimeField()),
|
20 |
+
('patient_name', models.CharField(max_length=255)),
|
21 |
+
('status', models.CharField(max_length=255)),
|
22 |
+
('observations', models.TextField()),
|
23 |
+
],
|
24 |
+
),
|
25 |
+
]
|
userappointmentapp/migrations/0002_auto_20241119_0922.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-19 09:22
|
2 |
+
|
3 |
+
from django.db import migrations
|
4 |
+
|
5 |
+
def add_default_entries(apps, schema_editor):
|
6 |
+
UserAppointmentApp = apps.get_model('userappointmentapp', 'UserAppointmentApp')
|
7 |
+
UserAppointmentApp.objects.create(appointment_day='2024-11-19', appointment_time='10:00:00', patient_name='User 001', status='Pending', observations='Follow-up appointment')
|
8 |
+
UserAppointmentApp.objects.create(appointment_day='2024-11-21', appointment_time='14:30:00', patient_name='User 002', status='Confirmed', observations='Routine check-up')
|
9 |
+
UserAppointmentApp.objects.create(appointment_day='2024-12-04', appointment_time='09:00:00', patient_name='User 003', status='Cancelled', observations='Patient unavailable')
|
10 |
+
|
11 |
+
class Migration(migrations.Migration):
|
12 |
+
|
13 |
+
dependencies = [
|
14 |
+
('userappointmentapp', '0001_initial'),
|
15 |
+
]
|
16 |
+
|
17 |
+
operations = [
|
18 |
+
migrations.RunPython(add_default_entries),
|
19 |
+
]
|
userappointmentapp/migrations/__init__.py
ADDED
File without changes
|
userappointmentapp/models.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import models
|
2 |
+
|
3 |
+
class UserAppointmentApp(models.Model):
|
4 |
+
id = models.BigAutoField(primary_key=True)
|
5 |
+
appointment_day = models.DateField()
|
6 |
+
appointment_time = models.TimeField()
|
7 |
+
patient_name = models.CharField(max_length=255)
|
8 |
+
status = models.CharField(max_length=255)
|
9 |
+
observations = models.TextField()
|
userappointmentapp/serializers.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from rest_framework import serializers
|
2 |
+
from .models import UserAppointmentApp
|
3 |
+
|
4 |
+
class UserAppointmentAppSerializer(serializers.ModelSerializer):
|
5 |
+
class Meta:
|
6 |
+
model = UserAppointmentApp
|
7 |
+
fields = '__all__'
|
userappointmentapp/tests.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from django.test import TestCase
|
2 |
+
|
3 |
+
# Create your tests here.
|
userappointmentapp/urls.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.urls import path, include
|
2 |
+
from rest_framework.routers import DefaultRouter
|
3 |
+
from .views import UserAppointmentAppViewSet
|
4 |
+
|
5 |
+
router = DefaultRouter()
|
6 |
+
router.register(r'', UserAppointmentAppViewSet)
|
7 |
+
|
8 |
+
urlpatterns = [
|
9 |
+
# ... other URL patterns
|
10 |
+
path('', include(router.urls)),
|
11 |
+
]
|
userappointmentapp/views.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.shortcuts import render
|
2 |
+
from django.core.files.storage import FileSystemStorage
|
3 |
+
import django_filters
|
4 |
+
from rest_framework import viewsets
|
5 |
+
from rest_framework.decorators import action
|
6 |
+
from rest_framework.response import Response
|
7 |
+
from rest_framework.pagination import LimitOffsetPagination
|
8 |
+
from django.utils import timezone
|
9 |
+
from datetime import datetime, timedelta
|
10 |
+
import requests
|
11 |
+
|
12 |
+
from .models import UserAppointmentApp
|
13 |
+
from .serializers import UserAppointmentAppSerializer
|
14 |
+
|
15 |
+
from rest_framework.pagination import PageNumberPagination
|
16 |
+
|
17 |
+
class UserAppointmentAppPagination(PageNumberPagination):
|
18 |
+
page_size = 10
|
19 |
+
page_size_query_param = 'page_size'
|
20 |
+
max_page_size = 100
|
21 |
+
|
22 |
+
class UserAppointmentAppViewSet(viewsets.ModelViewSet):
|
23 |
+
queryset = UserAppointmentApp.objects.all().order_by('id')
|
24 |
+
serializer_class = UserAppointmentAppSerializer
|
25 |
+
pagination_class = UserAppointmentAppPagination
|
userdiabetesapp/__init__.py
ADDED
File without changes
|
userdiabetesapp/admin.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import UserDiabetesApp
|
3 |
+
|
4 |
+
admin.site.register(UserDiabetesApp)
|
userdiabetesapp/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class UserdiabetesappConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'userdiabetesapp'
|
userdiabetesapp/migrations/0001_initial.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 22:00
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
class Migration(migrations.Migration):
|
6 |
+
|
7 |
+
initial = True
|
8 |
+
|
9 |
+
dependencies = [
|
10 |
+
]
|
11 |
+
|
12 |
+
operations = [
|
13 |
+
migrations.CreateModel(
|
14 |
+
name='UserDiabetesApp',
|
15 |
+
fields=[
|
16 |
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
17 |
+
('patient_name', models.CharField(max_length=255)),
|
18 |
+
('blood_glucose_level', models.DecimalField(max_digits=5, decimal_places=2)),
|
19 |
+
('measurement_date', models.DateField()),
|
20 |
+
('measurement_time', models.TimeField()),
|
21 |
+
('meal_type', models.CharField(max_length=255)),
|
22 |
+
('medication_dose', models.DecimalField(max_digits=5, decimal_places=2)),
|
23 |
+
('medication_name', models.CharField(max_length=255)),
|
24 |
+
('medication_time', models.TimeField()),
|
25 |
+
('physical_activity', models.CharField(max_length=255)),
|
26 |
+
('duration', models.IntegerField()),
|
27 |
+
('notes', models.TextField()),
|
28 |
+
],
|
29 |
+
),
|
30 |
+
]
|
userdiabetesapp/migrations/0002_auto_20241121_2352.py
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import migrations
|
2 |
+
from datetime import date, time
|
3 |
+
|
4 |
+
def create_dummy_entries(apps, schema_editor):
|
5 |
+
UserDiabetesApp = apps.get_model('userdiabetesapp', 'UserDiabetesApp')
|
6 |
+
|
7 |
+
UserDiabetesApp.objects.create(
|
8 |
+
patient_name='John Doe',
|
9 |
+
blood_glucose_level=105.5,
|
10 |
+
measurement_date=date(2022, 1, 1),
|
11 |
+
measurement_time=time(9, 0),
|
12 |
+
meal_type='Breakfast',
|
13 |
+
medication_dose=10,
|
14 |
+
medication_name='Insulin',
|
15 |
+
medication_time=time(8, 0),
|
16 |
+
physical_activity='Walk',
|
17 |
+
duration=30,
|
18 |
+
notes='Felt a bit tired after breakfast.'
|
19 |
+
)
|
20 |
+
|
21 |
+
UserDiabetesApp.objects.create(
|
22 |
+
patient_name='Jane Smith',
|
23 |
+
blood_glucose_level=95.2,
|
24 |
+
measurement_date=date(2022, 1, 2),
|
25 |
+
measurement_time=time(9, 0),
|
26 |
+
meal_type='Lunch',
|
27 |
+
medication_dose=20,
|
28 |
+
medication_name='Insulin',
|
29 |
+
medication_time=time(12, 30),
|
30 |
+
physical_activity='Run',
|
31 |
+
duration=45,
|
32 |
+
notes='Feeling better after lunch.'
|
33 |
+
)
|
34 |
+
|
35 |
+
UserDiabetesApp.objects.create(
|
36 |
+
patient_name='Robert Johnson',
|
37 |
+
blood_glucose_level=120.3,
|
38 |
+
measurement_date=date(2022, 1, 3),
|
39 |
+
measurement_time=time(9, 0),
|
40 |
+
meal_type='Dinner',
|
41 |
+
medication_dose=15,
|
42 |
+
medication_name='Insulin',
|
43 |
+
medication_time=time(19, 0),
|
44 |
+
physical_activity='Swim',
|
45 |
+
duration=60,
|
46 |
+
notes='Felt energized after dinner.'
|
47 |
+
)
|
48 |
+
|
49 |
+
UserDiabetesApp.objects.create(
|
50 |
+
patient_name='Emily Davis',
|
51 |
+
blood_glucose_level=88.9,
|
52 |
+
measurement_date=date(2022, 1, 4),
|
53 |
+
measurement_time=time(9, 0),
|
54 |
+
meal_type='Breakfast',
|
55 |
+
medication_dose=12,
|
56 |
+
medication_name='Insulin',
|
57 |
+
medication_time=time(8, 0),
|
58 |
+
physical_activity='Bike',
|
59 |
+
duration=40,
|
60 |
+
notes='Feeling good after breakfast.'
|
61 |
+
)
|
62 |
+
|
63 |
+
UserDiabetesApp.objects.create(
|
64 |
+
patient_name='Michael Wilson',
|
65 |
+
blood_glucose_level=110.7,
|
66 |
+
measurement_date=date(2022, 1, 5),
|
67 |
+
measurement_time=time(9, 0),
|
68 |
+
meal_type='Lunch',
|
69 |
+
medication_dose=25,
|
70 |
+
medication_name='Insulin',
|
71 |
+
medication_time=time(12, 30),
|
72 |
+
physical_activity='Hike',
|
73 |
+
duration=90,
|
74 |
+
notes='Felt a bit tired after lunch.'
|
75 |
+
)
|
76 |
+
|
77 |
+
|
78 |
+
# Add more entries here...
|
79 |
+
|
80 |
+
class Migration(migrations.Migration):
|
81 |
+
|
82 |
+
dependencies = [
|
83 |
+
('userdiabetesapp', '0001_initial'),
|
84 |
+
]
|
85 |
+
|
86 |
+
operations = [
|
87 |
+
migrations.RunPython(create_dummy_entries),
|
88 |
+
]
|
userdiabetesapp/migrations/__init__.py
ADDED
File without changes
|
userdiabetesapp/models.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import models
|
2 |
+
|
3 |
+
class UserDiabetesApp(models.Model):
|
4 |
+
id = models.BigAutoField(primary_key=True)
|
5 |
+
patient_name = models.CharField(max_length=255)
|
6 |
+
blood_glucose_level = models.DecimalField(max_digits=5, decimal_places=2)
|
7 |
+
measurement_date = models.DateField()
|
8 |
+
measurement_time = models.TimeField()
|
9 |
+
meal_type = models.CharField(max_length=255)
|
10 |
+
medication_dose = models.DecimalField(max_digits=5, decimal_places=2)
|
11 |
+
medication_name = models.CharField(max_length=255)
|
12 |
+
medication_time = models.TimeField()
|
13 |
+
physical_activity = models.CharField(max_length=255)
|
14 |
+
duration = models.IntegerField()
|
15 |
+
notes = models.TextField()
|
userdiabetesapp/serializers.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from rest_framework import serializers
|
2 |
+
from .models import UserDiabetesApp
|
3 |
+
|
4 |
+
class UserDiabetesAppSerializer(serializers.ModelSerializer):
|
5 |
+
class Meta:
|
6 |
+
model = UserDiabetesApp
|
7 |
+
fields = '__all__'
|
userdiabetesapp/tests.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from django.test import TestCase
|
2 |
+
|
3 |
+
# Create your tests here.
|
userdiabetesapp/urls.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.urls import path, include
|
2 |
+
from rest_framework.routers import DefaultRouter
|
3 |
+
from .views import UserDiabetesAppViewSet
|
4 |
+
|
5 |
+
router = DefaultRouter()
|
6 |
+
router.register(r'', UserDiabetesAppViewSet)
|
7 |
+
|
8 |
+
urlpatterns = [
|
9 |
+
# ... other URL patterns
|
10 |
+
path('', include(router.urls)),
|
11 |
+
]
|
userdiabetesapp/views.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.shortcuts import render
|
2 |
+
from django.core.files.storage import FileSystemStorage
|
3 |
+
import django_filters
|
4 |
+
from rest_framework import viewsets
|
5 |
+
from rest_framework.decorators import action
|
6 |
+
from rest_framework.response import Response
|
7 |
+
from rest_framework.pagination import LimitOffsetPagination
|
8 |
+
from django.utils import timezone
|
9 |
+
from datetime import datetime, timedelta
|
10 |
+
import requests
|
11 |
+
|
12 |
+
from .models import UserDiabetesApp
|
13 |
+
from .serializers import UserDiabetesAppSerializer
|
14 |
+
|
15 |
+
from rest_framework.pagination import PageNumberPagination
|
16 |
+
|
17 |
+
class UserDiabetesAppPagination(PageNumberPagination):
|
18 |
+
page_size = 10
|
19 |
+
page_size_query_param = 'page_size'
|
20 |
+
max_page_size = 100
|
21 |
+
|
22 |
+
class UserDiabetesAppViewSet(viewsets.ModelViewSet):
|
23 |
+
queryset = UserDiabetesApp.objects.all().order_by('id')
|
24 |
+
serializer_class = UserDiabetesAppSerializer
|
25 |
+
pagination_class = UserDiabetesAppPagination
|
userheartapp/__init__.py
ADDED
File without changes
|
userheartapp/admin.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import UserHeartApp
|
3 |
+
|
4 |
+
admin.site.register(UserHeartApp)
|
userheartapp/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class UserheartappConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'userheartapp'
|
userheartapp/migrations/0001_initial.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 5.1.1 on 2024-11-21 21:42
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
class Migration(migrations.Migration):
|
6 |
+
|
7 |
+
initial = True
|
8 |
+
|
9 |
+
dependencies = [
|
10 |
+
]
|
11 |
+
|
12 |
+
operations = [
|
13 |
+
migrations.CreateModel(
|
14 |
+
name='UserHeartApp',
|
15 |
+
fields=[
|
16 |
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
17 |
+
('appointment_day', models.DateField()),
|
18 |
+
('appointment_time', models.TimeField()),
|
19 |
+
('patient_name', models.CharField(max_length=255)),
|
20 |
+
('status', models.CharField(max_length=255)),
|
21 |
+
('observations', models.TextField()),
|
22 |
+
('heart_rate', models.IntegerField()),
|
23 |
+
('blood_pressure_systolic', models.IntegerField()),
|
24 |
+
('blood_pressure_diastolic', models.IntegerField()),
|
25 |
+
('oxygen_saturation', models.DecimalField(max_digits=4, decimal_places=2)),
|
26 |
+
],
|
27 |
+
),
|
28 |
+
]
|