123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- <?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(){ //화면 열 때
-
- if(frmf_isPopup()){
- var node = sysf_getGlobalVariable("paminfo");
- ds_main_paminfo.clearData();
- dsf_setCSVToDs("ds_main_paminfo", node);
- if(ds_send.rowcount == 0)
- {
- ds_send.addrow();
- }
-
- 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");
-
- if(ds_init_opener.rowcount == 0)
- {
- ds_init_opener.addrow();
- }
- ds_init_opener.setColumn(0, "degnitemlevlcd", sDegnitemlevlcd);
- ds_init_opener.setColumn(0, "degnitemcd", sDegnitemcd);
- var idx = opener.ds_main_recinfo_recitem.findRowExpr("degnitemlevlcd == '"+ sDegnitemlevlcd +"' && degnitemcd == '"+ sDegnitemcd +"'");
- ds_init_opener.setColumn(0, "content" , opener.ds_main_recinfo_recitem.getColumn(idx, "reccnts"));
-
- fGetOrdddinfo();
- frmf_inputEnterKey("grp_sea.btn_search", "onclick", new ClickEventInfo);
- }
- }
- 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;
- oParam.callback = "cf_TRMMR09002";
- tranf_submit(oParam);
- ds_send.setColumn(0, "orddd", ds_main_ordddlist_ordddinfo.getColumn(0, "repdd"));
- }
- function cf_TRMMR09002(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
-
- }
- function fGetTestinfo(){ //조회버튼 클릭
- group2.checkbox1.value = "";
- var oParam = {};
- oParam.id = "TRMMR09001";
- oParam.service = "medirecapp.ComnMediRec";
- oParam.method = "reqGetTestResultinfo";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_grd_testlist=testinfo";
- oParam.async = false;
- oParam.callback = "cf_TRMMR09001";
- tranf_submit(oParam);
- group2.checkbox1.value = "true";
- gGroupMap.clear();
- }
- function cf_TRMMR09001(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
-
- }
- function fSetGridFlag(){ //체크값이 바뀔 때
- var nTotalCount = ds_grd_testlist.rowcount;
- var sFlag = "false";
-
- if(nTotalCount > 0){
- if(group2.checkbox1.value == "true"){
- sFlag = "true";
- }
-
- for(var i = 0; i < nTotalCount; i++) {
- ds_grd_testlist.addColumn("itemflag","string",256);
- ds_grd_testlist.setColumn(i, "itemflag", sFlag);
- }
- }
- }
- function fMakeForm(){ //복사버튼 클릭
-
- if(frmf_isPopup()){
- var sDegnitemlevlcd = ds_init_opener.getColumn(0, "degnitemlevlcd");
- var sDegnitemcd = ds_init_opener.getColumn(0, "degnitemcd");
- var sContent = ds_init_opener.getColumn(0, "content") + "\n";
- if(ds_grd_testlist.rowcount > 0){
-
- var sOrddptcd = ds_main_paminfo.getColumn(0, "orddeptcd"); //해당환자 진료과로 결과값 가지고옴
- if(sOrddptcd == "2010700000"){
- sContent += fMakeForm_INM(); //신장내과
- }else{
- sContent += fMakeForm_Default();
- }
- var idx = opener.ds_main_recinfo_recitem.findRowExpr("degnitemlevlcd == '"+ sDegnitemlevlcd +"' && degnitemcd == '"+ sDegnitemcd +"'");
- opener.ds_main_recinfo_recitem.setColumn(idx, "reccnts", sContent);
- }
-
- }
- close();
- }
- function fMakeGroupString(pItemSort, pItemGroup){
- var nTotalCount = ds_grd_testlist.rowcount;
-
- var sItemSort = "";
- var sItemnm = "";
- var sItemval = "";
- var sItemgroup = "";
- var sContent_name = ds_grd_testlist.getColumn(pItemSort, "itemnm")+"/";
- var sContent_value = ds_grd_testlist.getColumn(pItemSort, "itemval")+"/";
-
- for(var i=0; i< nTotalCount; i++){
-
- sItemSort = parseInt(ds_grd_testlist.getColumn(i, "itemsort"));
- sItemnm = ds_grd_testlist.getColumn(sItemSort, "itemnm");
- sItemval = ds_grd_testlist.getColumn(sItemSort, "itemval");
- sItemgroup = ds_grd_testlist.getColumn(sItemSort, "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_grd_testlist.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_grd_testlist.rowcount;
-
- if(nTotalCount > 0){
- for(var i=0; i < nTotalCount; i++){
- sItemSort = parseInt(ds_grd_testlist.getColumn(i, "itemsort"));
- sItemExeDd = ds_grd_testlist.getColumn(sItemSort, "itemexedd");
- sItemnm = ds_grd_testlist.getColumn(sItemSort, "itemnm");
- sItemval = ds_grd_testlist.getColumn(sItemSort, "itemval");
- sItemGroup = ds_grd_testlist.getColumn(sItemSort, "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))){
- 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_grd_testlist.rowcount;
- var sTop = "";
- var sBottom = "";
- var sLine = "------<\t\t ";
-
- var sTestVal = "";
-
- var sTestDate = "검사접수일자 : ";
- var sItemSort = "";
- var sItemnm = "";
- var sItemval = "";
- var sItemGroup = "";
- var sContent = "";
-
- var bNullflag = false;
-
- if(nTotalCount > 0){
- // itemsort를 참조하여 form을 생성한다.
- var ordddsave = ds_send.getColumn(0, "orddd");
- if(!utlf_isNull(ordddsave)){ //추가(2015.01.22)
- sTestDate += ordddsave.substring(0,4) + ". " + ordddsave.substring(4,6) + ". " + ordddsave.substring(6,8);
- }
-
- for(var i=0; i < nTotalCount; i++){
-
- sItemSort = parseInt(ds_grd_testlist.getColumn(i,"itemsort"));
- sItemnm = ds_grd_testlist.getColumn(sItemSort,"itemnm");
- sItemval = ds_grd_testlist.getColumn(sItemSort,"itemval");
- sItemGroup = ds_grd_testlist.getColumn(sItemSort,"itemgroup");
- if(sItemval == undefined){ //추가(2015.01.21)
- 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 += sItemnm +" : "+ sItemval + "\n";
- }else{
- if(utlf_isNull(gGroupMap.get(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>
|