1.情報の表示
[利用データベース]
消防署テーブル(id, 消防署名, 地域id(5桁), 緯度, 経度, 種別, 住所)
地域テーブル(id(5桁), 地域名, 人口, その他の情報(人口比率など), 県コード, 2次医療圏id)
病院テーブル(病院ID, 病院名, 地域id(5桁), 住所, 緯度, 経度, 医師数, 病床数, 病院区分)
2次医療圏テーブル(id(4桁), 2次医療圏名, その他情報)
県テーブル (id, name)
ここで2次医療圏をベースにして考える。
2次医療圏を指定 -> 対象地域が表示(人口、高齢化率など) -> 地域の病院情報(医師数、病床数)も得られる
2.待ち行列でモデル化
できるだけシンプルにモデル化する
(i) M/M/sでモデル化:2次医療圏を対象
[客の発生]
二次医療圏全人口PのX%が患者として、P*X(人)/日が患者発生数とする。
Xを定数:20%、または高齢化率で算出(15歳未満、65歳以上の比率がいいかも)
1時間当たりの患者発生数 = P*X(人/日)/24
例えばある2次医療圏の総人口が402525人、65歳以上率が30.83%とすると
1時間当たりの患者発生数は、402525 * 0.3083 /24 = 5170.7690 (人)となる。
[サーバー数]
病院数とする。ある2次医療圏では病院数が40。
[サービス時間]
医者一人いると患者をS時間で処置可能とする。
1病院当たりの医者の数をNとすると、1時間当たりに処置可能な患者数は(1/S)*N(人)
診療時間は10分未満が67%ということなので、5分(1/12時間)とする。
(http://www.mhlw.go.jp/toukei/saikin/hw/jyuryo/05/kekka2.html)
二次医療圏での総医者数をNとして、サービス率は (1/S)*N/病院数とする。
例えばある2次医療圏では病院数が40、医者数が570人なので、1病院当たりの医者数は570/40=14.25人となる。サービス率は 12 * 14.25 = 171となる。
サービス率はどの病院でも同じとする。
[計算]
到着率 : 5170.7690、サービス率 : 171、サーバ数 : 40として計算すると
利用率:0.75596038011696
平均待ち人数:0.18931836530515 (人/時間)
平均系内人数:30.427733569984 (人/時間)
平均待ち時間:3.6613193377068E-5 (時間)
平均系内時間:0.0058845664097513 (時間)
実際に静岡県西部でやるとこんな感じ。
コード
[mmsクラス]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyMMS{ | |
private $lambda, $mu, $row, $Q, $L, $W, $U, $s; | |
public function __construct($lambda, $mu, $s){ | |
$this->lambda = $lambda; | |
$this->mu = $mu; | |
$this->s = $s; | |
} | |
public function factorial($n){ | |
$fact = 1; | |
if($n == 0) | |
return $fact; | |
else{ | |
for($i = $n; $i>0; $i--) | |
$fact *= $i; | |
return $fact; | |
} | |
} | |
public function functionP0($a, $row){ | |
$temp = 0; | |
for($k = 0; $k <= $this->s - 1; $k++){ | |
$temp += (pow($a, (double)$k) / $this->factorial($k)); | |
} | |
$temp +=( pow($a,(double) $this->s)/ ($this->factorial($this->s)*(1.0 - $row))); | |
$p0 = pow($temp,-1); | |
return $p0; | |
} | |
public function functionMMs(){ | |
//$p0, $a; | |
$a = $this->lambda / $this->mu; | |
$this->row = $a/(double) $this->s; | |
$p0 = $this->functionP0($a, $this->row); | |
$this->Q = (pow((double) $this->s,(double) $this->s) * pow($this->row,(double) $this->s + 1.0)) / ($this->factorial($this->s) * pow(1.0 - $this->row,2.0)) * $p0;//待ち人数 | |
$this->L = $this->Q + $a;//系内人数 | |
$this->W = $this->Q / $this->lambda;//待ち時間 | |
$this->U = $this->W + (1/$this->mu);//系内時間 | |
$this->UU = $this->L / $this->lambda;//系内時間 | |
} | |
public function getrow() { | |
return $this->row; | |
} | |
public function getQ() { | |
return $this->Q; | |
} | |
public function getL() { | |
return $this->L; | |
} | |
public function getW() { | |
return $this->W; | |
} | |
public function getU() { | |
return $this->U; | |
} | |
public function getResult(){ | |
$this->functionMMs(); | |
$result = array( | |
'lambda' => $this->lambda, | |
'mu' => $this->mu, | |
's' => $this->s, | |
'row' => $this->row, | |
'Q' => $this->Q, | |
'L' => $this->L, | |
'W' => $this->W, | |
'U' => $this->U, | |
'UU' => $this->UU | |
); | |
return $result; | |
} | |
} | |
?> |
[mmsアクション]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function mms($id = null) { | |
if (!$this->Zone->exists($id)) { | |
throw new NotFoundException(__('Invalid zone')); | |
} | |
$options = array('conditions' => array('Zone.' . $this->Zone->primaryKey => $id),'recursive' => 2); | |
$this->set('zone', $this->Zone->find('first', $options)); | |
$zone = $this->Zone->find('first', $options); | |
$doctor = 0; | |
$hospital_num = 0; | |
$population = 0; | |
$rate_65 = 0; | |
foreach($zone['Region'] as $region){ | |
$population += $region['allpopulation']; | |
$rate_65 += $region['rate_population65']; | |
foreach($region['Hospital'] as $hospital){ | |
$doctor += $hospital['doctor']; | |
$hospital_num ++; | |
} | |
} | |
$rate_65 = $rate_65 / count($zone['Region']); | |
$lambda = $population * $rate_65 /100 /24; | |
$mu = 12 * $doctor / $hospital_num; | |
App::import('Vendor', 'MyMMS'); | |
$mymms = new MyMMS($lambda, $mu, $hospital_num); | |
$mms = $mymms->getResult(); | |
print_r($mymms->getResult()); | |
$data = array( | |
'id' => $zone['Zone']['id'], | |
'lambda' => $mms['lambda'], | |
'mu' => $mms['mu'], | |
'server' => $mms['s'], | |
'rho' => $mms['row'], | |
'q' => $mms['Q'], | |
'l' => $mms['L'], | |
'w' => $mms['W'], | |
'u' => $mms['U'], | |
); | |
$this->Zone->save($data); | |
} |
(ii)優先権付き待ち行列でモデル化(トリアージをするので)
災害時に病院に到着する客に優先度をつける。
参考
https://ipsj.ixsq.nii.ac.jp/ej/?action=repository_action_common_download&item_id=7376&item_no=1&attribute_id=1&file_no=1
http://www.orsj.or.jp/~archive/pdf/bul/Vol.41_02_100.pdf
[客の発生]
全人口PのX%が患者として、P*X(人)/日が患者発生数とする。PX*高齢者率Y=優先患者数(人/日)とする。その他を非優先患者数とする。
優先患者数/24 = 優先患者発生数/時となり、これをλ1とする。その他をλ2とする。
0 件のコメント:
コメントを投稿