電子カルテの患者検索画面がやっとできた。
プログラム名: kanja_kensaku.html (onClick は全角英数) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> @import "http://o.aolcdn.com/dojo/1.0.0/dijit/themes/tundra/tundra.css"; @import "http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.css" </style> <style type="text/css"> /* NOTE: for a full screen layout, must set body size equal to the viewport. */ html, body { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js" djConfig="parseOnLoad: true"></script> <script type="text/javascript"> dojo.require("dojo.parser"); dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojo.data.ItemFileWriteStore"); dojo.require("dojo.date.locale"); dojo.require("dijit.Dialog"); </script> <script type="text/javascript"> // variables and functions patient = {id: "", date: "", name: "", date_of_birth: "", sex: "", address: ""}; function found_patient(item) { patient.id = patientStore.getValue(item, 'id'); patient.ruby = patientStore.getValue(item, 'ruby'); patient.name = patientStore.getValue(item, 'name'); patient.date_of_birth = patientStore.getValue(item, 'date_of_birth'); patient.sex = patientStore.getValue(item, 'sex'); patient.address = patientStore.getValue(item, 'address'); dojo.byId('id').value = patient.id; dojo.byId('ruby').value = patient.ruby; dojo.byId('name').value = patient.name; dojo.byId('date_of_birth').value = patient.date_of_birth; dojo.byId('sex').value = patient.sex; dojo.byId('address').value = patient.address; } function find_patient(id) { patientStore.fetchItemByIdentity({identity: id, onItem: found_patient}); } function clearOption(select) { var idx = select.length; for (var i = 0; i < idx ; i++) { select.removeChild(select.lastChild); } } function addOption(select, label, id) { var idx = select.length; select.options[idx] = new Option(label, id); } function mkPatientSelect(items, request) { clearOption(dojo.byId('patient_select')); for (var i = 0; i < items.length; i++) { item = items[i]; label = patientStore.getValue(item, 'id') + ' ' + patientStore.getValue(item, 'ruby') + ' ' + patientStore.getValue(item, 'name') + ' ' + patientStore.getValue(item, 'date_of_birth') + ' ' + patientStore.getValue(item, 'sex') + ' ' + patientStore.getValue(item, 'address'); id = patientStore.getValue(item, 'id'); addOption(dojo.byId('patient_select'), label, id); } } function findPatientsByName() { clearOption(dojo.byId('patient_select')); patient_ruby = dojo.byId('ruby').value; patientStore.fetch({query: {ruby: patient_ruby}, onComplete: mkPatientSelect}); } function _getNumberOfItems(id, query) { dojo.byId('dlg_id').value = id + 1; dijit.byId('dialog1').show(); } function getNumberOfItems(store) { store.fetch({onBegin: _getNumberOfItems}); } function newItem(id) { getNumberOfItems(patientStore); } function updateData() { var onComplete = function() { find_patient(dojo.byId('dlg_id').value); } var item = { id: dojo.byId('dlg_id').value, ruby: dojo.byId('dlg_ruby').value, name: dojo.byId('dlg_name').value, date_of_birth: dojo.byId('dlg_date_of_birth').value, sex: dojo.byId('dlg_sex').value, address: dojo.byId('dlg_address').value }; patientStore.newItem(item); patientStore.save({onComplete: onComplete}); } function updateItem() { dojo.byId('dlg2_id').value = dojo.byId('id').value; dojo.byId('dlg2_ruby').value = dojo.byId('ruby').value; dojo.byId('dlg2_name').value = dojo.byId('name').value; dojo.byId('dlg2_date_of_birth').value = dojo.byId('date_of_birth').value; dojo.byId('dlg2_sex').value = dojo.byId('sex').value; dojo.byId('dlg2_address').value = dojo.byId('address').value; dijit.byId('dialog2').show(); } function updateDataS() { var onComplete = function() { find_patient(dojo.byId('dlg2_id').value); } var onCompleteFetch = function(item) { patientStore.setValue(item, "ruby", dojo.byId('dlg2_ruby').value); patientStore.setValue(item, "name", dojo.byId('dlg2_name').value); patientStore.setValue(item, "date_of_birth", dojo.byId('dlg2_date_of_birth').value); patientStore.setValue(item, "sex", dojo.byId('dlg2_sex').value); patientStore.setValue(item, "address", dojo.byId('dlg2_address').value); patientStore.save({onComplete: onComplete}); } patientStore.fetchItemByIdentity({identity: dojo.byId('dlg2_id').value, onItem: onCompleteFetch}); } </script> </head> <body class="tundra"> <div dojoType="dojo.data.ItemFileWriteStore" url="patients.json" jsId="patientStore"></div> <div dojoType="dijit.layout.TabContainer" layoutAlign="client" id="mainTabContainer" style="width: 100%; height: 100%"> <div dojoType="dijit.layout.ContentPane" title="KANJA KENSAKU"> <h2 align="center">KANJA KENSAKU</h2> <table align="center"> <tr><td>ID: </td><td><input type="text" id="id"></td> <td><button onClick="find_patient(dojo.byId('id').value)" style="font-size: 10pt">ID KENSAKU</button></td> <td><button onClick="newItem()" style="font-size: 10pt">SINKI</button></td> <td><button onClick="updateItem()" style="font-size: 10pt">HENKOU</button></td> </tr> <tr><td>FURIGANA</td><td><input type="text" id="ruby"></td> <td><button onClick="findPatientsByName()" style="font-size: 10pt">HURIGANA KENSAKU</button></td> </tr> <tr><td>SIMEI</td><td><input type="text" id="name"></td></tr> <tr><td>SEINENGAPPI</td><td><input type="text" id="date_of_birth"></td></tr> <tr><td>SEIBETU</td><td><input type="text" id="sex"></td></tr> <tr><td>JUSHO</td><td><input type="text" id="address"></td></tr> <tr><td colspan="5"><select size="16" id="patient_select" onChange="find_patient(this.options[this.selectedIndex].value)" style="width: 100%;"></select></td></tr> </table> </div> </div> <div dojoType="dijit.Dialog" id="dialog1" title="Sinki Kanja" execute="updateData(arguments[0]);"> <table> <tr><td>ID: </td><td><input type="text" id="dlg_id" disabled></td> </tr> <tr><td>FURIGANA</td><td><input type="text" id="dlg_ruby"></td> </tr> <tr><td>SIMEI</td><td><input type="text" id="dlg_name"></td></tr> <tr><td>SEINENGAPPI</td><td><input type="text" id="dlg_date_of_birth"></td></tr> <tr><td>SEIBETU</td><td><input type="text" id="dlg_sex"></td></tr> <tr><td>JUSHO</td><td><input type="text" id="dlg_address"></td></tr> <tr><td colspan="2" align="center"><button dojoType=dijit.form.Button type="submit">OK</button></td></tr> </table> </div> <div dojoType="dijit.Dialog" id="dialog2" title="Syusei" execute="updateDataS(arguments[0]);"> <table> <tr><td>ID: </td><td><input type="text" id="dlg2_id" disabled></td> </tr> <tr><td>FURIGANA</td><td><input type="text" id="dlg2_ruby"></td> </tr> <tr><td>SIMEI</td><td><input type="text" id="dlg2_name"></td></tr> <tr><td>SEINENGAPPI</td><td><input type="text" id="dlg2_date_of_birth"></td></tr> <tr><td>SEIBETU</td><td><input type="text" id="dlg2_sex"></td></tr> <tr><td>JUSHO</td><td><input type="text" id="dlg2_address"></td></tr> <tr><td colspan="2" align="center"><button dojoType=dijit.form.Button type="submit">OK</button></td></tr> </table> </div> </body> </html>
by tnomura9
| 2007-12-22 18:41
| 電子カルテ
|
Comments(0)
|
カテゴリ
新型コロナウイルス 主インデックス Haskell 記事リスト 圏論記事リスト 考えるということのリスト 考えるということ ラッセルのパラドックス Haskell Prelude Ocaml ボーカロイド 圏論 jQuery デモ HTML Python ツールボックス XAMPP Ruby ubuntu WordPress 脳の話 話のネタ リンク 幸福論 キリスト教 心の話 メモ 電子カルテ Dojo JavaScript C# NetWalker ed と sed HTML Raspberry Pi C 言語 命題論理 以前の記事
最新のトラックバック
最新のコメント
ファン
記事ランキング
ブログジャンル
画像一覧
|
ファン申請 |
||