1
0
Fork 0

patient_records.description

master
panliang 2023-10-26 18:00:07 +08:00
parent c20c21fb2d
commit 3ce99c0d32
30 changed files with 38 additions and 23 deletions

View File

@ -38,7 +38,7 @@ class PatientRecordController extends AdminController
->filter($this->baseFilter()->actions()->body([
amisMake()->SelectControl()->options($this->getPatientOptions())->searchable()->name('patient_id')->label(__('patient-record.patient_id'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getTypeOptions())->name('type_id')->label(__('patient-record.type_id'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getIllnessOption())->name('illness_type_id')->label(__('patient-record.illness_type_id'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getIllnessOption())->name('illness_type_id')->label(__('patient-record.illness_type_id'))->searchable()->size('md')->clearable(),
amisMake()->DateRangeControl()->name('treat_range')->label(__('patient-record.treat_at'))->size('md')->clearable(),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('doctor_id')->label(__('patient-record.doctor_id'))->clearable()->size('md'),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('inviter_id')->label(__('patient-record.inviter_id'))->clearable()->size('md'),
@ -139,11 +139,12 @@ class PatientRecordController extends AdminController
->initFetch(false)
// ->body(Components::make()->fuEditorControl()->name('content')->label(__('patient-record.content'))),
->body(amisMake()->TextareaControl()->name('content')->label(__('patient-record.content'))),
amisMake()->TextareaControl()->name('description')->label(__('patient-record.description')),
amisMake()->ImageControl()->multiple()->receiver(admin_url('upload_image') . '?full-url=1')->name('images')->label(__('patient-record.images')),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at')),
amisMake()->SwitchControl()->name('is_notified')->label(__('patient-record.is_notified'))->trueValue(0)->falseValue(1),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('notify_user_id')->label(__('patient-record.notify_user_id')),
amisMake()->DateControl()->name('notify_at')->label(__('patient-record.notify_at')),
amisMake()->DateTimeControl()->name('notify_at')->label(__('patient-record.notify_at')),
// amisMake()->TextControl()->name('notify_remarks')->label(__('patient-record.notify_remarks')),
// amisMake()->TextControl()->label(__('patient-record.creator_id'))->name('creator_id')->value($this->user()->name)->readonly(),
);
@ -176,7 +177,8 @@ class PatientRecordController extends AdminController
['label' => __('patient-record.illness_type_id'), 'content' => '${illness_type.name}', 'span' => 3],
['label' => __('patient-record.content'), 'content' => amisMake()->Tpl()->tpl('${content | raw}'), 'span' => 3],
['label' => __('patient-record.content'), 'content' => amisMake()->TextareaControl()->labelWidth('0px')->static()->value('${content}'), 'span' => 3],
['label' => __('patient-record.description'), 'content' => amisMake()->TextareaControl()->labelWidth('0px')->static()->value('${description}'), 'span' => 3],
['label' => __('patient-record.images'), 'content' => amisMake()->Images()->source('${images}')->defaultImage(null), 'span' => 3],
['label' => __('patient-record.next_treat_at'), 'content' => '${next_treat_at}'],

View File

@ -34,11 +34,13 @@ class TotalIllnessTypeController extends AdminController
]))
->columns([
amisMake()->Column()->name('name')->label(__('total-illness-type.id')),
amisMake()->Column()->name('patient_count')->label(__('total-illness-type.patient_count')),
amisMake()->Column()->name('count')->label(__('total-illness-type.count')),
])
->affixRowClassName('text-info-dk')
->affixRow([
['type' => 'text', 'text' => '总计: ${total}'],
['type' => 'text', 'text' => __('total-illness-type.patient_count'). ': ${patient_count}'],
['type' => 'text', 'text' => __('total-illness-type.count'). ': ${count}'],
]);
@ -100,10 +102,12 @@ class TotalIllnessTypeController extends AdminController
AdminExport::make($query)
->setHeadings([
__('total-illness-type.id'),
__('total-illness-type.patient_count'),
__('total-illness-type.count'),
])
->setMap(fn($row) => [
$row->name,
$row->illnessTypeRecords->groupBy('patient_id')->count(),
$row->illnessTypeRecords->count()
])
->store($path);

View File

@ -5,6 +5,7 @@ namespace App\Admin\Services;
use App\ModelFilters\KeywordFilter;
use App\Models\Keyword;
use App\Models\PatientRecord;
use Illuminate\Support\Facades\DB;
class TotalIllnessTypeService extends BaseService
{
@ -38,16 +39,21 @@ class TotalIllnessTypeService extends BaseService
$list = (clone $query)->paginate(request()->input('perPage', 20));
$items = collect($list->items())->map(function ($item) {
$item['count'] = $item->illnessTypeRecords->count();
$item['patient_count'] = $item->illnessTypeRecords->groupBy('patient_id')->count();
return $item;
});
$count = PatientRecord::filter([
'illness_type_id' => request('id'),
'treat_range' => request('treat_range'),
])->count();
$patient_count = PatientRecord::filter([
'illness_type_id' => request('id'),
'treat_range' => request('treat_range'),
])->select(['patient_id', 'illness_type_id', DB::raw('count(`patient_id`) as count')])->groupBy('patient_id', 'illness_type_id')->get()->count();
// $allList = (clone $query)->get();
// $count = round($allList->sum(fn ($item) => $item->illnessTypeRecords->count()), 2, PHP_ROUND_HALF_DOWN);;
$total = $list->total();
return compact('items', 'total', 'count');
return compact('items', 'total', 'count', 'patient_count');
}
}

View File

@ -34,7 +34,7 @@ class PatientRecordNotify extends Command
->where('is_notified', 0)
->whereNotNull('notify_user_id')
->whereNotNull('next_treat_at')
->where('notify_at', '<=', $now->copy()->endOfDay())
->where('notify_at', '<=', $now->copy()->endOfMinute())
->get();
// 微信公众号关联账户
$adminUsers = UserSocialite::where('user_type', (new AdminUser)->getMorphClass())

View File

@ -14,7 +14,7 @@ class Kernel extends ConsoleKernel
{
// $schedule->command('inspire')->hourly();
// $schedule->call(fn () => logger('schedule running'))->everyMinute();
$schedule->command('patient-record:notify')->dailyAt('7:00');
$schedule->command('patient-record:notify')->everyMinute();
$schedule->command('user:birthday-notify')->dailyAt('8:00');
}

View File

@ -20,7 +20,7 @@ class PatientRecord extends Model
protected $fillable = [
'patient_id', 'user_id', 'type_id', 'illness_type_id',
'treat_at', 'content', 'images',
'treat_at', 'content', 'description', 'images',
'doctor_id', 'doctor_ratio', 'doctor_money',
'saler_id', 'saler_ratio', 'saler_money',
'inviter_id', 'inviter_ratio', 'inviter_money',
@ -33,7 +33,7 @@ class PatientRecord extends Model
protected $casts = [
'order_status' => OrderStatus::class,
'notify_at' => 'date',
'notify_at' => 'datetime',
'treat_at' => 'datetime',
'next_treat_at' => 'datetime',
'origin_price' => 'float',

View File

@ -18,6 +18,7 @@ return new class extends Migration
$table->unsignedBigInteger('illness_type_id')->comment('病种, keywords.id');
$table->timestamp('treat_at')->comment('就诊时间');
$table->text('content')->nullable()->comment('就诊情况');
$table->text('description')->nullable()->comment('服用方法');
$table->json('images')->nullable()->comment('图片');
$table->decimal('origin_price')->default(0)->comment('划线价');
$table->decimal('sell_price')->default(0)->comment('实收价');

View File

@ -29,4 +29,5 @@ return [
'images' => '图片资料',
'illness_type_id' => '病种',
'total_money' => '总提成',
'description' => '服用方法',
];

View File

@ -5,4 +5,5 @@ return [
'name' => '病种',
'count' => '次数',
'treat_at' => '时间段',
'patient_count' => '人数',
];

View File

@ -1,2 +1,2 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/client/static/index.5841170f.css"/><script defer="defer" src="/client/static/js/chunk-vendors.40c214d6.js"></script><script defer="defer" src="/client/static/js/index.a1eadb07.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/client/static/index.5841170f.css"/><script defer="defer" src="/client/static/js/chunk-vendors.40c214d6.js"></script><script defer="defer" src="/client/static/js/index.e21192b7.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[810],{5637:function(t,a,e){var n=e(8515);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);var i=e(5472).Z;i("5c9351de",n,!0,{sourceMap:!1,shadowMode:!1})},6704:function(t,a,e){"use strict";e.r(a),e.d(a,{default:function(){return c}});var n,i={uCellGroup:e(156).Z,uCell:e(7981).Z,"u-Text":e(1153).Z,uAlbum:e(3093).Z,uButton:e(7344).Z},o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"page"},[e("u-cell-group",{attrs:{border:!1}},[e("u-cell",{attrs:{title:"类别",value:t.info.type?t.info.type.name:""}}),e("u-cell",{attrs:{title:"初次"+t.type,value:t._f("date")(t.info.treat_at,"yyyy-MM-dd")}}),e("u-cell",{attrs:{title:"病情描述"}},[e("v-uni-view",{attrs:{slot:"label"},slot:"label"},[e("u--text",{attrs:{text:t.info.illness,type:"info",wordWrap:"anywhere"}})],1)],1),e("u-cell",{attrs:{title:"图片资料"}},[e("v-uni-view",{attrs:{slot:"value"},slot:"value"},[e("u-album",{attrs:{urls:t.info.images}})],1)],1)],1),e("v-uni-view",{staticClass:"btn"},[e("u-button",{attrs:{text:"病历记录",type:"success"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.record.apply(void 0,arguments)}}})],1)],1)},u=[],l={data:function(){return{id:"",info:{images:[],doctor_id:"",doctor:{}},type:""}},onLoad:function(t){this.id=t.id,this.loadData()},onPullDownRefresh:function(){this.loadData()},methods:{loadData:function(){var t=this;this.id&&(uni.showLoading(),this.$ajax.get("/api/client/patient/".concat(this.id)).then((function(a){uni.stopPullDownRefresh(),0==a.status&&(t.info=a.data,t.type=t.info.type?t.info.type.name:"",uni.setNavigationBarTitle({title:t.info.name}))})).catch((function(t){uni.stopPullDownRefresh()})))},record:function(){uni.navigateTo({url:"/pages/record/index?patient=".concat(this.id)})}}},s=l,r=(e(5637),e(1503)),d=(0,r.Z)(s,o,u,!1,null,"67d156ca",null,!1,i,n),c=d.exports},8515:function(t,a,e){"use strict";e.r(a);var n=e(2916),i=e.n(n),o=e(3282),u=e.n(o),l=u()(i());l.push([t.id,".page[data-v-67d156ca]{padding:20px;background:#fff}.u-cell-group[data-v-67d156ca]{background:#fff}.btn[data-v-67d156ca]{padding:0 10px}.btn .u-button[data-v-67d156ca]{margin-top:20px}.page[data-v-67d156ca] .u-upload__wrap{justify-content:flex-end}.text-gray[data-v-67d156ca]{color:gray}",""]),a["default"]=l}}]);

