基于Django的web的病历管理系统模型类设计
时间: 2024-06-12 20:07:52 浏览: 15
以下是基于Django的病历管理系统模型类设计,包括病人、医生、病历、诊断等模型类:
1. 病人模型类
```python
from django.db import models
class Patient(models.Model):
name = models.CharField(max_length=50)
age = models.IntegerField()
gender = models.CharField(max_length=10)
phone = models.CharField(max_length=20)
address = models.CharField(max_length=100)
email = models.EmailField()
occupation = models.CharField(max_length=50)
```
2. 医生模型类
```python
from django.db import models
class Doctor(models.Model):
name = models.CharField(max_length=50)
age = models.IntegerField()
gender = models.CharField(max_length=10)
phone = models.CharField(max_length=20)
address = models.CharField(max_length=100)
email = models.EmailField()
specialty = models.CharField(max_length=50)
experience = models.IntegerField()
```
3. 病历模型类
```python
from django.db import models
from datetime import datetime
class MedicalRecord(models.Model):
patient = models.ForeignKey(Patient, on_delete=models.CASCADE)
doctor = models.ForeignKey(Doctor, on_delete=models.CASCADE)
date = models.DateTimeField(default=datetime.now)
chief_complaint = models.TextField()
present_illness = models.TextField()
past_history = models.TextField()
family_history = models.TextField()
personal_history = models.TextField()
examination = models.TextField()
lab_results = models.TextField()
diagnosis = models.TextField()
treatment_plan = models.TextField()
```
4. 诊断模型类
```python
from django.db import models
class Diagnosis(models.Model):
medical_record = models.ForeignKey(MedicalRecord, on_delete=models.CASCADE)
diagnosis = models.CharField(max_length=100)
treatment = models.TextField()
```
以上是基于Django的病历管理系统的模型类设计,可以根据实际需求进行修改和完善。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![tar](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)