[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[orca-users:14061] 北海道の診療(調剤)報酬請求書(明細書)等提出書
- To: orca-users@xxxxxxxxxxxxxx
- Subject: [orca-users:14061] 北海道の診療(調剤)報酬請求書(明細書)等提出書
- From: Naoki Shimaya <naoki-shimaya@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Jun 2017 17:27:48 +0900
- List-archive: </orca-users>
こんにちは、島谷@恵庭です。
ご存知のように、北海道では昨年末より表題の書類を郵送しなければならなくなりましたが、
たまに忘れてしまいます。^^;
そこで、オルカで総括表等を印刷するときについでに印刷するスクリプトを作りました。
重度とひとり親のところにチェックを入れるだけのごく簡単なものです。
(他のところは、私んとこでは事例がないのでちょっとわかりません。)
文末の"#!/bin/bash"以下を、teishutsu.shとでも名前を付けて保存、実行権限を忘れずに。
あとは、
sudo -u orca cp teishutsu.sh /usr/lib/jma-receipt/site-lib/scripts/kentan/
sudo -u orca wget -O /usr/lib/jma-receipt/site-lib/scripts/kentan/teishutsusho.pdf\
http://www.hokkaido-kokuhoren.or.jp/hotnews/files/00000600/00000650/reseputoteisyutsuhinagata12.pdf
システム管理マスタの"3004 県単独事業情報"に、teishutsu.shを登録してください。
医療機関コード、医療機関名は下記HOSPNUM、HOSPNAMEに設定して下さい。
データベースが他で動いている場合は、psqlに、-hオプションを付けて。
では。
間違い、アラ等ツッコミどころがある場合は
優しく教えていただけると幸いです。
--
Naoki Shimaya <naoki-shimaya@xxxxxxxxxxxxxxxxxx>
#!/bin/bash
. /etc/jma-receipt/jma-receipt.env
LOG_FILE="/var/log/jma-receipt/${14}test"
HOSPNUM=0123456
HOSPNAME=医療法人社団オルカクリニック
#-------------------------------------------#
# 診療報酬請求書等提出書
# $1-${11}
# 印刷DB用定固定引数(CPORCSRTLNK.INC)
# ${12} ジョブID
# ${13} シェルID
# ${14} 医療機関番号
# ${15} エラーファイル名
# ${16} 処理区分(0:一括、1:個別)
# ${17}- ${18}医療機関コード別の処理指定時
# 該当診療年月の開始、終了
#-------------------------------------------#
#
## エラーファイル削除
echo $#
echo "echo " ${MCP_TEMPDIR}/${15}
if [ -e ${MCP_TEMPDIR}/${15} ]; then
rm ${MCP_TEMPDIR}/${15}
fi
YEAR=`date +%Ey -d ${5:0:4}0101 | sed -e 'y/0123456789/0123456789/'`
MONTH=`echo ${5:4}| sed -e 's/^0/ /' | sed -e 'y/0123456789 /0123456789 /'`
cd ${ORCA_DIR}
HBTNUM=`cat <<EOF | psql orca -q -t -A
create temp table koh as (
select distinct a.ptid, c.hbtnum from tbl_sryacct_main a, tbl_hkncombi b, tbl_hknnum c
where a.sryym='$5' and a.ptid=b.ptid and a.hkncombi=b.hkncombinum and b.koh1hknnum=c.hknnum and ( c.hbtnum='43' or c.hbtnum='44'));
select count(*) from koh where hbtnum='43';
select count(*) from koh where hbtnum='44';
EOF`
OLD=$@
eval set -- $HBTNUM
if [ $1 != "0" ];then
JUUDO=check
else
JUUDO=
fi
if [ $2 != "0" ];then
HITORI=check
else
HITORI=
fi
eval set -- $OLD
cat <<EOF | ps2pdf - - | pdftk - background site-lib/scripts/kentan/teishutsusho.pdf output - | lp -d ${11} -t teishutsusho
%!PS-Adobe-3.0
%%DocumentMedia: A4 842 595 0 () ()
%%Orientation: Portrate
%%EndComments
%%BeginSetup
<< /PageSize [842 595] >> setpagedevice
%%EndSetup
%%BeginResource: font DejaVuSansMono
11 dict begin
/FontType 42 def
/FontName /DejaVuSansMono def
/PaintType 0 def
/FontMatrix [ 1 0 0 1 0 0 ] def
/FontBBox [ 0 0 0 0 ] def
/Encoding 256 array def
0 1 255 { Encoding exch /.notdef put } for
Encoding 1 /uni2714 put
/CharStrings 2 dict dup begin
/.notdef 0 def
/uni2714 1 def
end readonly def
/sfnts [
<00010000000900800003001063767420e997070c0000014c000002306670676d5b026bdf0000
037c000000ac676c7966cd6a617d0000009c000000b068656164fe6638580000042800000036
6868656108b802050000046000000024686d747809a200b200000484000000086c6f63610000
00fc0000048c0000000c6d61787005a804270000049800000020707265703ac7c007000004b8
0000071b00020068fe96046805a400030007001fbc00040114000000060114b6010805830204
002fc4d4ec310010d4ecd4ec301311211125211121680400fc73031bfce5fe96070ef8f27206
290000000001004a007204870442001d00000132171633323712373633321716151407000706
2322272627263534373601072212220f0c0cf6d159546f160a14fdcd6b25852c3014323f3d56
028e386a12016999410702140f18fd7bc343170b7b9c752b1c27000000b800cb00b800cb00aa
019100b80066000000b80087027f0002000200020002000200b800c300cb000200cb00b800b8
01cb018901ba00cb00a600fc00cb008300f2010a03c70137008300be00000058042100cb008f
009c00020002008f03e7007503bc00d300c900db007503e7013903ba00cb01d3002101df00b8
00890002000200020002000203be008900c303be007b03be0358011f016d00a401ae0000007b
00b8016f007f027b00b80252008f00cd04d1000000cd00870087009300a4006f00cd00cb00b8
0083019100dd00b4008b00f4009802e9005a00b400ba00c5042100fe000e00020002000201d5
00f6007f02aa023d0266008b00c5008f009a009a018300d500730400010a00fe00e105d5022b
00a400b4009c00000062009c05d505980087027f05d505d505f000a40000001d06b806140723
01d300b800cb00a601bc0131024e00d3010a007b0054035c037103db01850423047703e9008f
02000360006a00cf05d50614008f0723008f06660179046004600460047b0000007b02770460
01aa00e90614076203f8007b022100c5009c007f027b000000b40252054e054e04d10066009c
009c0066009c008f0066009c008f061000cd03fa0083009102fe01480446033f008f007b044c
009800a200000027006f0000006f0335006a006f007b058d058d058d058d00aa00aa002d058d
0396027b00f6007f02aa0133023d009c0266018b008f02f600cd006f034400370066001d05ee
008501b406140000077d007305d500001400b707060504030201002c2010b002254964b04051
5820c859212d2cb002254964b040515820c859212d2c20100720b00050b00d7920b8ffff5058
041b0559b0051cb0032508b0042523e120b00050b00d7920b8ffff5058041b0559b0051cb003
2508e12d2c4b505820b80117454459212d2cb002254560442d2c4b5358b00225b00225454459
21212d2c45442d2cb00225b0022549b00525b005254960b0206368208a108a233a8a10653a2d
000100000002570a366a08f65f0f3cf5001f080000000000cef5cb7d00000000cef5cb7dfb8a
fd0105be085500000008000000010000000000010000076dfe1d000004d1fb8aff1405be0001
0000000000000000000000000000000204d1006804d1004a000000000000004c000000b00001
00000002020c002b006b0006000200100099000800000557011100050004b902800115b2945d
05411c011500960003011500800004011400fe0003011300fe0003011200120003011100fe00
03011000fe0003010f009a0003010e00fe0003010db2eb47054125010d007d0003010c002500
03010b00320003010a00960003010900fe00030108000e0003010700fe000301060025000301
0500fe00030104000e0003010300250003010200fe000301014059fe03fefe03fd7d03fcfe03
fbfe03fa3203f9bb03f87d03f7f68c05f7fe03f7c004f6f55905f68c03f68004f5f42605f559
03f54004f42603f3f22f05f3fa03f22f03f1fe03f0fe03ef3203ee1403ed9603eceb4705ecfe
03ecb8ffd140ff04eb4703eae96405ea9603e96403e8fe03e7e61b05e7fe03e61b03e5fe03e4
6b03e3fe03e2bb03e1e01905e1fa03e01903df9603defe03ddfe03dcdb1505dcfe03db1503da
9603d9d81505d9fe03d88d0b05d81503d77d03d63a03d58d0b05d53a03d4fe03d3d20a05d3fe
03d20a03d1fe03d0fe03cf8a1105cf1c03ce1603cdfe03cc9603cb8b2505cbfe03cafe03c97d
03c8fe03c7fe03c6fe03c59a0d05c4fe03c3fe03c2fe03c1fe03c08d0b05c01403bf0c03bebd
bb05befe03bdbc5d05bdbb03bd8004bcbb2505bc5d03bc4004bb2503bafe03b99603b88f4105
b7fe03b68f4105b6fa03b59a0d05b4fe03b36403b26403b10e03b01203affe03aefe40fd03ad
fe03acfe03ab1203aafe03a9a80e05a93203a80e03a7a61105a72803a61103a5a42d05a57d03
a42d03a3fe03a2fe03a1fe03a09f1905a064039f9e10059f19039e10039d0a039cfe039b9a0d
059bfe039a0d0399982e0599fe03982e03978f41059796039695bb0596fe0395945d0595bb03
95800494902505945d0394400493fe0392fe039190250591bb039025038f8b25058f41038e8d
0b058e14038d0b038c8b25058c64038b8a11058b25038a110389fe0388fe0387fe0386851105
86fe0385110384fe0383fe038211420582530381fe038078037f7e7d057ffe037e7d037d1e03
7cfe037b0e037afe0377fe0376fe0375740c05750f0375b8010040da04740c0374c004731203
73400472fe0371fe0370fe036f6e53056f96036e6d28056e53036d28036cfe036b32036afe03
69320368fa0367bb0366fe0365fe0364fe0363621e0563fe0362001005621e0361fe0360fe03
5ffe035e5a0b055e0e035d64035cc8035b5a0b055b14035a0b0359fe0358140357fe0356fe03
551b190555320354fe0353fe0352fe03517d0350fe034f14034efe034d012d054dfe034cbb03
4b28034a4918054a3703494312054918034845180548fe03474312054764034645180546bb03
451803444312054437034342110543120343b8024040090442410f0542110342b80200400904
41400e05410f0341b801c0400904403f0c05400e0340b801804009043f0c09053f0c033fb801
404064043efe033d012d053dfa033cfe033b28033afe033911420539640338311a05384b0337
fe03362d140536fe03354b0334301a05344b0333301a0533fe033211420532fe03312d140531
1a03301a032f2d14052f18032e0916052ebb032d2c13052d14032db802804009042c1011052c
13032cb802404096042b2a25052bfe032a0916052a250329023a0529fe0328fe0327fe03260f
0325164205254503240f0323fe03220f0f0522fe0321202d05217d03202d031f4b031e114205
1efe031dfe031c1b19051cfe031b0010051b19031afe0319fe0318fe03171642051746031615
2d0516420315141005152d03141003130010051314031211420512fe0311012d05114203100f
0f0510110310b802004009040f0e0c050f0f030fb801c04009040e0d0a050e0c030eb8018040
09040d0c09050d0a030db80140b4040c09030cb801004037040bfe030a0916050afe03091603
08100307fe0306012d0506fe0305140303023a0503fa0302012d05023a0301001005012d0300
100301b80164858d012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b002b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b
2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b1d0000>
] def
/Check-Mark currentdict end definefont pop
%%EndResource
/check { <01> show } bind def
%%Page: 1 1
28.35 28.35 scale
/Ryumin-Light-UniJIS-UTF8-H findfont 0.35 scalefont setfont
6.6 17.95 moveto
($YEAR) show
7.80 17.95 moveto
($MONTH) show
6.00 17.10 moveto
($HOSPNUM) show
6.00 16.30 moveto
($HOSPNAME) show
/Check-Mark findfont 0.6 scalefont setfont
7.90 14.75 moveto
check
2.45 12.55 moveto
$JUUDO
2.45 11.93 moveto
$HITORI
showpage
EOF
$DBSTUB -dir $LDDIRECTORY -bd orcabt ORCBJOB -parameter JBE${12}${13},${14}
exit