147
+    def __str__(self):
148
+        return f"{self.title} {self.address_text}"
149
+
150
+
151
+class Bed(models.Model):
152
+    code = models.CharField(max_length=30)
153
+    occupy = models.BooleanField(default=False)
154
+    patient = models.ForeignKey(Patient, on_delete=models.SET_NULL, null=True, blank=True)
155
+    hospital = models.ForeignKey(Hospital, on_delete=models.CASCADE)
156
+    created_at = models.DateTimeField(auto_now_add=True, null=True)
157
+    updated_at = models.DateTimeField(auto_now=True)
158
+
159
+
160
+    def __str__(self):
161
+        return self.code
162
+
163
+
164
+class PatientLog(models.Model):
165
+    patient = models.ForeignKey(Patient, on_delete=models.SET_NULL, null=True)
166
+    hospital = models.ForeignKey(Hospital, on_delete=models.CASCADE, null=True)
167
+    bed = ChainedForeignKey(
168
+        "Bed",
169
+        chained_field="hospital",
170
+        chained_model_field="hospital",
171
+        show_all=False,
172
+        auto_choose=True,
173
+        null=True
174
+    )
175
+    notes  = models.TextField(blank=True, null=True)
176
+    condition_level = models.CharField(
177
+        max_length=30,
178
+        choices=(("green", "Green"), ("yellow", "Yellow"), ("red", "Red")),
179
+        null=True,
180
+    )
181
+    status = models.CharField(
182
+        max_length=30,
183
+        choices=(("active", "Active"), ("inactive", "Inactive"), ("transfer", "Transfer")),
184
+        null=True,
185
+    )
186
+    checkin_at = models.DateTimeField(null=True, blank=True)
187
+    checkout_at = models.DateTimeField(null=True, blank=True)
188
+
189
+    created_at = models.DateTimeField(auto_now_add=True, null=True)
190
+    updated_at = models.DateTimeField(auto_now=True)
191
+
192
+

+ 3 - 0
backend/tests.py

@@ -0,0 +1,3 @@
1
+from django.test import TestCase
2
+
3
+# Create your tests here.

+ 7 - 0
backend/urls.py

@@ -0,0 +1,7 @@
1
+from django.urls import path
2
+
3
+from . import views
4
+
5
+urlpatterns = [
6
+    path('', views.index, name='index'),
7
+]

+ 8 - 0
backend/views.py

@@ -0,0 +1,8 @@
1
+from django.shortcuts import render
2
+
3
+# Create your views here.
4
+from django.http import HttpResponse
5
+
6
+
7
+def index(request):
8
+    return HttpResponse("Hello, world. You're at the polls index.")

+ 1 - 0
data/db/PG_VERSION

@@ -0,0 +1 @@
1
+13

BIN
data/db/base/1/112


BIN
data/db/base/1/113


BIN
data/db/base/1/1247


BIN
data/db/base/1/1247_fsm


BIN
data/db/base/1/1247_vm


BIN
data/db/base/1/1249


BIN
data/db/base/1/1249_fsm


BIN
data/db/base/1/1249_vm


BIN
data/db/base/1/1255


BIN
data/db/base/1/1255_fsm


BIN
data/db/base/1/1255_vm


BIN
data/db/base/1/1259


BIN
data/db/base/1/1259_fsm


BIN
data/db/base/1/1259_vm


BIN
data/db/base/1/13245


BIN
data/db/base/1/13245_fsm


BIN
data/db/base/1/13245_vm


+ 0 - 0
data/db/base/1/13247


BIN
data/db/base/1/13249


BIN
data/db/base/1/13250


BIN
data/db/base/1/13250_fsm


BIN
data/db/base/1/13250_vm


+ 0 - 0
data/db/base/1/13252


BIN
data/db/base/1/13254


BIN
data/db/base/1/13255


BIN
data/db/base/1/13255_fsm


BIN
data/db/base/1/13255_vm


+ 0 - 0
data/db/base/1/13257


BIN
data/db/base/1/13259


BIN
data/db/base/1/13260


BIN
data/db/base/1/13260_fsm


BIN
data/db/base/1/13260_vm


+ 0 - 0
data/db/base/1/13262


+ 0 - 0
data/db/base/1/13264


Some files were not shown because too many files changed in this diff

tum/farmster2 - Gogs: Simplico Git Service

Keine Beschreibung

.gitignore 399B

123456789101112131415161718192021222324252627282930313233
  1. # Specifies intentionally untracked files to ignore when using Git
  2. # http://git-scm.com/docs/gitignore
  3. *~
  4. *.sw[mnpcod]
  5. .tmp
  6. *.tmp
  7. *.tmp.*
  8. *.sublime-project
  9. *.sublime-workspace
  10. .DS_Store
  11. Thumbs.db
  12. UserInterfaceState.xcuserstate
  13. $RECYCLE.BIN/
  14. *.log
  15. log.txt
  16. npm-debug.log*
  17. /.angular
  18. /.idea
  19. /.ionic
  20. /.sass-cache
  21. /.sourcemaps
  22. /.versions
  23. /.vscode
  24. /coverage
  25. /dist
  26. /node_modules
  27. /platforms
  28. /plugins
  29. /www