SMMQI04001.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. function fInit(){
  2. if(isPopup()){
  3. var sPrcpdd = opener.model.getValue("/root/send/popupinfo/prcpdd");
  4. model.setValue("/root/send/userinfo/fromdd", sPrcpdd);
  5. model.setValue("/root/send/userinfo/todd", sPrcpdd);
  6. model.setValue("/root/send/userinfo/pid", opener.model.getValue("/root/send/popupinfo/pid"));
  7. model.setValue("/root/send/userinfo/cretno", opener.model.getValue("/root/send/popupinfo/cretno"));
  8. fGetAntiCancerFlowSheet();
  9. }
  10. }
  11. function fGetAntiCancerFlowSheet(){
  12. if(isNull(model.getValue("/root/send/userinfo/pid"))){
  13. return;
  14. }else{
  15. fSetFlowSheet();
  16. }
  17. }
  18. function fSetFlowSheet(){
  19. submit("TRMQI04001");
  20. fSetDataGrid();
  21. model.setValue("/root/main/title", model.getValue("/root/temp/flowsheet/patinfo/hngnm") +" ("+ model.getValue("/root/temp/flowsheet/patinfo/pid") + ")");
  22. model.refresh();
  23. grid_flowsheet.rowhidden(eval(grid_flowsheet.rows - 1)) = true;
  24. }
  25. function fSetDataGrid(){
  26. grid_flowsheet.caption = "구분^^^^항목^" + model.getValue("/root/temp/flowsheet/tableinfo/caption");
  27. copyNodesetType("/root/main/flowsheet/datainfo","/root/temp/flowsheet/datainfo", "replace");
  28. for(var i=1; i<=grid_flowsheet.cols; i++){
  29. grid_flowsheet.mergeCells = "bycol";
  30. if(i > 1){
  31. if(i == 5){
  32. grid_flowsheet.colWidth(i) = 250;
  33. }else{
  34. grid_flowsheet.colWidth(i) = 150;
  35. }
  36. grid_flowsheet.mergeCol(i) = false;
  37. grid_flowsheet.colAttribute ( i, "style" ) = "text-align:left;";
  38. }else{
  39. grid_flowsheet.mergeCol(i) = true;
  40. }
  41. }
  42. grid_flowsheet.rebuild();
  43. grid_flowsheet.refresh();
  44. fSetDataGridRowStyle();
  45. }
  46. function fSetDataGridRowStyle(){
  47. var rows = eval(grid_flowsheet.rows -1);
  48. var checkedAC = false;
  49. for(var i=2; i < rows; i++){
  50. var row = eval(i-1);
  51. var nextrow = i;
  52. var acflag = model.getValue("/root/main/flowsheet/datainfo["+row+"]/subtitle");
  53. var nextacflag = model.getValue("/root/main/flowsheet/datainfo["+nextrow+"]/subtitle");
  54. if( (acflag != nextacflag)){
  55. grid_flowsheet.rowstyle(row, "data", "border-bottom-width") = "2px";
  56. grid_flowsheet.rowstyle(row, "data", "border-bottom-color") = "#000000";
  57. }
  58. }
  59. grid_flowsheet.rebuild();
  60. grid_flowsheet.refresh();
  61. }
  62. function fSetAntiCancerFlowSheetinfo(){
  63. model.setValue("/root/send/prcpinfo" ,grid_flowsheet.getUpdateData());
  64. submit("TXMQI04001");
  65. fGetAntiCancerFlowSheet();
  66. }
  67. function fSetResetAntiCancerFlowSheetinfo(){
  68. copyNodesetType("/root/main/flowsheet/datainfo","/root/temp/flowsheet/datainfo", "replace");
  69. grid_flowsheet.rebuild();
  70. grid_flowsheet.refresh();
  71. grid_flowsheet.rowhidden(eval(grid_flowsheet.rows - 1)) = true;
  72. }
  73. function fActionClose(){
  74. if(isPopup()){
  75. if(opener.window.javascript.getScreenID() == "SMMQI04000"){
  76. opener.window.javascript.fGetAntiCancerFlowSheet();
  77. }
  78. }
  79. }
  80. function fGetOpenAutoTextPopup(acflag, itemcd, row){
  81. if((acflag == "AC05" && itemcd == "PURPOSE") || (acflag == "AC02" && itemcd == "SideEffect") || (acflag == "AC06" && itemcd == "React") ){
  82. setParameter("SPMQI04001_itemval", model.getValue("/root/main/flowsheet/datainfo[subtitle = '"+acflag+"' and prcpcd = '"+itemcd+"' ]/date1"));
  83. setParameter("SPMQI04001_itemcd", itemcd);
  84. setParameter("SPMQI04001_acflag", acflag);
  85. modal("SPMQI04001");
  86. // 변경된 내용이 원본과 다를경우 해당 Datagrid row의 상태를 Update로 변경
  87. if(model.getValue("/root/temp/flowsheet/datainfo[subtitle = '"+acflag+"' and prcpcd = '"+itemcd+"' ]/date1") != model.getValue("/root/main/flowsheet/datainfo[subtitle = '"+acflag+"' and prcpcd = '"+itemcd+"' ]/date1")){
  88. grid_flowsheet.addStatus(row, "update");
  89. }
  90. }
  91. }