// 書き方は メニューファイルの書き方.pdf を参照してください．
demographs
{
    dialog_title = 患者情報 ;
    column_width = 440;
    column_divide = 2;
    text_item
    {
        mnemonic = ID;
        label = 患者ID;
        characters = 0123456789-;
        ime = ascii;
        alaert = yes;
    }
    text_item
    {
        mnemonic = 漢字姓名;
        ime = kana;
        alaert = yes;
    }
    column_divide = 1;
    text_item
    {
        mnemonic = かな姓名;
        ime = kana;
    }
    column_divide = 2;
    radio_item
    {
        mnemonic = 性別;
        file = DMG-JSA選択.txt#性別;
        alaert = yes;
    }
    text_item
    {
        mnemonic = 生年月日;
        ime = ascii;
        alaert = yes;
    }
    separator = "physical status";
    column_divide = 3;
    text_item
    {
        mnemonic = 身長;
        label = 身長(cm);
        ime = ascii;
        characters = 0123456789.;
    }
    text_item
    {
        mnemonic = 体重;
        label = 体重(kg);
        ime = ascii;
        characters = 0123456789.;
    }
    column_divide = 3;
    radio_item
    {
        mnemonic = ABO型;
        file = DMG-JSA選択.txt#ABO型;
    }
    radio_item
    {
        mnemonic = Rh型;
        file = DMG-JSA選択.txt#Rh型;
    }
    radio_item
    {
        mnemonic = ASA;
        file = DMG-JSA選択.txt#ASA;
        lines = 2;
    }
    radio_item
    {
        mnemonic = NYHA;
        file = DMG-JSA選択.txt#NYHA;
        lines = 2;
    }
    separator = "感染症";
    column_divide = 6;
    radio_item
    {
        mnemonic = 感染MRSA ;
        label = "" ;
        choice = MRSA ;
    }
    radio_item
    {
        mnemonic = 感染HBs ;
        label = "" ;
        choice = HBs ;
    }
    radio_item
    {
        mnemonic = 感染HCV ;
        label = "" ;
        choice = HCV ;
    }
    radio_item
    {
        mnemonic = 感染Wa ;
        label = "" ;
        choice = Wa ;
    }
    radio_item
    {
        mnemonic = 感染未検 ;
        label = "" ;
        choice = 未 ;
    }
    
    column_divide = 3;
    separator = "診療科";
    tree_menu_item
    {
        mnemonic = 科名;
        label = 科;
        file = DMG-施設別.txt#科名;
        ime = kana;
    }
    tree_menu_item
    {
        mnemonic = 病棟;
        label = 棟;
        file = DMG-施設別.txt#病棟;
        ime = kana;
    }
    tree_menu_item
    {
        mnemonic = 手術室;
        label = 室;
        file = DMG-施設別.txt#手術室;
    }
    column_divide = 2;
    tree_menu_item
    {
        mnemonic = 術者1;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 麻酔1;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 術者2;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 麻酔2;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 術者3;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 麻酔3;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
    tree_menu_item
    {
        mnemonic = 術者4;
        file = DMG-人名.txt;
        ime = kana;
        editable_menu = yes;
    }
//    tree_menu_item
//    {
//        mnemonic = 麻指1;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 術者5;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 麻指2;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 術者6;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 麻指3;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 直介1;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 直介2;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 直介3;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 間接1;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 間接2;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
//    tree_menu_item
//    {
//        mnemonic = 間接3;
//        file = DMG-人名.txt;
//        ime = kana;
//        editable_menu = yes;
//    }
    separator = "ｺﾒﾝﾄ";
    column_divide = 1;
    text_item
    {
        mnemonic = 術前評価;
        label = 術前;
        lines = 5;
        ime = kana;
    }
    text_item
    {
        mnemonic = 術後評価;
        label = 術後;
        lines = 5;
        ime = kana;
    }
    column_width = 440;
    candidate_menu_item
    {
        mnemonic = 術前病名1;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    candidate_menu_item
    {
        mnemonic = 術前病名2;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    candidate_menu_item
    {
        mnemonic = 術前病名3;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 予定術側1;
        label = "予定術名1";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 予定術名1;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 予定術側2;
        label = "予定術名2";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 予定術名2;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 予定術側3;
        label = "予定術名3";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 予定術名3;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
    separator = "";
    candidate_menu_item
    {
        mnemonic = 術後病名1;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    candidate_menu_item
    {
        mnemonic = 術後病名2;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    candidate_menu_item
    {
        mnemonic = 術後病名3;
        file = DMG-病名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 実施術側1;
        label = "実施術名1";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 実施術名1;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 実施術側2;
        label = "実施術名2";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 実施術名2;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
    radio_item
    {
        mnemonic = 実施術側3;
        label = "実施術名3";
        choice = 左 右 両;
    }
    candidate_menu_item
    {
        mnemonic = 実施術名3;
        label = "";
        file = DMG-術名.txt;
        lines = 2;
        ime = kana;
    }
}

//「開く」ﾀﾞｲｱﾛｸﾞでリスト表示する項目です．
// ｢start_date｣ ｢stop_date｣ ｢start_time｣ ｢stop_time｣ ｢file_suffix｣ は予約語です，
// ID以下は，demographの項目名です．
// display = … は表示の順序（左から右へ）
// sort = … は整列の順序です．
// -start_dateは手術開始日の大きいものから小さいもの(降順)へ，
// 次の+file_suffixは手術開始日が同じものについて手術室番またはモニタ機番の
// 小さいものから大きいもの(昇順)へ，さらに+start_timeは同一手術日，同一手術室
// の症例について，開始時刻昇順に並べ替えるという意味です．

open_dialog
{
//    display = start_date start_time file_suffix
//              ID 漢字姓名 | かな姓名 性別 科名 実施術名1 | 予定術名1 ;
    display = start_date start_time file_suffix ID 漢字姓名 性別 科名 実施術名1 | 予定術名1 ;
    prompt = 日付 時刻 室 ID 姓名 性 科 術名 ;
    sort = -start_date +file_suffix +start_time ;
//    search = ID 漢字姓名 かな姓名 科名 実施術名1 ;
    search = ID 漢字姓名 科名 実施術名1 ;
}

calc
{
    ID文字列 = demograph ('ID') ;
    手術番号文字列 = demograph ('手術番号') ;
    漢字姓名文字列 = demograph ('漢字姓名') ;
    かな姓名文字列 = demograph ('かな姓名') ;
    姓名文字列 = 漢字姓名文字列 | かな姓名文字列 ;
    性別文字列 = demograph ('性別') ;
    生年月日文字列 = demograph ('生年月日') ;
    年令値 = age ('生年月日') ;

// 患者属性ファイルの生年月日から計算した年齢
// ( １ヶ月未満は日数，半年未満は週数，４歳未満は？才？月，それ以上は？才 )

    年令文字列 = 年令値 < 0.07671 ?   年令値 * 365 + 0.5 # 1 $ '#日' :
                 年令値 < 0.5 ?       年令値 * 52.14 + 0.5 # 1 $ '#週' :
                 年令値 < 4 ?         年令値 # 1 $ '#才' @ 年令値 * 12 % 12 # 1 $ '#月' :
                 年令値 # 1 $ '#才' ;

    身長値 = demograph ('身長');
    身長文字列 = 身長値 $ '  #' ;
    体重値 = demograph ('体重');
    体重文字列 = 体重値 > 10 ? (体重値 $ ' #') :
                 体重値 > 3 ? (体重値 $ '#.#') : (体重値 $ '#.##') ;
    BodyMassIndex = 体重値 / ((身長値 * 0.01) ^ 2) ;

    ABO型文字列 = demograph ('ABO型') ;
    Rh型文字列 = demograph ('Rh型') ;
    血液型文字列 = ABO型文字列 @ Rh型文字列 ;
    ASA文字列 = demograph ('ASA') ;
    NYHA文字列 = demograph ('NYHA');
    感染MRSA文字列 = demograph ('感染MRSA');
    感染HBs文字列 = demograph ('感染HBs') ;
    感染HCV文字列 = demograph ('感染HCV') ;
    感染Wa文字列 = demograph ('感染Wa') ;
    感染未検文字列 = demograph ('感染未検') ;

    科名文字列 = demograph ('科名');
    病棟名文字列 = demograph ('病棟');
    手術室文字列 = demograph ('手術室');

    術前病名文字列1 = demograph ('術前病名1');
    術前病名文字列2 = demograph ('術前病名2');
    術前病名文字列3 = demograph ('術前病名3');
    予定術名文字列1 = demograph ('予定術側1') @ demograph ('予定術名1');
    予定術名文字列2 = demograph ('予定術側2') @ demograph ('予定術名2');
    予定術名文字列3 = demograph ('予定術側3') @ demograph ('予定術名3');
    術前評価文字列 = demograph ('術前評価');

    術後病名文字列1 = demograph ('術後病名1');
    術後病名文字列2 = demograph ('術後病名2');
    術後病名文字列3 = demograph ('術後病名3');
    実施術名文字列1 = demograph ('実施術側1') @ demograph ('実施術名1');
    実施術名文字列2 = demograph ('実施術側2') @ demograph ('実施術名2');
    実施術名文字列3 = demograph ('実施術側3') @ demograph ('実施術名3');
    術後評価文字列 = demograph ('術後評価');

    麻酔者文字列1 = demograph ('麻酔1');
    麻酔者文字列2 = demograph ('麻酔2');
    麻酔者文字列3 = demograph ('麻酔3');
    麻酔者文字列4 = demograph ('麻指1');
    麻酔者文字列5 = demograph ('麻指2');
    麻酔者文字列6 = demograph ('麻指3');

    術者文字列1 = demograph ('術者1');
    術者文字列2 = demograph ('術者2');
    術者文字列3 = demograph ('術者3');
    術者文字列4 = demograph ('術者4');
    術者文字列5 = demograph ('術者4');
    術者文字列6 = demograph ('術者4');

    直介者文字列1 = demograph ('直介1');
    直介者文字列2 = demograph ('直介2');
    直介者文字列3 = demograph ('直介3');
    間接者文字列1 = demograph ('間接1');
    間接者文字列2 = demograph ('間接2');
    間接者文字列3 = demograph ('間接3');

    看護師文字列1 = demograph ('看護師1');
    看護師文字列2 = demograph ('看護師2');
    看護師文字列3 = demograph ('看護師3');
    臨工士文字列1 = demograph ('臨工士1');
    臨工士文字列2 = demograph ('臨工士2');
}

inout_body_weight
{
    name = 体重 ;
    write_back = yes ;
}

// 暗号化項目指定の挿入場所
//beginCryptDefinition (do not touch this bookmark line)
//endDefinition (do not touch this bookmark line)
