123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[ Map = function(){
- this.map = new Object();
- put = function(key, value){
- this.map[key] = value;
- },
- get = function(key){
- return this.map[key];
- },
- containsKey = function(key){
- return key in this.map;
- },
- containsValue = function(value){
- for(var prop in this.map){
- if(this.map[prop] == value) return true;
- }
- return false;
- },
- isEmpty = function(key){
- return (this.size() == 0);
- },
- clear = function(){
- for(var prop in this.map){
- delete this.map[prop];
- }
- },
- remove = function(key){
- delete this.map[key];
- },
- keys = function(){
- var keys = new Array();
- for(var prop in this.map){
- keys.push(prop);
- }
- return keys;
- },
- values = function(){
- var values = new Array();
- for(var prop in this.map){
- values.push(this.map[prop]);
- }
- return values;
- },
- size = function(){
- var count = 0;
- for (var prop in this.map) {
- count++;
- }
- return count;
- }
- };
- var gGroupMap = new Map();
- function fInit(){ //ready
-
- if(frmf_isPopup()){
- var node = sysf_getGlobalVariable("paminfo");
- ds_main_paminfo.clear();
- dsf_setCSVToDs("ds_main_paminfo", node);
-
- ds_send.setColumn(0, "instcd", ds_main_paminfo.getColumn(0, "instcd"));
- ds_send.setColumn(0, "pid", ds_main_paminfo.getColumn(0, "pid"));
- ds_send.setColumn(0, "orddeptcd", ds_main_paminfo.getColumn(0, "orddeptcd"));
-
- var sDegnitemlevlcd = opener.frmf_getParameter("SPMMR09001_degnitemlevlcd");
- var sDegnitemcd = opener.frmf_getParameter("SPMMR09001_degnitemcd");
-
- ds_init_opener.setColumn(0, "degnitemlevlcd", sDegnitemlevlcd);
- ds_init_opener.setColumn(0, "degnitemcd", sDegnitemcd);
- var idx = opener.ds_data_recitem.findRowExpr("degnitemlevlcd == '"+ sDegnitemlevlcd +"' && degnitemcd == '"+ sDegnitemcd +"'");
- ds_init_opener.setColumn(0, "content" , opener.ds_data_recitem.getColumn(idx, "reccnts"));
-
- fGetOrdddinfo();
- grp_sea.btn_search.click();
- }
- }
- function fGetOrdddinfo(){ //일자조회
- var oParam = {};
- oParam.id = "TRMMR09002";
- oParam.service = "medirecapp.ComnMediRec";
- oParam.method = "reqGetTestResultinfo_Orddd";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_ordddlist_ordddinfo=dateinfo";
- oParam.async = false;
- tranf_submit(oParam);
- ds_send.setColumn(0, "orddd", ds_main_ordddlist_ordddinfo.getColumn(0, "repdd"));
- }
- function fMakeForm(){ //복사버튼 클릭
-
- if(frmf_isPopup()){
- var sDegnitemlevlcd = ds_init_opener.getColumn(0, "degnitemlevlcd");
- var sDegnitemcd = ds_init_opener.getColumn(0, "degnitemcd");
- var sContent = utlf_transNullToEmpty(ds_init_opener.getColumn(0, "content")) + "\n";
-
- if(ds_main_testlist_testinfo.rowcount > 0){
-
- var sOrddptcd = ds_main_paminfo.getColumn(0, "orddeptcd"); //해당환자 진료과로 결과값 가지고옴
-
- switch(sOrddptcd){
- case "2010700000" : sContent += fMakeForm_INM(); //신장내과
- break;
- default :
- sContent += fMakeForm_Default();
- break;
- }
-
- var idx = opener.ds_data_recitem.findRowExpr("degnitemlevlcd == '"+ sDegnitemlevlcd +"' && degnitemcd == '"+ sDegnitemcd +"'");
- var sItemCd = opener.ds_data_recitem.getColumn(idx, "fstlevlitemcd");
- opener.ds_data_recitem.setColumn(idx, "reccnts", sContent);
- var objTextArea = opener.ComnFormObj.components["tar_" + sItemCd];
- objTextArea.value = sContent;
- }
- }
- close();
- }
- function fGetTestinfo(){ //조회버튼 클릭
- var oParam = {};
- oParam.id = "TRMMR09001";
- oParam.service = "medirecapp.ComnMediRec";
- oParam.method = "reqGetTestResultinfo";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_testlist_testinfo=testinfo";
- oParam.async = false;
- oParam.callback = "cf_TRMMR09001";
-
- tranf_submit(oParam);
-
- ds_temp.setColumn(0, "itemflag", "true");
- frmf_inputEnterKey("group2.checkbox1", "onchanged", new CheckBoxChangeEventInfo );
-
-
- gGroupMap.clear();
-
- for(var i=0; i < group2.grd_testlist.getCellCount("Body"); i++){
- if(i == 1){
- group2.grd_testlist.setCellProperty("body", i, "suppress", "1");
- }else{
- group2.grd_testlist.setCellProperty("body", i, "suppress", "0");
- }
- }
-
- }
- function cf_TRMMR09001(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
-
- ds_main_testlist_testinfo.addColumn("itemflag", "string");
- //dsf_setDefaultVal(ds_main_testlist_testinfo, "itemflag:1");
- }
- function fSetGridFlag(obj:CheckBox, e:CheckBoxChangeEventInfo){ //체크값이 바뀔 때
- var nTotalCount = ds_main_testlist_testinfo.rowcount;
- var sFlag = 0;
-
- if(nTotalCount > 0){
-
- //if(e.postvalue == "true"){
- if( obj.value == "true" ){
- sFlag = 1;
- }
-
- for(var i = 0; i < nTotalCount; i++) {
- ds_main_testlist_testinfo.setColumn(i, "itemflag", sFlag);
- }
- }
- }
- function fMakeGroupString(pItemSort, pItemGroup){
- var nTotalCount = ds_main_testlist_testinfo.rowcount;
-
- var sItemSort = "";
- var sItemnm = "";
- var sItemval = "";
- var sItemgroup = "";
- var nFindRow = ds_main_testlist_testinfo.findRow("itemsort", pItemSort);
- var sContent_name = ds_main_testlist_testinfo.getColumn(nFindRow, "itemnm")+"/";
- var sContent_value = ds_main_testlist_testinfo.getColumn(nFindRow, "itemval")+"/";
-
- for(var i=0; i< nTotalCount; i++){
- sItemSort = ds_main_testlist_testinfo.getColumn(i, "itemsort");
- nFindRow = ds_main_testlist_testinfo.findRow("itemsort", sItemSort);
- sItemnm = ds_main_testlist_testinfo.getColumn(nFindRow, "itemnm");
- sItemval = ds_main_testlist_testinfo.getColumn(nFindRow, "itemval");
- sItemgroup = ds_main_testlist_testinfo.getColumn(nFindRow, "itemgroup");
-
-
- if(fCopyCheckedItem(sItemSort, sItemval)){
- if(!utlf_isNull(pItemGroup)){
- if(pItemSort != sItemSort){
- if(pItemGroup == sItemgroup ){
- sContent_name += sItemnm + "/";
- sContent_value += sItemval + "/";
-
- gGroupMap.put(pItemGroup, pItemGroup);
- }
- }
- }
- }
- }
- return sContent_name.substring(0,eval(sContent_name.length -1)) + " : " + sContent_value.substring(0,eval(sContent_value.length -1));
- }
- function fCopyCheckedItem(pItemSort, pItemval){
- return ds_main_testlist_testinfo.lookup("itemsort",pItemSort,"itemflag") == true && !utlf_isNull(pItemval);
-
- }
- function fMakeForm_Default(){
- var sContent = "";
- var sItemSort = "";
- var sItemnm = "";
- var sItemval = "";
- var sItemGroup = "";
- var sItemExeDd = "";
- var sPreExeDd = "";
- var nTotalCount = ds_main_testlist_testinfo.rowcount;
- var nFindRow = "";
-
- if(nTotalCount > 0){
- for(var i=0; i < nTotalCount; i++){
- sItemSort = ds_main_testlist_testinfo.getColumn(i, "itemsort");
- nFindRow = ds_main_testlist_testinfo.findRow("itemsort", sItemSort);
- sItemExeDd = ds_main_testlist_testinfo.getColumn(nFindRow, "itemexedd");
- sItemnm = ds_main_testlist_testinfo.getColumn(nFindRow, "itemnm");
- sItemval = ds_main_testlist_testinfo.getColumn(nFindRow, "itemval");
- sItemGroup = ds_main_testlist_testinfo.getColumn(nFindRow, "itemgroup");
-
- if(fCopyCheckedItem(sItemSort, sItemval)){
- if(sPreExeDd != sItemExeDd) {
- sPreExeDd = sItemExeDd;
- sContent += "\n검사접수일자 : " + sItemExeDd.substring(0,4) + ". " + sItemExeDd.substring(4,6) + ". " + sItemExeDd.substring(6,8)+ "\n\n";
- }
-
- if(utlf_isNull(sItemGroup)){
- sContent += sItemnm +" : "+ sItemval + "\n";
- }else{
- if(utlf_isNull(gGroupMap.get(sItemGroup))){
- trace("fMakeGroupString"+i+":"+fMakeGroupString);
- sContent += fMakeGroupString(sItemSort, sItemGroup) + "\n";
- }
- }
- }
- }
- }
-
- return sContent;
- }
- function fMakeForm_INM(){ //신장내과
- /* *******************************************************
- * 노드셋에서 1~13 번째 까지는 폼형식이 정해져 있기때문에
- * 쿼리에서도 유의 해야 함 (ORDER BY 에 유의 ) 기준자료 : 5654
- *
- * 아래 순서로 데이터가 존재해야 한다
- * itemsort itemnm
- * 1 Hemoglobin
- * 2 WBC
- * 3 LC1026
- * 4 LC1028
- * 5 LCR191
- * 6 LH1007
- * 7 Hematocrit
- * 8 Platelet
- * 9 LC1027
- * 10 LCR190
- * 11 LCR192
- * 12 LH1026
- * 13 LH102601
- *
- * Hemoglobin WBC LC1026 LC1028 LCR191 LH1007
- * --------------< --------+--------+---------+---------
- * Hematocrit Platelet LC1027 LCR190 LCR192 LH1026 (LH102601)
- *
- * *******************************************************/
-
- var nTotalCount = ds_main_testlist_testinfo.rowcount;
- var sTop = "";
- var sBottom = "";
- var sLine = "------<\t\t ";
-
- var sTestVal = "";
-
- var sTestDate = "검사접수일자 : ";
- var sItemSort = "";
- var sItemnm = "";
- var sItemval = "";
- var sItemGroup = "";
- var sContent = "";
- var nFindRow = "";
-
- var bNullflag = false;
-
- if(nTotalCount > 0){
- // itemsort를 참조하여 form을 생성한다.
-
- var ordddsave = ds_send.getColumn(0, "orddd");
- if(!utlf_isNull(ordddsave)){
- sTestDate += ordddsave.substring(0,4) + ". " + ordddsave.substring(4,6) + ". " + ordddsave.substring(6,8);
- }
-
- for(var i=0; i < nTotalCount; i++){
-
- sItemSort = ds_main_testlist_testinfo.getColumn(i,"itemsort");
- nFindRow = ds_main_testlist_testinfo.findRow("itemsort", sItemSort);
- sItemnm = ds_main_testlist_testinfo.getColumn(nFindRow,"itemnm");
- sItemval = ds_main_testlist_testinfo.getColumn(nFindRow,"itemval");
- sItemGroup = ds_main_testlist_testinfo.getColumn(nFindRow,"itemgroup");
- if(utlf_isNull(sItemval)){
- sItemval = "";
- }
- if(sItemSort >= 1 && sItemSort <= 13){
- if(sItemSort <= 6){ // top itemsort : 1~ 6
- sTop += sItemval;
-
- if(sItemSort != 6){
-
- if(sItemval.length < 5){
- sTop += "\t\t";
- }else{
- sTop += "\t";
- }
- }
-
- }else{ // bottom itemsort : 7 ~ 12
-
-
- if(sItemSort != 13){
- sBottom += sItemval;
-
- if(sItemval.length < 5){
- sBottom += "\t\t";
- }else{
- sBottom += "\t";
- }
- }else{
-
- if(!utlf_isNull(sItemval)){
- sBottom += "("+sItemval+")";
- }else{
- sBottom += "(\t)";
- }
- }
-
- }
-
- bNullflag = true;
- }else{
-
- if(fCopyCheckedItem(sItemSort, sItemval)){
-
- if(utlf_isNull(sItemGroup)){
- sTestVal += sItemRnm +" : "+ sItemval + "\n";
- }else{
- trace("sItemGroup"+i+":"+sItemGroup);
- if(utlf_isNull(gGroupMap.get(sItemGroup))){
- trace("fMakeGroupString"+i+":"+fMakeGroupString(sItemSort, sItemGroup));
- sTestVal += fMakeGroupString(sItemSort, sItemGroup) + "\n";
- }
- }
-
- }
-
- }
-
- }
-
- // Line
- for(var i=1; i<=4; i++){
-
- if(i != 4){
- sLine += "--------+-";
- }else{
- sLine += "----------";
- }
- }
-
- // ItemSort 1~12 데이터 존재 여부에 따라 출력 형식이 달라짐
- if(bNullflag){
- sContent = sTestDate + "\n\n" + sTop + "\n" + sLine + "\n" + sBottom + "\n\n" + sTestVal;
- }else{
- sContent = sTestDate + "\n\n" + sTestVal;
- }
- }
-
- return sContent;
-
- }
- ]]></Script>
|