新增查看患者病例接口

This commit is contained in:
2023-03-01 11:12:16 +08:00
parent 63f4c41cc3
commit 523242ff4c
10 changed files with 257 additions and 15 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class PatientFamily extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['family_id' => 'integer', 'patient_id' => 'integer', 'relation' => 'integer', 'status' => 'integer', 'is_default' => 'integer', 'type' => 'integer', 'sex' => 'integer', 'age' => 'integer', 'province_id' => 'integer', 'city_id' => 'integer', 'county_id' => 'integer', 'marital_status' => 'integer', 'nation_id' => 'integer', 'job_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['family_id' => 'string', 'patient_id' => 'string', 'relation' => 'integer', 'status' => 'integer', 'is_default' => 'integer', 'type' => 'integer', 'sex' => 'integer', 'age' => 'integer', 'province_id' => 'integer', 'city_id' => 'integer', 'county_id' => 'integer', 'marital_status' => 'integer', 'nation_id' => 'integer', 'job_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "family_id";
+60
View File
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $family_health_id 主键id
* @property int $family_id 家庭成员id
* @property int $patient_id 患者id
* @property string $disease_name 疾病名称
* @property string $diagnosis_date 确诊日期
* @property string $diagnosis_hospital 确诊医院
* @property string $drugs_name 正在服药名称
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class PatientFamilyHealth extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'patient_family_health';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['family_health_id', 'family_id', 'patient_id', 'disease_name', 'diagnosis_date', 'diagnosis_hospital', 'drugs_name', 'created_at', 'updated_at'];
protected string $primaryKey = "family_health_id";
/**
* 获取数据-单
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getOne(array $params, array $fields = ['*']): object|null
{
return self::where($params)->first($fields);
}
/**
* 获取数据-多
* @param array $params
* @param array $fields
* @return Collection|array
*/
public static function getList(array $params = [], array $fields = ['*']): Collection|array
{
return self::where($params)->get($fields);
}
}
+68
View File
@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $family_personal_id 主键id
* @property int $family_id 信息表id
* @property int $patient_id 患者id
* @property int $is_allergy_history 是否存在过敏史(0:否 1:是)
* @property string $allergy_history 过敏史描述
* @property int $is_family_history 是否存在家族病史(0:否 1:是)
* @property string $family_history 家族病史描述
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
* @property string $pregnant 备孕、妊娠、哺乳期描述
* @property int $is_operation 是否存在手术(0:否 1:是)
* @property string $operation 手术描述
* @property int $drink_wine_status 饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)
* @property int $smoke_status 吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)
* @property int $chemical_compound_status 化合物状态(1:从不 2:偶尔 3:经常 4:每天)
* @property string $chemical_compound_describe 化合物描述
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class PatientFamilyPersonal extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'patient_family_personal';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['family_personal_id', 'family_id', 'patient_id', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_operation', 'operation', 'drink_wine_status', 'smoke_status', 'chemical_compound_status', 'chemical_compound_describe', 'created_at', 'updated_at'];
protected string $primaryKey = "family_personal_id";
/**
* 获取数据-单
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getOne(array $params, array $fields = ['*']): object|null
{
return self::where($params)->first($fields);
}
/**
* 获取数据-多
* @param array $params
* @param array $fields
* @return Collection|array
*/
public static function getList(array $params = [], array $fields = ['*']): Collection|array
{
return self::where($params)->get($fields);
}
}