新增查看患者病例接口

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
+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);
}
}