電子カルテもどき
2024-04-08 (月) 12:21:17
lucidinst45.shでORCAをインストールしたテストマシンで以下を実行。
$ sudo -i # cd /tmp # wget -r -np http://yukeikai.net/data/orcainst2 # cd yukeikai.net/data/orcainst2 # sh karteinstlucid.sh
次に、
# su - orca
$ psql orca
orca=> create table k_table(date varchar not null,id varchar,comment varchar,fname varchar,primary key (date));
postgresql.confの変更†
#listen_addresses = 'localhost'
から
listen_addresses = '*'
に変更
/etc/postgresql/8.4/main/pg_hba.confの設定†
default設定は、
# Database administrative login by UNIX sockets local all postgres ident # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ident # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
このままではjoho.phpにアクセスできない。
host all all 127.0.0.1/32 md5 host all all ::1/128 md5
を
host all all 127.0.0.1/32 trust host all all ::1/128 trust
にすると可能になる。
passwordでアクセスしたいので、
host all all 127.0.0.1/32 md5 host all all ::1/128 md5
にもどす。
手順書に従いpasswordをhogehogeにしてみる。
# sudo -u postgres psql template1 template1=# ALTER USER orca WITH PASSWORD 'hogehoge'; ALTER ROLE template1=# \q
karte.phpの36行目あたりの
$conn = pg_connect("host=localhost dbname=orca user=orca");
を
$conn = pg_connect("host=localhost dbname=orca password=hogehoge user=orca");
に、 karte.phpの94行目あたりの
$d_base = pg_connect("host=localhost dbname=orca user=orca");
を
$d_base = pg_connect("host=localhost dbname=orca password=hogehoge user=orca");
に変更する。これだけでOK。pg_hba.confを変更する必要はない。
orcaサーバ以外にインストールしたクライアントphpからpostgresqlに接続†
pg_hba.conf
# IPv4 local connections: host all all 127.0.0.1/32 trust
の下に
host all all 192.168.0.30/0 trust
を追記
192.168.0.30はクライアントのIPアドレス。
https://izumii19.hatenablog.com/entry/2018/12/09/152714
php5の設定変更†
/etc/apache2/mods-available/php5.confを編集
php_admin_value engine Off
を
#php_admin_value engine Off
として
/etc/init.d/apache2 restart
WindowsのInternet Explorerから
http://orca/~ormaster/karte/karte.php
orcaはサーバ名
apache2 + php5 でpostgresqlに接続。orcaの頭書きを読み出して電子カルテのデータはk_tableに格納する。
スキャナで読みとった画像、文書データなどの貼り付け可能。データは/home/ormaster/public_html/karte/imgに格納。
orcaのデータはread onlyで利用するだけなのでorcaデータベース破壊の心配はなし。