View File

@ -0,0 +1 @@
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[810],{1405:function(t,a,e){var n=e(1656);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);var i=e(5472).Z;i("bf81a3b8",n,!0,{sourceMap:!1,shadowMode:!1})},7816:function(t,a,e){"use strict";e.r(a),e.d(a,{default:function(){return f}});var n,i={uCellGroup:e(156).Z,uCell:e(7981).Z,"u-Text":e(1153).Z,uAlbum:e(3093).Z,uButton:e(7344).Z},r=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"page"},[e("u-cell-group",{attrs:{border:!1}},[e("u-cell",{attrs:{title:"类别",value:t.info.type?t.info.type.name:""}}),e("u-cell",{attrs:{title:"初次"+t.type,value:t._f("date")(t.info.treat_at,"yyyy-MM-dd")}}),e("u-cell",{attrs:{title:"病情描述或理疗项目"}},[e("v-uni-view",{attrs:{slot:"label"},slot:"label"},[e("u--text",{attrs:{text:t.info.illness,type:"info",wordWrap:"anywhere"}})],1)],1),e("u-cell",{attrs:{title:"图片资料"}},[e("v-uni-view",{attrs:{slot:"value"},slot:"value"},[e("u-album",{attrs:{urls:t.info.images}})],1)],1),e("u-cell",{attrs:{title:"服务或诊疗次数",value:t.total_record}})],1),e("v-uni-view",{staticClass:"btn"},[e("u-button",{attrs:{text:"病历记录",type:"success"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.record.apply(void 0,arguments)}}})],1)],1)},u=[],o=e(3762),l=e(3062),s={data:function(){return{id:"",info:{images:[],doctor_id:"",doctor:{}},total_record:"0",type:""}},onLoad:function(t){this.id=t.id,this.loadData()},onPullDownRefresh:function(){this.loadData()},methods:{loadData:function(){var t=this;return(0,l.Z)((0,o.Z)().mark((function a(){var e,n;return(0,o.Z)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(t.id){a.next=2;break}return a.abrupt("return");case 2:return uni.showLoading(),a.next=5,t.$ajax.get("/api/client/patient/".concat(t.id));case 5:return e=a.sent,uni.stopPullDownRefresh(),0==e.status&&(t.info=e.data,t.info.images=null!==(n=e.data.images)&&void 0!==n?n:[],t.type=t.info.type?t.info.type.name:"",uni.setNavigationBarTitle({title:t.info.name})),a.next=10,t.$ajax.get("/api/client/record",{params:{patient_id:t.id}});case 10:e=a.sent,0==e.status&&(t.total_record=e.data.total+"");case 12:case"end":return a.stop()}}),a)})))()},record:function(){uni.navigateTo({url:"/pages/record/index?patient=".concat(this.id)})}}},c=s,d=(e(1405),e(1503)),p=(0,d.Z)(c,r,u,!1,null,"1a60784c",null,!1,i,n),f=p.exports},1656:function(t,a,e){"use strict";e.r(a);var n=e(2916),i=e.n(n),r=e(3282),u=e.n(r),o=u()(i());o.push([t.id,".page[data-v-1a60784c]{padding:20px;background:#fff}.u-cell-group[data-v-1a60784c]{background:#fff}.btn[data-v-1a60784c]{padding:0 10px}.btn .u-button[data-v-1a60784c]{margin-top:20px}.page[data-v-1a60784c] .u-upload__wrap{justify-content:flex-end}.text-gray[data-v-1a60784c]{color:gray}",""]),a["default"]=o}}]);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[487],{3449:function(t,e,n){var a=n(2041);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.id,a,""]]),a.locals&&(t.exports=a.locals);var i=n(5472).Z;i("5fe8d039",a,!0,{sourceMap:!1,shadowMode:!1})},2990:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return f}});var a,i={uCellGroup:n(156).Z,uCell:n(7981).Z,"u-Text":n(1153).Z,uAlbum:n(3093).Z},r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"page"},[n("u-cell-group",{attrs:{border:!1}},[n("u-cell",{attrs:{title:"姓名",value:this.info.patient?this.info.patient.name:""}}),n("u-cell",{attrs:{title:"类别",value:t.info.type?t.info.type.name:""}}),n("u-cell",{attrs:{title:"病种或项目",value:t.info.illness_type?t.info.illness_type.name:""}}),n("u-cell",{attrs:{title:t.type.text+"时间",value:t._f("date")(t.info.treat_at)}}),n("u-cell",{attrs:{title:t.type.text+"情况"}},[n("v-uni-view",{attrs:{slot:"label"},slot:"label"},[n("u--text",{attrs:{text:t.info.content,type:"info",wordWrap:"anywhere"}})],1)],1),n("u-cell",{attrs:{title:"服用方法"}},[n("v-uni-view",{attrs:{slot:"label"},slot:"label"},[n("u--text",{attrs:{text:t.info.description,type:"info",wordWrap:"anywhere"}})],1)],1),n("u-cell",{attrs:{title:"图片资料"}},[n("v-uni-view",{attrs:{slot:"value"},slot:"value"},[n("u-album",{attrs:{urls:t.info.images}})],1)],1),n("u-cell",{attrs:{title:"下次就诊时间",value:t._f("date")(t.info.next_treat_at)}})],1)],1)},s=[],o=n(3762),l=n(3062),u={data:function(){return{id:"",info:{patient_id:"",type_id:"",origin_price:"",sell_price:"",notify_remarks:"",is_notified:0},type:{text:""}}},onLoad:function(t){this.id=t.id,this.loadData()},onPullDownRefresh:function(){this.loadData()},methods:{loadData:function(){var t=this;return(0,l.Z)((0,o.Z)().mark((function e(){var n,a;return(0,o.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.id){e.next=2;break}return e.abrupt("return");case 2:return uni.showLoading(),e.next=5,t.$ajax.get("/api/client/record/".concat(t.id));case 5:n=e.sent,uni.stopPullDownRefresh(),0==n.status&&(t.info=n.data,t.info.images=null!==(a=n.data.images)&&void 0!==a?a:[],t.type.text=t.info.type?t.info.type.name:"");case 8:case"end":return e.stop()}}),e)})))()}}},p=u,c=(n(3449),n(1503)),d=(0,c.Z)(p,r,s,!1,null,"002ce672",null,!1,i,a),f=d.exports},2041:function(t,e,n){"use strict";n.r(e);var a=n(2916),i=n.n(a),r=n(3282),s=n.n(r),o=s()(i());o.push([t.id,".page[data-v-002ce672]{padding:20px;background:#fff}.btn[data-v-002ce672]{padding:0 10px}.btn .u-button[data-v-002ce672]{margin-top:20px}.text-gray[data-v-002ce672]{color:gray}",""]),e["default"]=o},6725:function(t,e){"use strict";e.Z={props:{lang:String,sessionFrom:String,sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,showMessageCard:Boolean,appParameter:String,formType:String,openType:String}}},8987:function(t,e){"use strict";e.Z={props:{openType:String},methods:{onGetUserInfo(t){this.$emit("getuserinfo",t.detail)},onContact(t){this.$emit("contact",t.detail)},onGetPhoneNumber(t){this.$emit("getphonenumber",t.detail)},onError(t){this.$emit("error",t.detail)},onLaunchApp(t){this.$emit("launchapp",t.detail)},onOpenSetting(t){this.$emit("opensetting",t.detail)}}}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7eabb1da.js"></script><script defer="defer" src="/h5/static/js/index.61f8b50b.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7eabb1da.js"></script><script defer="defer" src="/h5/static/js/index.c596893a.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long