KIDS Distribution saved on Sep 02, 2010@13:17:32 EDP1_0 RELEASED **KIDS**:EMERGENCY DEPARTMENT 1.0^ **INSTALL NAME** EMERGENCY DEPARTMENT 1.0 "BLD",6763,0) EMERGENCY DEPARTMENT 1.0^EMERGENCY DEPARTMENT^0^3100902^y "BLD",6763,1,0) ^^4^4^3081118^ "BLD",6763,1,1,0) This is the initial installation of the Emergency Department Information "BLD",6763,1,2,0) System (EDIS). This is the module that handles tracking of a patient "BLD",6763,1,3,0) through an emergency department visit. The user interface for this "BLD",6763,1,4,0) application is a web application. "BLD",6763,4,0) ^9.64PA^233.2^7 "BLD",6763,4,230,0) 230 "BLD",6763,4,230,222) y^y^f^^^^n "BLD",6763,4,230.1,0) 230.1 "BLD",6763,4,230.1,222) y^y^f^^^^n "BLD",6763,4,231.7,0) 231.7 "BLD",6763,4,231.7,222) y^y^f^^^^n "BLD",6763,4,231.8,0) 231.8 "BLD",6763,4,231.8,222) y^y^f^^^^n "BLD",6763,4,231.9,0) 231.9 "BLD",6763,4,231.9,222) y^y^f^^^^n "BLD",6763,4,233.1,0) 233.1 "BLD",6763,4,233.1,222) y^y^f^^y^^y^r^n "BLD",6763,4,233.1,224) I $E(^(0),1,4)="edp." "BLD",6763,4,233.2,0) 233.2 "BLD",6763,4,233.2,222) y^y^f^^y^^y^r^n "BLD",6763,4,233.2,224) I $E(^(0),1,4)="edp." "BLD",6763,4,"B",230,230) "BLD",6763,4,"B",230.1,230.1) "BLD",6763,4,"B",231.7,231.7) "BLD",6763,4,"B",231.8,231.8) "BLD",6763,4,"B",231.9,231.9) "BLD",6763,4,"B",233.1,233.1) "BLD",6763,4,"B",233.2,233.2) "BLD",6763,6.3) 74 "BLD",6763,"ABPKG") n "BLD",6763,"INI") EDPYPRE "BLD",6763,"INIT") EDPYPST "BLD",6763,"KRN",0) ^9.67PA^8989.52^19 "BLD",6763,"KRN",.4,0) .4 "BLD",6763,"KRN",.401,0) .401 "BLD",6763,"KRN",.402,0) .402 "BLD",6763,"KRN",.403,0) .403 "BLD",6763,"KRN",.5,0) .5 "BLD",6763,"KRN",.84,0) .84 "BLD",6763,"KRN",3.6,0) 3.6 "BLD",6763,"KRN",3.8,0) 3.8 "BLD",6763,"KRN",9.2,0) 9.2 "BLD",6763,"KRN",9.8,0) 9.8 "BLD",6763,"KRN",9.8,"NM",0) ^9.68A^57^53 "BLD",6763,"KRN",9.8,"NM",1,0) EDPFAA^^0^B5372812 "BLD",6763,"KRN",9.8,"NM",2,0) EDPFLEX^^0^B1745474 "BLD",6763,"KRN",9.8,"NM",3,0) EDPFMON^^0^B27211876 "BLD",6763,"KRN",9.8,"NM",5,0) EDPFPER^^0^B3427509 "BLD",6763,"KRN",9.8,"NM",6,0) EDPFPTL^^0^B4915038 "BLD",6763,"KRN",9.8,"NM",9,0) EDPX^^0^B9797287 "BLD",6763,"KRN",9.8,"NM",10,0) EDPRPT^^0^B17619722 "BLD",6763,"KRN",9.8,"NM",11,0) EDPRPT1^^0^B33605254 "BLD",6763,"KRN",9.8,"NM",12,0) EDPRPT10^^0^B19172294 "BLD",6763,"KRN",9.8,"NM",13,0) EDPRPT11^^0^B8054102 "BLD",6763,"KRN",9.8,"NM",14,0) EDPRPT2^^0^B15843773 "BLD",6763,"KRN",9.8,"NM",15,0) EDPRPT3^^0^B8721424 "BLD",6763,"KRN",9.8,"NM",16,0) EDPRPT4^^0^B24084771 "BLD",6763,"KRN",9.8,"NM",17,0) EDPRPT5^^0^B35383693 "BLD",6763,"KRN",9.8,"NM",18,0) EDPRPT6^^0^B9613057 "BLD",6763,"KRN",9.8,"NM",19,0) EDPRPT7^^0^B19582712 "BLD",6763,"KRN",9.8,"NM",20,0) EDPRPT7C^^0^B19611509 "BLD",6763,"KRN",9.8,"NM",21,0) EDPRPT8^^0^B14454195 "BLD",6763,"KRN",9.8,"NM",22,0) EDPRPT9^^0^B1592058 "BLD",6763,"KRN",9.8,"NM",23,0) EDPFMOVE^^0^B43728958 "BLD",6763,"KRN",9.8,"NM",24,0) EDPCONV^^0^B47887788 "BLD",6763,"KRN",9.8,"NM",25,0) EDPBCF^^0^B25096927 "BLD",6763,"KRN",9.8,"NM",26,0) EDPBCM^^0^B17076528 "BLD",6763,"KRN",9.8,"NM",27,0) EDPBPM^^0^B6216911 "BLD",6763,"KRN",9.8,"NM",28,0) EDPBRM^^0^B24385375 "BLD",6763,"KRN",9.8,"NM",29,0) EDPBRS^^0^B19077772 "BLD",6763,"KRN",9.8,"NM",30,0) EDPBSL^^0^B20029785 "BLD",6763,"KRN",9.8,"NM",31,0) EDPBST^^0^B8664749 "BLD",6763,"KRN",9.8,"NM",32,0) EDPCBRD^^0^B4350223 "BLD",6763,"KRN",9.8,"NM",34,0) EDPCTRL^^0^B33410398 "BLD",6763,"KRN",9.8,"NM",35,0) EDPDD^^0^B1560959 "BLD",6763,"KRN",9.8,"NM",36,0) EDPFPTC^^0^B14885802 "BLD",6763,"KRN",9.8,"NM",37,0) EDPLOG^^0^B42149061 "BLD",6763,"KRN",9.8,"NM",38,0) EDPLOG1^^0^B2583250 "BLD",6763,"KRN",9.8,"NM",39,0) EDPLOGA^^0^B10789313 "BLD",6763,"KRN",9.8,"NM",40,0) EDPLOGH^^0^B9457380 "BLD",6763,"KRN",9.8,"NM",41,0) EDPMAIL^^0^B7335309 "BLD",6763,"KRN",9.8,"NM",42,0) EDPQAR^^0^B6639632 "BLD",6763,"KRN",9.8,"NM",43,0) EDPQDB^^0^B37231235 "BLD",6763,"KRN",9.8,"NM",44,0) EDPQDBS^^0^B3113182 "BLD",6763,"KRN",9.8,"NM",45,0) EDPQLE^^0^B40300302 "BLD",6763,"KRN",9.8,"NM",46,0) EDPQLE1^^0^B9736825 "BLD",6763,"KRN",9.8,"NM",47,0) EDPQLP^^0^B12368052 "BLD",6763,"KRN",9.8,"NM",48,0) EDPCSV^^0^B906612 "BLD",6763,"KRN",9.8,"NM",49,0) EDPLPCE^^0^B32802123 "BLD",6763,"KRN",9.8,"NM",50,0) EDPRPT12^^0^B7797789 "BLD",6763,"KRN",9.8,"NM",51,0) EDPRPTBV^^0^B21129991 "BLD",6763,"KRN",9.8,"NM",52,0) EDPCONV1^^0^B10237522 "BLD",6763,"KRN",9.8,"NM",53,0) EDPCDBG^^0^B4038807 "BLD",6763,"KRN",9.8,"NM",54,0) EDPQPCE^^0^B2442064 "BLD",6763,"KRN",9.8,"NM",55,0) EDPBLK^^0^B7330093 "BLD",6763,"KRN",9.8,"NM",56,0) EDPBDL^^0^B11063047 "BLD",6763,"KRN",9.8,"NM",57,0) EDPBKS^^0^B15371728 "BLD",6763,"KRN",9.8,"NM","B","EDPBCF",25) "BLD",6763,"KRN",9.8,"NM","B","EDPBCM",26) "BLD",6763,"KRN",9.8,"NM","B","EDPBDL",56) "BLD",6763,"KRN",9.8,"NM","B","EDPBKS",57) "BLD",6763,"KRN",9.8,"NM","B","EDPBLK",55) "BLD",6763,"KRN",9.8,"NM","B","EDPBPM",27) "BLD",6763,"KRN",9.8,"NM","B","EDPBRM",28) "BLD",6763,"KRN",9.8,"NM","B","EDPBRS",29) "BLD",6763,"KRN",9.8,"NM","B","EDPBSL",30) "BLD",6763,"KRN",9.8,"NM","B","EDPBST",31) "BLD",6763,"KRN",9.8,"NM","B","EDPCBRD",32) "BLD",6763,"KRN",9.8,"NM","B","EDPCDBG",53) "BLD",6763,"KRN",9.8,"NM","B","EDPCONV",24) "BLD",6763,"KRN",9.8,"NM","B","EDPCONV1",52) "BLD",6763,"KRN",9.8,"NM","B","EDPCSV",48) "BLD",6763,"KRN",9.8,"NM","B","EDPCTRL",34) "BLD",6763,"KRN",9.8,"NM","B","EDPDD",35) "BLD",6763,"KRN",9.8,"NM","B","EDPFAA",1) "BLD",6763,"KRN",9.8,"NM","B","EDPFLEX",2) "BLD",6763,"KRN",9.8,"NM","B","EDPFMON",3) "BLD",6763,"KRN",9.8,"NM","B","EDPFMOVE",23) "BLD",6763,"KRN",9.8,"NM","B","EDPFPER",5) "BLD",6763,"KRN",9.8,"NM","B","EDPFPTC",36) "BLD",6763,"KRN",9.8,"NM","B","EDPFPTL",6) "BLD",6763,"KRN",9.8,"NM","B","EDPLOG",37) "BLD",6763,"KRN",9.8,"NM","B","EDPLOG1",38) "BLD",6763,"KRN",9.8,"NM","B","EDPLOGA",39) "BLD",6763,"KRN",9.8,"NM","B","EDPLOGH",40) "BLD",6763,"KRN",9.8,"NM","B","EDPLPCE",49) "BLD",6763,"KRN",9.8,"NM","B","EDPMAIL",41) "BLD",6763,"KRN",9.8,"NM","B","EDPQAR",42) "BLD",6763,"KRN",9.8,"NM","B","EDPQDB",43) "BLD",6763,"KRN",9.8,"NM","B","EDPQDBS",44) "BLD",6763,"KRN",9.8,"NM","B","EDPQLE",45) "BLD",6763,"KRN",9.8,"NM","B","EDPQLE1",46) "BLD",6763,"KRN",9.8,"NM","B","EDPQLP",47) "BLD",6763,"KRN",9.8,"NM","B","EDPQPCE",54) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT",10) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT1",11) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT10",12) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT11",13) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT12",50) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT2",14) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT3",15) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT4",16) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT5",17) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT6",18) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT7",19) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT7C",20) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT8",21) "BLD",6763,"KRN",9.8,"NM","B","EDPRPT9",22) "BLD",6763,"KRN",9.8,"NM","B","EDPRPTBV",51) "BLD",6763,"KRN",9.8,"NM","B","EDPX",9) "BLD",6763,"KRN",19,0) 19 "BLD",6763,"KRN",19,"NM",0) ^9.68A^18^17 "BLD",6763,"KRN",19,"NM",1,0) EDPF TRACKING MENU ALL^^0 "BLD",6763,"KRN",19,"NM",2,0) EDPF TRACKING MENU CLINICIAN^^0 "BLD",6763,"KRN",19,"NM",3,0) EDPF TRACKING MENU SIGNIN^^0 "BLD",6763,"KRN",19,"NM",4,0) EDPF TRACKING MENU TRIAGE^^0 "BLD",6763,"KRN",19,"NM",5,0) EDPF TRACKING SYSTEM^^0 "BLD",6763,"KRN",19,"NM",6,0) EDPF TRACKING VIEW BOARD^^0 "BLD",6763,"KRN",19,"NM",7,0) EDPF TRACKING VIEW CONFIGURE^^0 "BLD",6763,"KRN",19,"NM",8,0) EDPF TRACKING VIEW DISPOSITION^^0 "BLD",6763,"KRN",19,"NM",9,0) EDPF TRACKING VIEW EDIT CLOSED^^0 "BLD",6763,"KRN",19,"NM",10,0) EDPF TRACKING VIEW REPORTS^^0 "BLD",6763,"KRN",19,"NM",11,0) EDPF TRACKING VIEW SIGNIN^^0 "BLD",6763,"KRN",19,"NM",12,0) EDPF TRACKING VIEW STAFF^^0 "BLD",6763,"KRN",19,"NM",13,0) EDPF TRACKING VIEW TRIAGE^^0 "BLD",6763,"KRN",19,"NM",14,0) EDPF TRACKING VIEW UPDATE^^0 "BLD",6763,"KRN",19,"NM",16,0) EDP CONVERSION^^0 "BLD",6763,"KRN",19,"NM",17,0) EDPS BOARD CONTEXT^^0 "BLD",6763,"KRN",19,"NM",18,0) EDPF BIGBOARD KIOSKS^^0 "BLD",6763,"KRN",19,"NM","B","EDP CONVERSION",16) "BLD",6763,"KRN",19,"NM","B","EDPF BIGBOARD KIOSKS",18) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU ALL",1) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU CLINICIAN",2) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU SIGNIN",3) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU TRIAGE",4) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING SYSTEM",5) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW BOARD",6) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW CONFIGURE",7) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW DISPOSITION",8) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW EDIT CLOSED",9) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW REPORTS",10) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW SIGNIN",11) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW STAFF",12) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW TRIAGE",13) "BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW UPDATE",14) "BLD",6763,"KRN",19,"NM","B","EDPS BOARD CONTEXT",17) "BLD",6763,"KRN",19.1,0) 19.1 "BLD",6763,"KRN",19.1,"NM",0) ^9.68A^4^4 "BLD",6763,"KRN",19.1,"NM",1,0) EDPR EXPORT^^0 "BLD",6763,"KRN",19.1,"NM",2,0) EDPR PROVIDER^^0 "BLD",6763,"KRN",19.1,"NM",3,0) EDPR XREF^^0 "BLD",6763,"KRN",19.1,"NM",4,0) EDPF KIOSKS^^0 "BLD",6763,"KRN",19.1,"NM","B","EDPF KIOSKS",4) "BLD",6763,"KRN",19.1,"NM","B","EDPR EXPORT",1) "BLD",6763,"KRN",19.1,"NM","B","EDPR PROVIDER",2) "BLD",6763,"KRN",19.1,"NM","B","EDPR XREF",3) "BLD",6763,"KRN",101,0) 101 "BLD",6763,"KRN",101,"NM",0) ^9.68A^25^25 "BLD",6763,"KRN",101,"NM",1,0) EDP CHECK-IN^^0 "BLD",6763,"KRN",101,"NM",2,0) EDP MONITOR^^0 "BLD",6763,"KRN",101,"NM",3,0) FH EVSEND OR^^2 "BLD",6763,"KRN",101,"NM",4,0) GMRC EVSEND OR^^2 "BLD",6763,"KRN",101,"NM",5,0) LR7O CH EVSEND OR^^2 "BLD",6763,"KRN",101,"NM",6,0) OR EVSEND ORG^^2 "BLD",6763,"KRN",101,"NM",7,0) PS EVSEND OR^^2 "BLD",6763,"KRN",101,"NM",8,0) RA EVSEND OR^^2 "BLD",6763,"KRN",101,"NM",9,0) SDAM APPOINTMENT EVENTS^^2 "BLD",6763,"KRN",101,"NM",10,0) EDP OR MONITOR^^0 "BLD",6763,"KRN",101,"NM",11,0) OR EVSEND FH^^2 "BLD",6763,"KRN",101,"NM",12,0) OR EVSEND GMRC^^2 "BLD",6763,"KRN",101,"NM",13,0) OR EVSEND LRCH^^2 "BLD",6763,"KRN",101,"NM",14,0) OR EVSEND PS^^2 "BLD",6763,"KRN",101,"NM",15,0) OR EVSEND RA^^2 "BLD",6763,"KRN",101,"NM",16,0) EDP NEW PATIENT^^0 "BLD",6763,"KRN",101,"NM",17,0) EDPF ADD BOARD^^0 "BLD",6763,"KRN",101,"NM",18,0) EDPF BIGBOARD MENU^^0 "BLD",6763,"KRN",101,"NM",19,0) EDPF BLANK 1^^0 "BLD",6763,"KRN",101,"NM",20,0) EDPF BLANK 2^^0 "BLD",6763,"KRN",101,"NM",21,0) EDPF BLANK 3^^0 "BLD",6763,"KRN",101,"NM",22,0) EDPF CHANGE BOARD^^0 "BLD",6763,"KRN",101,"NM",23,0) EDPF QUIT^^0 "BLD",6763,"KRN",101,"NM",24,0) EDPF REMOVE BOARD^^0 "BLD",6763,"KRN",101,"NM",25,0) EDPF SELECT DIVISION^^0 "BLD",6763,"KRN",101,"NM","B","EDP CHECK-IN",1) "BLD",6763,"KRN",101,"NM","B","EDP MONITOR",2) "BLD",6763,"KRN",101,"NM","B","EDP NEW PATIENT",16) "BLD",6763,"KRN",101,"NM","B","EDP OR MONITOR",10) "BLD",6763,"KRN",101,"NM","B","EDPF ADD BOARD",17) "BLD",6763,"KRN",101,"NM","B","EDPF BIGBOARD MENU",18) "BLD",6763,"KRN",101,"NM","B","EDPF BLANK 1",19) "BLD",6763,"KRN",101,"NM","B","EDPF BLANK 2",20) "BLD",6763,"KRN",101,"NM","B","EDPF BLANK 3",21) "BLD",6763,"KRN",101,"NM","B","EDPF CHANGE BOARD",22) "BLD",6763,"KRN",101,"NM","B","EDPF QUIT",23) "BLD",6763,"KRN",101,"NM","B","EDPF REMOVE BOARD",24) "BLD",6763,"KRN",101,"NM","B","EDPF SELECT DIVISION",25) "BLD",6763,"KRN",101,"NM","B","FH EVSEND OR",3) "BLD",6763,"KRN",101,"NM","B","GMRC EVSEND OR",4) "BLD",6763,"KRN",101,"NM","B","LR7O CH EVSEND OR",5) "BLD",6763,"KRN",101,"NM","B","OR EVSEND FH",11) "BLD",6763,"KRN",101,"NM","B","OR EVSEND GMRC",12) "BLD",6763,"KRN",101,"NM","B","OR EVSEND LRCH",13) "BLD",6763,"KRN",101,"NM","B","OR EVSEND ORG",6) "BLD",6763,"KRN",101,"NM","B","OR EVSEND PS",14) "BLD",6763,"KRN",101,"NM","B","OR EVSEND RA",15) "BLD",6763,"KRN",101,"NM","B","PS EVSEND OR",7) "BLD",6763,"KRN",101,"NM","B","RA EVSEND OR",8) "BLD",6763,"KRN",101,"NM","B","SDAM APPOINTMENT EVENTS",9) "BLD",6763,"KRN",409.61,0) 409.61 "BLD",6763,"KRN",409.61,"NM",0) ^9.68A^1^1 "BLD",6763,"KRN",409.61,"NM",1,0) EDPF BIGBOARD KIOSKS^^0 "BLD",6763,"KRN",409.61,"NM","B","EDPF BIGBOARD KIOSKS",1) "BLD",6763,"KRN",771,0) 771 "BLD",6763,"KRN",870,0) 870 "BLD",6763,"KRN",8989.51,0) 8989.51 "BLD",6763,"KRN",8989.51,"NM",0) ^9.68A^6^6 "BLD",6763,"KRN",8989.51,"NM",1,0) EDPF LOCATION^^0 "BLD",6763,"KRN",8989.51,"NM",2,0) EDPF SCREEN SIZES^^0 "BLD",6763,"KRN",8989.51,"NM",3,0) EDPF NURSE STAFF SCREEN^^0 "BLD",6763,"KRN",8989.51,"NM",4,0) EDPF DEBUG START TIME^^0 "BLD",6763,"KRN",8989.51,"NM",5,0) EDPF SCHEDULING TRIGGER^^0 "BLD",6763,"KRN",8989.51,"NM",6,0) EDPF BIGBOARD KIOSKS^^0 "BLD",6763,"KRN",8989.51,"NM","B","EDPF BIGBOARD KIOSKS",6) "BLD",6763,"KRN",8989.51,"NM","B","EDPF DEBUG START TIME",4) "BLD",6763,"KRN",8989.51,"NM","B","EDPF LOCATION",1) "BLD",6763,"KRN",8989.51,"NM","B","EDPF NURSE STAFF SCREEN",3) "BLD",6763,"KRN",8989.51,"NM","B","EDPF SCHEDULING TRIGGER",5) "BLD",6763,"KRN",8989.51,"NM","B","EDPF SCREEN SIZES",2) "BLD",6763,"KRN",8989.52,0) 8989.52 "BLD",6763,"KRN",8994,0) 8994 "BLD",6763,"KRN",8994,"NM",0) ^9.68A^2^2 "BLD",6763,"KRN",8994,"NM",1,0) EDPCBRD RPC^^0 "BLD",6763,"KRN",8994,"NM",2,0) EDPCTRL RPC^^0 "BLD",6763,"KRN",8994,"NM","B","EDPCBRD RPC",1) "BLD",6763,"KRN",8994,"NM","B","EDPCTRL RPC",2) "BLD",6763,"KRN","B",.4,.4) "BLD",6763,"KRN","B",.401,.401) "BLD",6763,"KRN","B",.402,.402) "BLD",6763,"KRN","B",.403,.403) "BLD",6763,"KRN","B",.5,.5) "BLD",6763,"KRN","B",.84,.84) "BLD",6763,"KRN","B",3.6,3.6) "BLD",6763,"KRN","B",3.8,3.8) "BLD",6763,"KRN","B",9.2,9.2) "BLD",6763,"KRN","B",9.8,9.8) "BLD",6763,"KRN","B",19,19) "BLD",6763,"KRN","B",19.1,19.1) "BLD",6763,"KRN","B",101,101) "BLD",6763,"KRN","B",409.61,409.61) "BLD",6763,"KRN","B",771,771) "BLD",6763,"KRN","B",870,870) "BLD",6763,"KRN","B",8989.51,8989.51) "BLD",6763,"KRN","B",8989.52,8989.52) "BLD",6763,"KRN","B",8994,8994) "BLD",6763,"PRE") "BLD",6763,"QUES",0) ^9.62^^ "BLD",6763,"REQB",0) ^9.611^^ "DATA",233.1,1,0) edp.acuity.esi1^1^1 "DATA",233.1,1,2,0) ^^1^1^3070720^ "DATA",233.1,1,2,1,0) Most critical "DATA",233.1,2,0) edp.acuity.esi2^2^2 "DATA",233.1,3,0) edp.acuity.esi3^3^3 "DATA",233.1,4,0) edp.acuity.esi4^4^4 "DATA",233.1,5,0) edp.acuity.esi5^5^5 "DATA",233.1,6,0) edp.source.nhcu-onsite^On-Site Nursing Home "DATA",233.1,6,2,0) ^^1^1^3080605^ "DATA",233.1,6,2,1,0) Transfer from on-site nursing home. "DATA",233.1,7,0) edp.disposition.error^Patient Name Entered in Error^ERR "DATA",233.1,8,0) edp.status.admitted^Admitted^Admit^^A "DATA",233.1,8,2,0) ^^1^1^3080605^ "DATA",233.1,8,2,1,0) Patient admitted, still in ED. "DATA",233.1,9,0) edp.status.edobs^ED Observation Unit^EDObs^^AO "DATA",233.1,9,2,0) ^^1^1^3080605^ "DATA",233.1,9,2,1,0) Observation patient under care of the ED. "DATA",233.1,15,0) edp.delay.inptbed^Obtain Inpatient Bed^13k "DATA",233.1,15,2,0) ^^2^2^3080606^ "DATA",233.1,15,2,1,0) Delay from time admit order written to Bed Control or House Supervisor "DATA",233.1,15,2,2,0) assigns pt to a (eg. ICU pt waiting on ICU bed to open up). "DATA",233.1,16,0) edp.delay.overcrowd^Overcrowding of ED^13a "DATA",233.1,16,2,0) ^^3^3^3080606^ "DATA",233.1,16,2,1,0) Delay for an ED bed to become available, includes hallway beds, or beds "DATA",233.1,16,2,2,0) unavailable due to staffing issues. No beds available for inbound "DATA",233.1,16,2,3,0) ambulances, including hallway beds. "DATA",233.1,17,0) edp.delay.admiteval^Admitting Physician Evaluation^13c "DATA",233.1,17,2,0) ^^4^4^3080606^ "DATA",233.1,17,2,1,0) Delay related to admitting doctor's evaluation and confirmation of "DATA",233.1,17,2,2,0) disposition. Starts when physician sees patient and ends when H&P done, "DATA",233.1,17,2,3,0) ancillary studies necessary to dispo pt done & resulted, pt ready to be "DATA",233.1,17,2,4,0) dispositioned. "DATA",233.1,18,0) edp.delay.admitdispo^Admit Physician Writing Dispo^13h "DATA",233.1,18,2,0) ^^3^3^3080606^ "DATA",233.1,18,2,1,0) Delay due to failure of the physician to Orders write the admit/discharge "DATA",233.1,18,2,2,0) order. Includes time from pt ready for dispo to order written to "DATA",233.1,18,2,3,0) admit/discharge. "DATA",233.1,19,0) edp.delay.admitobs^Patient Admitted to Observation^OBS "DATA",233.1,19,2,0) ^^2^2^3080606^ "DATA",233.1,19,2,1,0) Delay because of pt being admitted to Obs. Includes time from pt ready "DATA",233.1,19,2,2,0) for dispo to time order written to admit patient to 23 hours ED/floor obs. "DATA",233.1,20,0) edp.delay.stafflimit^ED Staff Limits^13b "DATA",233.1,20,2,0) ^^3^3^3080606^ "DATA",233.1,20,2,1,0) Delay in processing pt (seeing or accomplishing orders) timely due to "DATA",233.1,20,2,2,0) lack of staff. From time order written to time order accomplished (eg. "DATA",233.1,20,2,3,0) splint ankle). "DATA",233.1,21,0) edp.delay.interfacility^Interfacility Transfer^13m "DATA",233.1,21,2,0) ^^2^2^3080606^ "DATA",233.1,21,2,1,0) Delay caused by inability to transfer patient to another facility in a "DATA",233.1,21,2,2,0) timely manner. "DATA",233.1,22,0) edp.delay.ambulance^Obtain Ambulance Services^13n "DATA",233.1,22,2,0) ^^1^1^3080606^ "DATA",233.1,22,2,1,0) Delay from ambulance request to arrival. "DATA",233.1,23,0) edp.delay.imageresult^Obtain Imaging Results^13g "DATA",233.1,23,2,0) ^^1^1^3080606^ "DATA",233.1,23,2,1,0) Delay from time study done to time study resulted. "DATA",233.1,24,0) edp.delay.imagestudy^Obtain Imaging Studies^13f "DATA",233.1,24,2,0) ^^2^2^3080606^ "DATA",233.1,24,2,1,0) Delay from time study ordered to time study is done and available for "DATA",233.1,24,2,2,0) interpretation. "DATA",233.1,25,0) edp.delay.pharm^Obtain Drugs/Pharmacology^13j "DATA",233.1,25,2,0) ^^2^2^3080606^ "DATA",233.1,25,2,1,0) Delay caused by inability to get ordered drugs from Pharmacy. Includes "DATA",233.1,25,2,2,0) delay from time meds ordered to meds received. "DATA",233.1,26,0) edp.delay.labresult^Obtain Lab Results^13e "DATA",233.1,26,2,0) ^^2^2^3080606^ "DATA",233.1,26,2,1,0) Delay due to lack of timely turn around for labs ordered. Includes time "DATA",233.1,26,2,2,0) from labsdrawn/obtained to labs resulted. "DATA",233.1,27,0) edp.delay.labstudy^Obtain Lab Studies^13d "DATA",233.1,27,2,0) ^^2^2^3080606^ "DATA",233.1,27,2,1,0) Delay caused by inability to get labs drawn in a timely fashion.Time from "DATA",233.1,27,2,2,0) lab order to lab draw. "DATA",233.1,28,0) edp.delay.supplies^Obtain Medical Supplies^13i "DATA",233.1,28,2,0) ^^3^3^3080606^ "DATA",233.1,28,2,1,0) Delay caused by inability to get medical supplies in a timely fashion. "DATA",233.1,28,2,2,0) Includes time from order (or need identified) to receipt of supplies (eg. "DATA",233.1,28,2,3,0) splints, crutches, c-line kits). "DATA",233.1,29,0) edp.delay.surgery^Arrange Emergency Surgery^13l "DATA",233.1,29,2,0) ^^1^1^3080606^ "DATA",233.1,29,2,1,0) Delay in getting pt needing surgery to the OR. "DATA",233.1,30,0) edp.delay.home^Patient Transport Home^13p "DATA",233.1,30,2,0) ^^3^3^3080606^ "DATA",233.1,30,2,1,0) Delays caused by inability to find transportation for discharged patient "DATA",233.1,30,2,2,0) or delays in identified patient transportation arriving at the EDTime "DATA",233.1,30,2,3,0) from pt ready for discharge to pt out of ED. "DATA",233.1,31,0) edp.delay.transport^Patient Transport Other^13o "DATA",233.1,31,2,0) ^^1^1^3080606^ "DATA",233.1,31,2,1,0) Same as above for destinations other than home. "DATA",233.1,35,0) edp.disposition.home^Home^H "DATA",233.1,35,2,0) ^^1^1^3080606^ "DATA",233.1,35,2,1,0) Patient discharge to his/her previous living arrangement. "DATA",233.1,36,0) edp.disposition.admitva^Admitted to VA Ward^VA^^VA "DATA",233.1,36,2,0) ^^1^1^3080606^ "DATA",233.1,36,2,1,0) Patient admitted to an inpatient location, not including ICU/Tele/Psych. "DATA",233.1,37,0) edp.disposition.left^Left Without Being Treated/Seen^L^^M "DATA",233.1,37,2,0) ^^1^1^3080606^ "DATA",233.1,37,2,1,0) Patient leaves the ED before being treated. Not AMA, as no form signed. "DATA",233.1,38,0) edp.disposition.xferva^Transferred to VA Facility^O^^A "DATA",233.1,38,2,0) ^^1^1^3080606^ "DATA",233.1,38,2,1,0) Patient is discharged from the ED and sent to another VA facility. "DATA",233.1,39,0) edp.disposition.ama^AMA^AMA^^M "DATA",233.1,39,2,0) ^^2^2^3080606^ "DATA",233.1,39,2,1,0) Patient left against medical advice; form signed; patient may or may not "DATA",233.1,39,2,2,0) have been evaluated medically. "DATA",233.1,40,0) edp.disposition.clinic^Sent to Urgent Care Clinic^CL "DATA",233.1,40,2,0) ^^3^3^3080606^ "DATA",233.1,40,2,1,0) Patient discharged from the ED and referred to another evaluation clinic "DATA",233.1,40,2,2,0) at the same site. Some degree of triage is necessary to make this "DATA",233.1,40,2,3,0) judgement. "DATA",233.1,41,0) edp.disposition.deceased^Deceased^D "DATA",233.1,41,2,0) ^^1^1^3080606^ "DATA",233.1,41,2,1,0) Dead "DATA",233.1,42,0) edp.disposition.telemetry^Admitted to Telemetry^T^^VA "DATA",233.1,42,2,0) ^^1^1^3080606^ "DATA",233.1,42,2,1,0) Patient admitted to an inpatient telemetry unit. "DATA",233.1,43,0) edp.disposition.icu^Admitted to ICU^ICU^^VA "DATA",233.1,43,2,0) ^^1^1^3080606^ "DATA",233.1,43,2,1,0) Patient admitted to an inpatient critical care unit. "DATA",233.1,44,0) edp.disposition.nec^Sent to Nurse Eval / Drop-In Clinic^NEC "DATA",233.1,44,2,0) ^^3^3^3080606^ "DATA",233.1,44,2,1,0) Patient discharged from the ED and referred to another evaluation clinic "DATA",233.1,44,2,2,0) at the same site. Some degree of triage is necessary to make this "DATA",233.1,44,2,3,0) judgement. "DATA",233.1,45,0) edp.disposition.eloped^Eloped^E^^M "DATA",233.1,45,2,0) ^^2^2^3080606^ "DATA",233.1,45,2,1,0) Patient left the ED and disposition unknown; patient may have been seen "DATA",233.1,45,2,2,0) and evaluated by nurse/doc. "DATA",233.1,46,0) edp.reserved.novalue^ "DATA",233.1,53,0) edp.source.clinic-onsite^On-Site Clinic "DATA",233.1,53,2,0) ^^2^2^3080605^ "DATA",233.1,53,2,1,0) Sent by on-site doc, NP, PA, or nurse or other care provider for "DATA",233.1,53,2,2,0) evaluation "DATA",233.1,54,0) edp.source.clinic-offsite^VA Clinic, Off-Site "DATA",233.1,54,2,0) ^^1^1^3080605^ "DATA",233.1,54,2,1,0) Sent by off-site clinic, e.g., CBOC "DATA",233.1,55,0) edp.source.nhci^NHCI "DATA",233.1,57,0) edp.disposition.xfernon^Transferred to Non-VA Facility^NVA "DATA",233.1,57,2,0) ^^1^1^3080606^ "DATA",233.1,57,2,1,0) Patient is discharge from the ED and sent to another non-VA facility. "DATA",233.1,58,0) edp.disposition.psych^Admitted to Psychiatry^PSY^^VA "DATA",233.1,58,2,0) ^^1^1^3080606^ "DATA",233.1,58,2,1,0) Patient admitted to an inpatient psychiatric unit. "DATA",233.1,59,0) edp.delay.consult^Obtain Consultant^CSLT "DATA",233.1,59,2,0) ^^2^2^3080606^ "DATA",233.1,59,2,1,0) Delay caused by lack of completion of a consult ordered. Includes time "DATA",233.1,59,2,2,0) elapsed from consult requested to consult obtained. "DATA",233.1,64,0) edp.source.non-referred^Self-Referred "DATA",233.1,64,2,0) ^233.12^2^2^3081003^^ "DATA",233.1,64,2,1,0) From outside community without referral no matter what mode of "DATA",233.1,64,2,2,0) transportation. "DATA",233.1,65,0) edp.source.nhcu-offsite^VA Nursing Home, Off-Site "DATA",233.1,65,2,0) ^^1^1^3080605^ "DATA",233.1,65,2,1,0) Transfer from off-site nursing home. "DATA",233.1,66,0) edp.source.clinic-nonva^Non-VA Clinic/Office "DATA",233.1,66,2,0) ^^1^1^3080605^ "DATA",233.1,66,2,1,0) Sent by a non-VA clinic, primary care or other providers. "DATA",233.1,67,0) edp.source.nhcu-nonva^Non-VA Nursing Home "DATA",233.1,67,2,0) ^^1^1^3080605^ "DATA",233.1,67,2,1,0) Sent from a non-VA nursing home. "DATA",233.1,68,0) edp.source.other^Transfer, Other "DATA",233.1,68,2,0) ^^1^1^3080605^ "DATA",233.1,68,2,1,0) Other transfers, like VA ED-to-ED transfer for specific subspecialty care. "DATA",233.1,69,0) edp.status.enroute^En Route/Prearrival "DATA",233.1,69,2,0) ^^1^1^3080605^ "DATA",233.1,69,2,1,0) En-route to the ED. "DATA",233.1,70,0) edp.status.waiting^Awaiting Triage "DATA",233.1,70,2,0) ^^1^1^3080605^ "DATA",233.1,70,2,1,0) At the ED, awaiting triage. "DATA",233.1,71,0) edp.status.edpatient^ED Patient "DATA",233.1,71,2,0) ^^1^1^3080605^ "DATA",233.1,71,2,1,0) ED patient, after triage. "DATA",233.1,72,0) edp.status.boarding^ED Boarding [Hold] "DATA",233.1,72,2,0) ^^1^1^3080605^ "DATA",233.1,72,2,1,0) Admitted and designated as a Holder (extended time in ED). "DATA",233.1,73,0) edp.status.discharged^Discharged "DATA",233.1,73,2,0) ^^1^1^3080605^ "DATA",233.1,73,2,1,0) Discharged, still in ED. "DATA",233.1,74,0) edp.delay.edtobed^ED to Hospital Bed "DATA",233.1,74,2,0) ^233.12^2^2^3080606^^ "DATA",233.1,74,2,1,0) Delay from time hospital bed assigned to pt transported from "DATA",233.1,74,2,2,0) ED(eg.waiting on escort). "DATA",233.1,75,0) edp.delay.physicianlimit^ED Physician Limits "DATA",233.1,75,2,0) ^^3^3^3080606^ "DATA",233.1,75,2,1,0) Delay caused by physicians seeing patients. Includes elapsed time from pt "DATA",233.1,75,2,2,0) placed in bed to pt seen by provider(eg. five chest pains arrive in 10 "DATA",233.1,75,2,3,0) minutes). "DATA",233.1,76,0) edp.delay.oncall^On-call Staff "DATA",233.1,76,2,0) ^^1^1^3080606^ "DATA",233.1,76,2,1,0) Delays caused by inability to contact on-call staff. "DATA",233.1,77,0) edp.delay.acceptphysician^Obtain Accepting Physician "DATA",233.1,77,2,0) ^^3^3^3080606^ "DATA",233.1,77,2,1,0) Delay caused by inability to find an accepting physician to admit "DATA",233.1,77,2,2,0) patient.Includes elapsed time to obtain accepting physician after need "DATA",233.1,77,2,3,0) for pt admission determined. "DATA",233.1,78,0) edp.delay.escort^Obtain Escort "DATA",233.1,78,2,0) ^^3^3^3080606^ "DATA",233.1,78,2,1,0) Delay in getting escort to transport pt. Includes elapsed time from time "DATA",233.1,78,2,2,0) escort called to time escort arrives to transport patient to inpatient "DATA",233.1,78,2,3,0) unit, clinic, or radiology. "DATA",233.2,1,0) edp.acuity "DATA",233.2,1,1,0) ^233.21A^5^5 "DATA",233.2,1,1,1,0) 1^1 "DATA",233.2,1,1,2,0) 2^2 "DATA",233.2,1,1,3,0) 3^3 "DATA",233.2,1,1,4,0) 4^4 "DATA",233.2,1,1,5,0) 5^5 "DATA",233.2,3,0) edp.status "DATA",233.2,3,1,0) ^233.21A^11^7 "DATA",233.2,3,1,1,0) 10^69 "DATA",233.2,3,1,2,0) 20^70 "DATA",233.2,3,1,7,0) 30^71 "DATA",233.2,3,1,8,0) 40^8 "DATA",233.2,3,1,9,0) 50^72 "DATA",233.2,3,1,10,0) 60^9 "DATA",233.2,3,1,11,0) 70^73 "DATA",233.2,4,0) edp.delay "DATA",233.2,4,1,0) ^233.21A^23^23 "DATA",233.2,4,1,1,0) 10^15 "DATA",233.2,4,1,2,0) 20^74 "DATA",233.2,4,1,3,0) 30^16 "DATA",233.2,4,1,4,0) 40^17 "DATA",233.2,4,1,5,0) 50^18 "DATA",233.2,4,1,6,0) 60^19 "DATA",233.2,4,1,7,0) 70^20 "DATA",233.2,4,1,8,0) 80^75 "DATA",233.2,4,1,9,0) 90^21 "DATA",233.2,4,1,10,0) 100^22 "DATA",233.2,4,1,11,0) 110^23 "DATA",233.2,4,1,12,0) 120^24 "DATA",233.2,4,1,13,0) 130^25 "DATA",233.2,4,1,14,0) 140^26 "DATA",233.2,4,1,15,0) 150^27 "DATA",233.2,4,1,16,0) 160^28 "DATA",233.2,4,1,17,0) 170^29 "DATA",233.2,4,1,18,0) 180^59 "DATA",233.2,4,1,19,0) 190^76 "DATA",233.2,4,1,20,0) 200^30 "DATA",233.2,4,1,21,0) 210^31 "DATA",233.2,4,1,22,0) 220^77 "DATA",233.2,4,1,23,0) 230^78 "DATA",233.2,5,0) edp.arrival "DATA",233.2,5,1,0) ^233.21A^8^8 "DATA",233.2,5,1,1,0) 10^64 "DATA",233.2,5,1,2,0) 20^53 "DATA",233.2,5,1,3,0) 30^6 "DATA",233.2,5,1,4,0) 40^54 "DATA",233.2,5,1,5,0) 50^65 "DATA",233.2,5,1,6,0) 60^66 "DATA",233.2,5,1,7,0) 70^67 "DATA",233.2,5,1,8,0) 80^68 "DATA",233.2,6,0) edp.disposition "DATA",233.2,6,1,0) ^233.21A^14^14 "DATA",233.2,6,1,1,0) 10^36 "DATA",233.2,6,1,2,0) 60^39 "DATA",233.2,6,1,3,0) 130^40 "DATA",233.2,6,1,4,0) 110^41 "DATA",233.2,6,1,5,0) 80^45 "DATA",233.2,6,1,6,0) 50^35 "DATA",233.2,6,1,7,0) 30^43 "DATA",233.2,6,1,8,0) 70^37 "DATA",233.2,6,1,9,0) 120^44 "DATA",233.2,6,1,10,0) 20^42 "DATA",233.2,6,1,11,0) 90^38 "DATA",233.2,6,1,12,0) 100^57 "DATA",233.2,6,1,13,0) 40^58 "DATA",233.2,6,1,14,0) 300^7 "FIA",230) ED LOG "FIA",230,0) ^EDP(230, "FIA",230,0,0) 230D "FIA",230,0,1) y^y^f^^^^n "FIA",230,0,10) "FIA",230,0,11) "FIA",230,0,"RLRO") "FIA",230,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",230,230) 0 "FIA",230,230.04) 0 "FIA",230,230.08) 0 "FIA",230.1) ED LOG HISTORY "FIA",230.1,0) ^EDP(230.1, "FIA",230.1,0,0) 230.1P "FIA",230.1,0,1) y^y^f^^^^n "FIA",230.1,0,10) "FIA",230.1,0,11) "FIA",230.1,0,"RLRO") "FIA",230.1,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",230.1,230.1) 0 "FIA",231.7) TRACKING STAFF "FIA",231.7,0) ^EDPB(231.7, "FIA",231.7,0,0) 231.7P "FIA",231.7,0,1) y^y^f^^^^n "FIA",231.7,0,10) "FIA",231.7,0,11) "FIA",231.7,0,"RLRO") "FIA",231.7,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",231.7,231.7) 0 "FIA",231.8) TRACKING ROOM-BED "FIA",231.8,0) ^EDPB(231.8, "FIA",231.8,0,0) 231.8 "FIA",231.8,0,1) y^y^f^^^^n "FIA",231.8,0,10) "FIA",231.8,0,11) "FIA",231.8,0,"RLRO") "FIA",231.8,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",231.8,231.8) 0 "FIA",231.9) TRACKING AREA "FIA",231.9,0) ^EDPB(231.9, "FIA",231.9,0,0) 231.9 "FIA",231.9,0,1) y^y^f^^^^n "FIA",231.9,0,10) "FIA",231.9,0,11) "FIA",231.9,0,"RLRO") "FIA",231.9,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",231.9,231.9) 0 "FIA",231.9,231.93) 0 "FIA",231.9,231.94) 0 "FIA",231.9,231.941) 0 "FIA",233.1) TRACKING CODE "FIA",233.1,0) ^EDPB(233.1, "FIA",233.1,0,0) 233.1 "FIA",233.1,0,1) y^y^f^^y^^y^r^n "FIA",233.1,0,10) "FIA",233.1,0,11) I $E(^(0),1,4)="edp." "FIA",233.1,0,"RLRO") "FIA",233.1,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",233.1,233.1) 0 "FIA",233.1,233.12) 0 "FIA",233.2) TRACKING CODE SET "FIA",233.2,0) ^EDPB(233.2, "FIA",233.2,0,0) 233.2 "FIA",233.2,0,1) y^y^f^^y^^y^r^n "FIA",233.2,0,10) "FIA",233.2,0,11) I $E(^(0),1,4)="edp." "FIA",233.2,0,"RLRO") "FIA",233.2,0,"VR") 1.0^EMERGENCY DEPARTMENT "FIA",233.2,233.2) 0 "FIA",233.2,233.21) 0 "FRV1",233.2,"1,1,1,0",2) edp.acuity.esi1 "FRV1",233.2,"1,1,1,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"1,1,2,0",2) edp.acuity.esi2 "FRV1",233.2,"1,1,2,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"1,1,3,0",2) edp.acuity.esi3 "FRV1",233.2,"1,1,3,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"1,1,4,0",2) edp.acuity.esi4 "FRV1",233.2,"1,1,4,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"1,1,5,0",2) edp.acuity.esi5 "FRV1",233.2,"1,1,5,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,1,0",2) edp.status.enroute "FRV1",233.2,"3,1,1,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,10,0",2) edp.status.edobs "FRV1",233.2,"3,1,10,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,11,0",2) edp.status.discharged "FRV1",233.2,"3,1,11,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,2,0",2) edp.status.waiting "FRV1",233.2,"3,1,2,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,7,0",2) edp.status.edpatient "FRV1",233.2,"3,1,7,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,8,0",2) edp.status.admitted "FRV1",233.2,"3,1,8,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"3,1,9,0",2) edp.status.boarding "FRV1",233.2,"3,1,9,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,1,0",2) edp.delay.inptbed "FRV1",233.2,"4,1,1,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,10,0",2) edp.delay.ambulance "FRV1",233.2,"4,1,10,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,11,0",2) edp.delay.imageresult "FRV1",233.2,"4,1,11,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,12,0",2) edp.delay.imagestudy "FRV1",233.2,"4,1,12,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,13,0",2) edp.delay.pharm "FRV1",233.2,"4,1,13,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,14,0",2) edp.delay.labresult "FRV1",233.2,"4,1,14,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,15,0",2) edp.delay.labstudy "FRV1",233.2,"4,1,15,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,16,0",2) edp.delay.supplies "FRV1",233.2,"4,1,16,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,17,0",2) edp.delay.surgery "FRV1",233.2,"4,1,17,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,18,0",2) edp.delay.consult "FRV1",233.2,"4,1,18,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,19,0",2) edp.delay.oncall "FRV1",233.2,"4,1,19,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,2,0",2) edp.delay.edtobed "FRV1",233.2,"4,1,2,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,20,0",2) edp.delay.home "FRV1",233.2,"4,1,20,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,21,0",2) edp.delay.transport "FRV1",233.2,"4,1,21,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,22,0",2) edp.delay.acceptphysician "FRV1",233.2,"4,1,22,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,23,0",2) edp.delay.escort "FRV1",233.2,"4,1,23,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,3,0",2) edp.delay.overcrowd "FRV1",233.2,"4,1,3,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,4,0",2) edp.delay.admiteval "FRV1",233.2,"4,1,4,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,5,0",2) edp.delay.admitdispo "FRV1",233.2,"4,1,5,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,6,0",2) edp.delay.admitobs "FRV1",233.2,"4,1,6,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,7,0",2) edp.delay.stafflimit "FRV1",233.2,"4,1,7,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,8,0",2) edp.delay.physicianlimit "FRV1",233.2,"4,1,8,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"4,1,9,0",2) edp.delay.interfacility "FRV1",233.2,"4,1,9,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,1,0",2) edp.source.non-referred "FRV1",233.2,"5,1,1,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,2,0",2) edp.source.clinic-onsite "FRV1",233.2,"5,1,2,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,3,0",2) edp.source.nhcu-onsite "FRV1",233.2,"5,1,3,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,4,0",2) edp.source.clinic-offsite "FRV1",233.2,"5,1,4,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,5,0",2) edp.source.nhcu-offsite "FRV1",233.2,"5,1,5,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,6,0",2) edp.source.clinic-nonva "FRV1",233.2,"5,1,6,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,7,0",2) edp.source.nhcu-nonva "FRV1",233.2,"5,1,7,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"5,1,8,0",2) edp.source.other "FRV1",233.2,"5,1,8,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,1,0",2) edp.disposition.admitva "FRV1",233.2,"6,1,1,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,10,0",2) edp.disposition.telemetry "FRV1",233.2,"6,1,10,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,11,0",2) edp.disposition.xferva "FRV1",233.2,"6,1,11,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,12,0",2) edp.disposition.xfernon "FRV1",233.2,"6,1,12,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,13,0",2) edp.disposition.psych "FRV1",233.2,"6,1,13,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,14,0",2) edp.disposition.error "FRV1",233.2,"6,1,14,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,2,0",2) edp.disposition.ama "FRV1",233.2,"6,1,2,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,3,0",2) edp.disposition.clinic "FRV1",233.2,"6,1,3,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,4,0",2) edp.disposition.deceased "FRV1",233.2,"6,1,4,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,5,0",2) edp.disposition.eloped "FRV1",233.2,"6,1,5,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,6,0",2) edp.disposition.home "FRV1",233.2,"6,1,6,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,7,0",2) edp.disposition.icu "FRV1",233.2,"6,1,7,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,8,0",2) edp.disposition.left "FRV1",233.2,"6,1,8,0",2,"F") ;EDPB(233.1, "FRV1",233.2,"6,1,9,0",2) edp.disposition.nec "FRV1",233.2,"6,1,9,0",2,"F") ;EDPB(233.1, "INI") EDPYPRE "INIT") EDPYPST "IX",230,230,"AC",0) 230^AC^SITE,AREA,IEN when entry is active (not closed)^R^^R^IR^I^230^^^^^S "IX",230,230,"AC",.1,0) ^^1^1^3080912^ "IX",230,230,"AC",.1,1,0) List the patients that are currently active on the display board. "IX",230,230,"AC",1) S ^EDP(230,"AC",$E(X(1),1,30),$E(X(2),1,30),DA)="" "IX",230,230,"AC",1.4) S X='X2(3) "IX",230,230,"AC",2) K ^EDP(230,"AC",$E(X(1),1,30),$E(X(2),1,30),DA) "IX",230,230,"AC",2.5) K ^EDP(230,"AC") "IX",230,230,"AC",11.1,0) ^.114IA^3^3 "IX",230,230,"AC",11.1,1,0) 1^F^230^.02^30^1^F "IX",230,230,"AC",11.1,2,0) 2^F^230^.03^30^2^F "IX",230,230,"AC",11.1,3,0) 3^F^230^.07^2^^F "IX",230,230,"ADUP1",0) 230^ADUP1^SITE,AREA,LASTNAME,IEN for active patients^MU^^R^IR^I^230^^^^^S "IX",230,230,"ADUP1",.1,0) ^^3^3^3081003^ "IX",230,230,"ADUP1",.1,1,0) This contributes the last name to the ADUP xref, which helps in "IX",230,230,"ADUP1",.1,2,0) identifying patients with similar names or similar brief identifiers. "IX",230,230,"ADUP1",.1,3,0) Only active (not closed) entries are in the cross reference. "IX",230,230,"ADUP1",1) S ^EDP(230,"ADUP",X(1),X(2),X(3),DA)="" "IX",230,230,"ADUP1",1.4) S X='X2(4) "IX",230,230,"ADUP1",2) K ^EDP(230,"ADUP",X(1),X(2),X(3),DA) "IX",230,230,"ADUP1",2.5) "IX",230,230,"ADUP1",11.1,0) ^.114IA^4^4 "IX",230,230,"ADUP1",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"ADUP1",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"ADUP1",11.1,3,0) 3^F^230^.04^^3^F "IX",230,230,"ADUP1",11.1,3,2) S X=$P(X,",") "IX",230,230,"ADUP1",11.1,4,0) 4^F^230^.07^^^F "IX",230,230,"ADUP2",0) 230^ADUP2^SITE,AREA,LAST4,IEN for active patients^MU^^R^IR^I^230^^^^^S "IX",230,230,"ADUP2",.1,0) ^^3^3^3081003^ "IX",230,230,"ADUP2",.1,1,0) This contributes the last initial / last 4 to the ADUP xref, which helps "IX",230,230,"ADUP2",.1,2,0) in identifying patients with similar names or similar brief identifiers. "IX",230,230,"ADUP2",.1,3,0) Only active (not closed) entries are in the cross reference. "IX",230,230,"ADUP2",1) S ^EDP(230,"ADUP",X(1),X(2),X(3),DA)="" "IX",230,230,"ADUP2",1.4) S X='X2(4) "IX",230,230,"ADUP2",2) K ^EDP(230,"ADUP",X(1),X(2),X(3),DA) "IX",230,230,"ADUP2",2.5) "IX",230,230,"ADUP2",11.1,0) ^.114IA^4^4 "IX",230,230,"ADUP2",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"ADUP2",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"ADUP2",11.1,3,0) 3^F^230^.11^^3^F "IX",230,230,"ADUP2",11.1,4,0) 4^F^230^.07^^^F "IX",230,230,"AL",0) 230^AL^SITE, AREA, LOC, IEN when entry is active^R^^R^IR^I^230^^^^^S "IX",230,230,"AL",.1,0) ^^1^1^3080912^ "IX",230,230,"AL",.1,1,0) Allows checking for beds / areas that are currently occupied. "IX",230,230,"AL",1) S ^EDP(230,"AL",X(1),X(2),X(3),DA)="" "IX",230,230,"AL",1.4) S X='X2(4) "IX",230,230,"AL",2) K ^EDP(230,"AL",X(1),X(2),X(3),DA) "IX",230,230,"AL",2.5) K ^EDP(230,"AL") "IX",230,230,"AL",11.1,0) ^.114IA^4^4 "IX",230,230,"AL",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"AL",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"AL",11.1,3,0) 3^F^230^3.4^^3^F "IX",230,230,"AL",11.1,4,0) 4^F^230^.07^^^F "IX",230,230,"AN",0) 230^AN^SITE,AREA,PTNAME,IEN for active patients^R^^R^IR^I^230^^^^^S "IX",230,230,"AN",.1,0) ^^8^8^3081003^ "IX",230,230,"AN",.1,1,0) Allows for checking to see if the patient is already active in the case "IX",230,230,"AN",.1,2,0) where the patient does not have a DFN (i.e., humanitarian). It is "IX",230,230,"AN",.1,3,0) referenced when adding a new patient to the board. "IX",230,230,"AN",.1,4,0) "IX",230,230,"AN",.1,5,0) The AN cross reference contains the full name. It differs from the ADUP "IX",230,230,"AN",.1,6,0) cross reference in that the ADUP cross reference contains specific "IX",230,230,"AN",.1,7,0) attributes that are to be monitored (such as last name & last initial / "IX",230,230,"AN",.1,8,0) last 4) for special indication on the display board. "IX",230,230,"AN",1) S ^EDP(230,"AN",X(1),X(2),X(3),DA)="" "IX",230,230,"AN",1.4) S X='X2(4) "IX",230,230,"AN",2) K ^EDP(230,"AN",X(1),X(2),X(3),DA) "IX",230,230,"AN",2.5) K ^EDP(230,"AN") "IX",230,230,"AN",11.1,0) ^.114IA^4^4 "IX",230,230,"AN",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"AN",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"AN",11.1,3,0) 3^F^230^.04^^3^F "IX",230,230,"AN",11.1,4,0) 4^F^230^.07^^^F "IX",230,230,"AO",0) 230^AO^ORDER,IEN for all patients^R^^F^IR^W^230.08^^^^^S "IX",230,230,"AO",.1,0) ^^2^2^3080912^ "IX",230,230,"AO",.1,1,0) This is used to locate orders when they need to be updated from the event "IX",230,230,"AO",.1,2,0) monitor. "IX",230,230,"AO",1) S ^EDP(230,"AO",$E(X,1,30),DA(1),DA)="" "IX",230,230,"AO",2) K ^EDP(230,"AO",$E(X,1,30),DA(1),DA) "IX",230,230,"AO",2.5) K ^EDP(230,"AO") "IX",230,230,"AO",11.1,0) ^.114IA^1^1 "IX",230,230,"AO",11.1,1,0) 1^F^230.08^.01^30^1^F "IX",230,230,"AP",0) 230^AP^SITE,AREA,DFN,IEN for active patients at site (not closed)^R^^R^IR^I^230^^^^^S "IX",230,230,"AP",.1,0) ^^3^3^3081004^ "IX",230,230,"AP",.1,1,0) Allows testing of duplicate patient entry when selecting patients to add "IX",230,230,"AP",.1,2,0) to the display board in the case where the patient has a DFN. The cross "IX",230,230,"AP",.1,3,0) reference is set only for entries that are active (not closed). "IX",230,230,"AP",1) S ^EDP(230,"AP",X(1),X(2),X(3),DA)="" "IX",230,230,"AP",1.4) S X='X2(4) "IX",230,230,"AP",2) K ^EDP(230,"AP",X(1),X(2),X(3),DA) "IX",230,230,"AP",2.5) K ^EDP(230,"AP") "IX",230,230,"AP",11.1,0) ^.114IA^5^4 "IX",230,230,"AP",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"AP",11.1,1,3) "IX",230,230,"AP",11.1,3,0) 2^F^230^.03^^2^F "IX",230,230,"AP",11.1,3,3) "IX",230,230,"AP",11.1,4,0) 3^F^230^.06^^3^F "IX",230,230,"AP",11.1,4,3) "IX",230,230,"AP",11.1,5,0) 4^F^230^.07^^^F "IX",230,230,"AP",11.1,5,3) "IX",230,230,"APA",0) 230^APA^DFN,IEN for currently active patients^R^^R^IR^I^230^^^^^S "IX",230,230,"APA",.1,0) ^^2^2^3080912^ "IX",230,230,"APA",.1,1,0) Used by the event monitors to identify a patient that is actively being "IX",230,230,"APA",.1,2,0) tracked through a visit (regardless of area). "IX",230,230,"APA",1) S ^EDP(230,"APA",X(1),DA)="" "IX",230,230,"APA",1.4) S X='X2(2) "IX",230,230,"APA",2) K ^EDP(230,"APA",X(1),DA) "IX",230,230,"APA",2.5) K ^EDP(230,"APA") "IX",230,230,"APA",11.1,0) ^.114IA^2^2 "IX",230,230,"APA",11.1,1,0) 1^F^230^.06^^1^F "IX",230,230,"APA",11.1,2,0) 2^F^230^.07^^^F "IX",230,230,"AS",0) 230^AS^SITE,AREA,SSN,IEN for active patients^R^^R^IR^I^230^^^^^S "IX",230,230,"AS",.1,0) ^^3^3^3081004^ "IX",230,230,"AS",.1,1,0) Allows for checking to see if the patient is already on the display board "IX",230,230,"AS",.1,2,0) in the case where there is no DFN and a social security number is used to "IX",230,230,"AS",.1,3,0) identify the patient. "IX",230,230,"AS",1) S ^EDP(230,"AS",X(1),X(2),X(3),DA)="" "IX",230,230,"AS",1.4) S X='X2(4) "IX",230,230,"AS",2) K ^EDP(230,"AS",X(1),X(2),X(3),DA) "IX",230,230,"AS",2.5) K ^EDP(230,"AS") "IX",230,230,"AS",11.1,0) ^.114IA^4^4 "IX",230,230,"AS",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"AS",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"AS",11.1,3,0) 3^F^230^.05^^3^F "IX",230,230,"AS",11.1,4,0) 4^F^230^.07^^^F "IX",230,230,"ATI",0) 230^ATI^SITE,TIME IN for reports^MU^^R^IR^I^230^^^^^S "IX",230,230,"ATI",.1,0) ^^1^1^3080912^ "IX",230,230,"ATI",.1,1,0) Used for reports to get a range of visits within a time range. "IX",230,230,"ATI",1) S ^EDP(230,"ATI",X(1),+X(2),DA)="" "IX",230,230,"ATI",2) K ^EDP(230,"ATI",X(1),+X(2),DA) "IX",230,230,"ATI",2.5) K ^EDP(230,"ATI") "IX",230,230,"ATI",11.1,0) ^.114IA^2^2 "IX",230,230,"ATI",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"ATI",11.1,2,0) 2^F^230^.08^^2^F "IX",230,230,"ATO",0) 230^ATO^SITE,TIME OUT for reports^R^^R^IR^I^230^^^^^S "IX",230,230,"ATO",.1,0) ^^2^2^3080912^ "IX",230,230,"ATO",.1,1,0) Used for reports to get a range of visits that were closed within a time "IX",230,230,"ATO",.1,2,0) range. "IX",230,230,"ATO",1) S ^EDP(230,"ATO",X(1),X(2),DA)="" "IX",230,230,"ATO",2) K ^EDP(230,"ATO",X(1),X(2),DA) "IX",230,230,"ATO",2.5) K ^EDP(230,"ATO") "IX",230,230,"ATO",11.1,0) ^.114IA^2^2 "IX",230,230,"ATO",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"ATO",11.1,2,0) 2^F^230^.09^^2^F "IX",230,230,"PDFN",0) 230^PDFN^SITE,AREA,DFN,IEN for all patients^R^^R^IR^I^230^^^^^LS "IX",230,230,"PDFN",.1,0) ^^4^4^3081222^ "IX",230,230,"PDFN",.1,1,0) Indexes all entries by patient DFN. When special lookups are done "IX",230,230,"PDFN",.1,2,0) against the patient file (by SSN, for example), a DFN is returned. This "IX",230,230,"PDFN",.1,3,0) index allows finding the visits for the DFN. This index contains all "IX",230,230,"PDFN",.1,4,0) visits (closed or active) where a DFN has been assigned. "IX",230,230,"PDFN",1) S ^EDP(230,"PDFN",X(1),X(2),X(3),DA)="" "IX",230,230,"PDFN",2) K ^EDP(230,"PDFN",X(1),X(2),X(3),DA) "IX",230,230,"PDFN",2.5) K ^EDP(230,"PDFN") "IX",230,230,"PDFN",11.1,0) ^.114IA^3^3 "IX",230,230,"PDFN",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"PDFN",11.1,1,3) "IX",230,230,"PDFN",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"PDFN",11.1,2,3) "IX",230,230,"PDFN",11.1,3,0) 3^F^230^.06^^3^F "IX",230,230,"PDFN",11.1,3,3) "IX",230,230,"PN",0) 230^PN^SITE,AREA,PTNAME,IEN for all patients^R^^R^IR^I^230^^^^^LS "IX",230,230,"PN",.1,0) ^^5^5^3081003^ "IX",230,230,"PN",.1,1,0) Indexes all patient names. This is for selecting patients when a visit "IX",230,230,"PN",.1,2,0) (closed or otherwise) needs to be corrected. Since some of the visits "IX",230,230,"PN",.1,3,0) may be patients without DFN's, this index allows them to be included in "IX",230,230,"PN",.1,4,0) the selection. All visits (with and without DFN's) are included in the "IX",230,230,"PN",.1,5,0) index. "IX",230,230,"PN",1) S ^EDP(230,"PN",X(1),X(2),X(3),DA)="" "IX",230,230,"PN",2) K ^EDP(230,"PN",X(1),X(2),X(3),DA) "IX",230,230,"PN",2.5) K ^EDP(230,"PN") "IX",230,230,"PN",11.1,0) ^.114IA^3^3 "IX",230,230,"PN",11.1,1,0) 1^F^230^.02^^1^F "IX",230,230,"PN",11.1,2,0) 2^F^230^.03^^2^F "IX",230,230,"PN",11.1,3,0) 3^F^230^.04^^3^F "IX",230.1,230.1,"ADF",0) 230.1^ADF^Log History by time (LOG, TIME, IEN)^R^^R^IR^I^230.1^^^^^S "IX",230.1,230.1,"ADF",.1,0) ^^6^6^3081004^ "IX",230.1,230.1,"ADF",.1,1,0) This cross reference provides, for a single emergency department log "IX",230.1,230.1,"ADF",.1,2,0) record (entry in the ED LOG file) a forward chronological list of updates "IX",230.1,230.1,"ADF",.1,3,0) to the record. "IX",230.1,230.1,"ADF",.1,4,0) "IX",230.1,230.1,"ADF",.1,5,0) The storage transform S X=+X ensures that numeric collation is used for "IX",230.1,230.1,"ADF",.1,6,0) all entries in the cross reference. "IX",230.1,230.1,"ADF",1) S ^EDP(230.1,"ADF",X(1),X(2),DA)="" "IX",230.1,230.1,"ADF",2) K ^EDP(230.1,"ADF",X(1),X(2),DA) "IX",230.1,230.1,"ADF",2.5) K ^EDP(230.1,"ADF") "IX",230.1,230.1,"ADF",11.1,0) ^.114IA^2^2 "IX",230.1,230.1,"ADF",11.1,1,0) 1^F^230.1^.01^^1^F "IX",230.1,230.1,"ADF",11.1,2,0) 2^F^230.1^.02^^2^F "IX",230.1,230.1,"ADF",11.1,2,2) S X=+X "IX",230.1,230.1,"ADR",0) 230.1^ADR^Log History by inverse time (LOG, INVTIME, IEN)^R^^R^IR^I^230.1^^^^^S "IX",230.1,230.1,"ADR",.1,0) ^^8^8^3081004^ "IX",230.1,230.1,"ADR",.1,1,0) This cross reference provides, for a single emergency department log "IX",230.1,230.1,"ADR",.1,2,0) record (entry in the ED LOG file) a reverse chronological list of updates "IX",230.1,230.1,"ADR",.1,3,0) to the record. "IX",230.1,230.1,"ADR",.1,4,0) "IX",230.1,230.1,"ADR",.1,5,0) Since the display board is refreshed frequently, this cross reference "IX",230.1,230.1,"ADR",.1,6,0) helps that happen as fast as possible. It allows forward $O to be used "IX",230.1,230.1,"ADR",.1,7,0) to search back in time. This is a much faster operation than reverse $O "IX",230.1,230.1,"ADR",.1,8,0) on most M systems. "IX",230.1,230.1,"ADR",1) S ^EDP(230.1,"ADR",X(1),X(2),DA)="" "IX",230.1,230.1,"ADR",2) K ^EDP(230.1,"ADR",X(1),X(2),DA) "IX",230.1,230.1,"ADR",2.5) K ^EDP(230.1,"ADR") "IX",230.1,230.1,"ADR",11.1,0) ^.114IA^2^2 "IX",230.1,230.1,"ADR",11.1,1,0) 1^F^230.1^.01^^1^F "IX",230.1,230.1,"ADR",11.1,2,0) 2^F^230.1^.02^^2^F "IX",230.1,230.1,"ADR",11.1,2,2) S X=9999999-X "IX",230.1,230.1,"C",0) 230.1^C^Indexes changes for a log entry by inverse time.^R^^R^IR^I^230.1^^^^^LS "IX",230.1,230.1,"C",1) S ^EDP(230.1,"C",X(1),X(2),DA)="" "IX",230.1,230.1,"C",2) K ^EDP(230.1,"C",X(1),X(2),DA) "IX",230.1,230.1,"C",2.5) K ^EDP(230.1,"C") "IX",230.1,230.1,"C",11.1,0) ^.114IA^2^2 "IX",230.1,230.1,"C",11.1,1,0) 1^F^230.1^.01^^1^F "IX",230.1,230.1,"C",11.1,1,3) "IX",230.1,230.1,"C",11.1,2,0) 2^F^230.1^.02^^2^F "IX",230.1,230.1,"C",11.1,2,2) S X=9999999-X "IX",230.1,230.1,"C",11.1,2,3) "IX",231.7,231.7,"AC",0) 231.7^AC^SITE,AREA,ROLE,IEN if the entry is active^R^^R^IR^I^231.7^^^^^S "IX",231.7,231.7,"AC",.1,0) ^^6^6^3081005^ "IX",231.7,231.7,"AC",.1,1,0) This cross reference supports constructing a list of currently active "IX",231.7,231.7,"AC",.1,2,0) staff for a particular role. "IX",231.7,231.7,"AC",.1,3,0) "IX",231.7,231.7,"AC",.1,4,0) For this record level cross reference, the kill logic should always be "IX",231.7,231.7,"AC",.1,5,0) executed when any value changes. The set logic is then executed "IX",231.7,231.7,"AC",.1,6,0) conditionally, allowing the cross reference to hold only active values. "IX",231.7,231.7,"AC",1) S ^EDPB(231.7,"AC",X(1),X(2),X(3),DA)="" "IX",231.7,231.7,"AC",1.4) S X='X2(4) "IX",231.7,231.7,"AC",2) K ^EDPB(231.7,"AC",X(1),X(2),X(3),DA) "IX",231.7,231.7,"AC",2.5) K ^EDPB(231.7,"AC") "IX",231.7,231.7,"AC",11.1,0) ^.114IA^4^4 "IX",231.7,231.7,"AC",11.1,1,0) 1^F^231.7^.02^^1^F "IX",231.7,231.7,"AC",11.1,2,0) 2^F^231.7^.03^^2^F "IX",231.7,231.7,"AC",11.1,3,0) 3^F^231.7^.06^^3^F "IX",231.7,231.7,"AC",11.1,4,0) 4^F^231.7^.04^^^F "IX",231.7,231.7,"AD",0) 231.7^AD^SITE,AREA,DUZ,IEN^R^^R^IR^I^231.7^^^^^S "IX",231.7,231.7,"AD",.1,0) ^^4^4^3081005^ "IX",231.7,231.7,"AD",.1,1,0) This cross reference allows searching the file for an entry matching a "IX",231.7,231.7,"AD",.1,2,0) particular DUZ (say, to look up a color map). Since a person may work as "IX",231.7,231.7,"AD",.1,3,0) staff in multiple areas, this cross reference allows finding the staff "IX",231.7,231.7,"AD",.1,4,0) record that applies to the person's activity in a specific area. "IX",231.7,231.7,"AD",1) S ^EDPB(231.7,"AD",X(1),X(2),X(3),DA)="" "IX",231.7,231.7,"AD",2) K ^EDPB(231.7,"AD",X(1),X(2),X(3),DA) "IX",231.7,231.7,"AD",2.5) K ^EDPB(231.7,"AD") "IX",231.7,231.7,"AD",11.1,0) ^.114IA^3^3 "IX",231.7,231.7,"AD",11.1,1,0) 1^F^231.7^.02^^1^F "IX",231.7,231.7,"AD",11.1,2,0) 2^F^231.7^.03^^2^F "IX",231.7,231.7,"AD",11.1,3,0) 3^F^231.7^.01^^3^F "IX",231.8,231.8,"AC",0) 231.8^AC^SITE,AREA,DISPLAYNAME,IEN^R^^R^IR^I^231.8^^^^^S "IX",231.8,231.8,"AC",.1,0) ^^2^2^3080915^ "IX",231.8,231.8,"AC",.1,1,0) Allows looking for a room with a specific abbreviation, such as AMBU or "IX",231.8,231.8,"AC",.1,2,0) WAIT (when setting baseline parameters for example). "IX",231.8,231.8,"AC",1) S ^EDPB(231.8,"AC",X(1),X(2),X(3),DA)="" "IX",231.8,231.8,"AC",2) K ^EDPB(231.8,"AC",X(1),X(2),X(3),DA) "IX",231.8,231.8,"AC",2.5) K ^EDPB(231.8,"AC") "IX",231.8,231.8,"AC",11.1,0) ^.114IA^3^3 "IX",231.8,231.8,"AC",11.1,1,0) 1^F^231.8^.02^^1^F "IX",231.8,231.8,"AC",11.1,2,0) 2^F^231.8^.03^^2^F "IX",231.8,231.8,"AC",11.1,3,0) 3^F^231.8^.06^^3^F "IX",231.8,231.8,"C",0) 231.8^C^Index by site and area.^R^^R^IR^I^231.8^^^^^LS "IX",231.8,231.8,"C",.1,0) ^^2^2^3080915^ "IX",231.8,231.8,"C",.1,1,0) Allows collecting all of the rooms for a specific area within a division "IX",231.8,231.8,"C",.1,2,0) (station number). "IX",231.8,231.8,"C",1) S ^EDPB(231.8,"C",X(1),X(2),DA)="" "IX",231.8,231.8,"C",2) K ^EDPB(231.8,"C",X(1),X(2),DA) "IX",231.8,231.8,"C",2.5) K ^EDPB(231.8,"C") "IX",231.8,231.8,"C",11.1,0) ^.114IA^2^2 "IX",231.8,231.8,"C",11.1,1,0) 1^F^231.8^.02^^1^F "IX",231.8,231.8,"C",11.1,2,0) 2^F^231.8^.03^^2^F "IX",233.1,233.1,"AB",0) 233.1^AB^NAME (without prefix), ABBREVIATION^R^^R^IR^I^233.1^^^^^S "IX",233.1,233.1,"AB",.1,0) ^^3^3^3081010^ "IX",233.1,233.1,"AB",.1,1,0) This allows finding all the abbreviations for a name without regard to "IX",233.1,233.1,"AB",.1,2,0) the site prefix. (The prefix is "edp." when nationally exported, "nnn." "IX",233.1,233.1,"AB",.1,3,0) for locally defined, where nnn is the station number.) "IX",233.1,233.1,"AB",1) S ^EDPB(233.1,"AB",$E(X(1),1,30),$E(X(2),1,30),DA)="" "IX",233.1,233.1,"AB",2) K ^EDPB(233.1,"AB",$E(X(1),1,30),$E(X(2),1,30),DA) "IX",233.1,233.1,"AB",2.5) K ^EDPB(233.1,"AB") "IX",233.1,233.1,"AB",11.1,0) ^.114IA^2^2 "IX",233.1,233.1,"AB",11.1,1,0) 1^F^233.1^.01^30^1^F "IX",233.1,233.1,"AB",11.1,1,2) S X=$P(X,".",2) "IX",233.1,233.1,"AB",11.1,2,0) 2^F^233.1^.03^30^2^F "IX",233.1,233.1,"AB",11.1,2,2) S X=$$UP^XLFSTR(X) "IX",233.1,233.1,"AC",0) 233.1^AC^NAME (without prefix), DISPLAY NAME^R^^R^IR^I^233.1^^^^^S "IX",233.1,233.1,"AC",.1,0) ^^3^3^3081010^ "IX",233.1,233.1,"AC",.1,1,0) This allows finding all the display names for a name without regard to the "IX",233.1,233.1,"AC",.1,2,0) site prefix. (The prefix is "edp." when nationally exported, "nnn." for "IX",233.1,233.1,"AC",.1,3,0) locally defined, where nnn is the station number.) "IX",233.1,233.1,"AC",1) S ^EDPB(233.1,"AC",$E(X(1),1,30),$E(X(2),1,60),DA)="" "IX",233.1,233.1,"AC",2) K ^EDPB(233.1,"AC",$E(X(1),1,30),$E(X(2),1,60),DA) "IX",233.1,233.1,"AC",2.5) K ^EDPB(233.1,"AC") "IX",233.1,233.1,"AC",11.1,0) ^.114IA^2^2 "IX",233.1,233.1,"AC",11.1,1,0) 1^F^233.1^.01^30^1^F "IX",233.1,233.1,"AC",11.1,1,2) S X=$P(X,".",2) "IX",233.1,233.1,"AC",11.1,2,0) 2^F^233.1^.02^60^2^F "IX",233.1,233.1,"AC",11.1,2,2) S X=$$UP^XLFSTR(X) "KRN",19,13496,-1) 0^5 "KRN",19,13496,0) EDPF TRACKING SYSTEM^EDIS version 1.0^^B^^^^^^^^KERNEL "KRN",19,13496,1,0) ^19.06^1^1^3080423^^^^ "KRN",19,13496,1,1,0) Context option for ED Tracking System RPC calls at local facility. "KRN",19,13496,99.1) 61001,51187 "KRN",19,13496,"RPC",0) ^19.05P^8^8 "KRN",19,13496,"RPC",7,0) EDPCTRL RPC "KRN",19,13496,"RPC",8,0) EDPCBRD RPC "KRN",19,13496,"U") EDIS VERSION 1.0 "KRN",19,13497,-1) 0^11 "KRN",19,13497,0) EDPF TRACKING VIEW SIGNIN^Sign In Patient^^M^^^^^^^^ "KRN",19,13497,10,0) ^19.01IP^1^1 "KRN",19,13497,10,1,0) 13496 "KRN",19,13497,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13497,99) 61970,67192 "KRN",19,13497,99.1) 61236,65283 "KRN",19,13497,"U") SIGN IN PATIENT "KRN",19,13498,-1) 0^13 "KRN",19,13498,0) EDPF TRACKING VIEW TRIAGE^Triage Patient^^M^^^^^^^^ "KRN",19,13498,10,0) ^19.01IP^1^1 "KRN",19,13498,10,1,0) 13496 "KRN",19,13498,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13498,99) 61970,67192 "KRN",19,13498,99.1) 61129,51343 "KRN",19,13498,"U") TRIAGE PATIENT "KRN",19,13499,-1) 0^14 "KRN",19,13499,0) EDPF TRACKING VIEW UPDATE^Update Tracking Board^^M^^^^^^^^ "KRN",19,13499,10,0) ^19.01IP^1^1 "KRN",19,13499,10,1,0) 13496 "KRN",19,13499,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13499,99) 61970,67192 "KRN",19,13499,99.1) 61130,49249 "KRN",19,13499,"U") UPDATE TRACKING BOARD "KRN",19,13500,-1) 0^8 "KRN",19,13500,0) EDPF TRACKING VIEW DISPOSITION^Disposition Patient^^M^^^^^^^^ "KRN",19,13500,10,0) ^19.01IP^1^1 "KRN",19,13500,10,1,0) 13496 "KRN",19,13500,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13500,99) 61970,67192 "KRN",19,13500,99.1) 61129,60766 "KRN",19,13500,"U") DISPOSITION PATIENT "KRN",19,13501,-1) 0^9 "KRN",19,13501,0) EDPF TRACKING VIEW EDIT CLOSED^Edit Closed Patient^^M^^^^^^^^ "KRN",19,13501,10,0) ^19.01IP^1^1 "KRN",19,13501,10,1,0) 13496 "KRN",19,13501,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13501,99) 61970,67192 "KRN",19,13501,"U") EDIT CLOSED PATIENT "KRN",19,13502,-1) 0^6 "KRN",19,13502,0) EDPF TRACKING VIEW BOARD^Display Board^^M^^^^^^^^ "KRN",19,13502,10,0) ^19.01IP^1^1 "KRN",19,13502,10,1,0) 13496 "KRN",19,13502,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13502,99) 61970,67192 "KRN",19,13502,99.1) 61619,57151 "KRN",19,13502,"U") DISPLAY BOARD "KRN",19,13503,-1) 0^10 "KRN",19,13503,0) EDPF TRACKING VIEW REPORTS^Tracking Reports^^M^^^^^^^^ "KRN",19,13503,10,0) ^19.01IP^1^1 "KRN",19,13503,10,1,0) 13496 "KRN",19,13503,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13503,99) 61970,67192 "KRN",19,13503,"U") TRACKING REPORTS "KRN",19,13504,-1) 0^7 "KRN",19,13504,0) EDPF TRACKING VIEW CONFIGURE^Configure Tracking Board^^M^^^^^^^^ "KRN",19,13504,10,0) ^19.01IP^1^1 "KRN",19,13504,10,1,0) 13496 "KRN",19,13504,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13504,99) 61970,67192 "KRN",19,13504,99.1) 61236,65283 "KRN",19,13504,"U") CONFIGURE TRACKING BOARD "KRN",19,13505,-1) 0^12 "KRN",19,13505,0) EDPF TRACKING VIEW STAFF^Assign Staff^^M^^^^^^^^ "KRN",19,13505,10,0) ^19.01IP^1^1 "KRN",19,13505,10,1,0) 13496 "KRN",19,13505,10,1,"^") EDPF TRACKING SYSTEM "KRN",19,13505,99) 61970,67192 "KRN",19,13505,99.1) 61236,65283 "KRN",19,13505,"U") ASSIGN STAFF "KRN",19,13506,-1) 0^1 "KRN",19,13506,0) EDPF TRACKING MENU ALL^All Tracking Views^^M^^^^^^^^ "KRN",19,13506,10,0) ^19.01IP^9^9 "KRN",19,13506,10,1,0) 13497^^10 "KRN",19,13506,10,1,"^") EDPF TRACKING VIEW SIGNIN "KRN",19,13506,10,2,0) 13498^^20 "KRN",19,13506,10,2,"^") EDPF TRACKING VIEW TRIAGE "KRN",19,13506,10,3,0) 13499^^30 "KRN",19,13506,10,3,"^") EDPF TRACKING VIEW UPDATE "KRN",19,13506,10,4,0) 13500^^40 "KRN",19,13506,10,4,"^") EDPF TRACKING VIEW DISPOSITION "KRN",19,13506,10,5,0) 13501^^50 "KRN",19,13506,10,5,"^") EDPF TRACKING VIEW EDIT CLOSED "KRN",19,13506,10,6,0) 13502^^60 "KRN",19,13506,10,6,"^") EDPF TRACKING VIEW BOARD "KRN",19,13506,10,7,0) 13505^^70 "KRN",19,13506,10,7,"^") EDPF TRACKING VIEW STAFF "KRN",19,13506,10,8,0) 13503^^80 "KRN",19,13506,10,8,"^") EDPF TRACKING VIEW REPORTS "KRN",19,13506,10,9,0) 13504^^90 "KRN",19,13506,10,9,"^") EDPF TRACKING VIEW CONFIGURE "KRN",19,13506,99) 61619,57148 "KRN",19,13506,99.1) 61619,57151 "KRN",19,13506,"U") ALL TRACKING VIEWS "KRN",19,13508,-1) 0^3 "KRN",19,13508,0) EDPF TRACKING MENU SIGNIN^Sign-in Tracking Views^^M^^^^^^^^ "KRN",19,13508,10,0) ^19.01IP^2^2 "KRN",19,13508,10,1,0) 13497^^10 "KRN",19,13508,10,1,"^") EDPF TRACKING VIEW SIGNIN "KRN",19,13508,10,2,0) 13502^^20 "KRN",19,13508,10,2,"^") EDPF TRACKING VIEW BOARD "KRN",19,13508,99) 61619,57148 "KRN",19,13508,99.1) 61619,57151 "KRN",19,13508,"U") SIGN-IN TRACKING VIEWS "KRN",19,13509,-1) 0^4 "KRN",19,13509,0) EDPF TRACKING MENU TRIAGE^Triage Tracking Views^^M^^^^^^^^ "KRN",19,13509,10,0) ^19.01IP^2^2 "KRN",19,13509,10,1,0) 13498^^10 "KRN",19,13509,10,1,"^") EDPF TRACKING VIEW TRIAGE "KRN",19,13509,10,2,0) 13502^^20 "KRN",19,13509,10,2,"^") EDPF TRACKING VIEW BOARD "KRN",19,13509,99) 61619,57148 "KRN",19,13509,99.1) 61619,57151 "KRN",19,13509,"U") TRIAGE TRACKING VIEWS "KRN",19,13510,-1) 0^2 "KRN",19,13510,0) EDPF TRACKING MENU CLINICIAN^Clinician Tracking Views^^M^^^^^^^^ "KRN",19,13510,10,0) ^19.01IP^3^3 "KRN",19,13510,10,1,0) 13499^^10 "KRN",19,13510,10,1,"^") EDPF TRACKING VIEW UPDATE "KRN",19,13510,10,2,0) 13500^^20 "KRN",19,13510,10,2,"^") EDPF TRACKING VIEW DISPOSITION "KRN",19,13510,10,3,0) 13502^^30 "KRN",19,13510,10,3,"^") EDPF TRACKING VIEW BOARD "KRN",19,13510,99) 61619,57148 "KRN",19,13510,99.1) 61619,57151 "KRN",19,13510,"U") CLINICIAN TRACKING VIEWS "KRN",19,13511,-1) 0^17 "KRN",19,13511,0) EDPS BOARD CONTEXT^ED Tracking Board Context^^B^^^^^^^^ "KRN",19,13511,"RPC",0) ^19.05P^1^1 "KRN",19,13511,"RPC",1,0) EDPCBRD RPC "KRN",19,13511,"U") ED TRACKING BOARD CONTEXT "KRN",19,13512,-1) 0^16 "KRN",19,13512,0) EDP CONVERSION^Convert local ER data to EDIS files^^R^^^^^^^^EMERGENCY DEPARTMENT "KRN",19,13512,1,0) ^^6^6^3080305^ "KRN",19,13512,1,1,0) This option allows a site to trigger the conversion of its local data in "KRN",19,13512,1,2,0) ^DIZ(1720xx) files to the new Emergency Department Information System "KRN",19,13512,1,3,0) files. Local configuration data will be transferred first, followed by "KRN",19,13512,1,4,0) all currently open visits; a task will also be queued to copy closed "KRN",19,13512,1,5,0) visits as well, to permit the reporting features to continue functioning "KRN",19,13512,1,6,0) normally. "KRN",19,13512,25) EDPFMOVE "KRN",19,13512,"U") CONVERT LOCAL ER DATA TO EDIS "KRN",19,13514,-1) 0^18 "KRN",19,13514,0) EDPF BIGBOARD KIOSKS^Display Board Kiosks^^A^^EDPF KIOSKS^^^^^^EMERGENCY DEPARTMENT^^1 "KRN",19,13514,1,0) ^^2^2^3090224^ "KRN",19,13514,1,1,0) This option allows editing the EDPF BIGBOARD KIOSKS parameter; editing "KRN",19,13514,1,2,0) these values via the XPAR utilities is prohibited. "KRN",19,13514,20) D EN^EDPBKS "KRN",19,13514,"U") DISPLAY BOARD KIOSKS "KRN",19.1,594,-1) 0^1 "KRN",19.1,594,0) EDPR EXPORT^Allows CSV Export of Report "KRN",19.1,594,1,0) ^^2^2^3071221^ "KRN",19.1,594,1,1,0) Allows export of report using tab delimited values for use in Excel and "KRN",19.1,594,1,2,0) other products. "KRN",19.1,595,-1) 0^2 "KRN",19.1,595,0) EDPR PROVIDER^Allow Provider Report "KRN",19.1,595,1,0) ^^2^2^3071221^ "KRN",19.1,595,1,1,0) Allows access to the provider report in the reports menu for the ED "KRN",19.1,595,1,2,0) package. "KRN",19.1,596,-1) 0^3 "KRN",19.1,596,0) EDPR XREF^Allow Pt Xref Report "KRN",19.1,596,1,0) ^^2^2^3071221^ "KRN",19.1,596,1,1,0) Allows use of the patient cross reference report in the list of reports "KRN",19.1,596,1,2,0) for the emergency department. "KRN",19.1,597,-1) 0^4 "KRN",19.1,597,0) EDPF KIOSKS "KRN",19.1,597,1,0) ^19.11^2^2^3090817^^ "KRN",19.1,597,1,1,0) This key grants access to access to the EDPF BIGBOARD KIOSKS option to "KRN",19.1,597,1,2,0) edit the values for the parameter of the same name. "KRN",101,1302,-1) 2^9 "KRN",101,1302,0) SDAM APPOINTMENT EVENTS^Appointment Event Driver^^X^10000000179^^^^^^^16 "KRN",101,1302,10,0) ^101.01PA^20^20 "KRN",101,1302,10,20,0) 5601^^^ "KRN",101,1302,10,20,"^") EDP CHECK-IN "KRN",101,2690,-1) 2^8 "KRN",101,2690,0) RA EVSEND OR^Radiology event sent to OE/RR^^X^10000000179^^^^^^^31 "KRN",101,2690,10,0) ^101.01PA^4^4 "KRN",101,2690,10,4,0) 5600^^^ "KRN",101,2690,10,4,"^") EDP MONITOR "KRN",101,3336,-1) 2^5 "KRN",101,3336,0) LR7O CH EVSEND OR^LAB => OE/RR ORDER MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3336,10,0) ^101.01PA^4^4 "KRN",101,3336,10,4,0) 5600^^^ "KRN",101,3336,10,4,"^") EDP MONITOR "KRN",101,3373,-1) 2^7 "KRN",101,3373,0) PS EVSEND OR^Send Pharmacy orders to CPRS.^^X^10000000179^^^^^^^18 "KRN",101,3373,10,0) ^101.01PA^6^6 "KRN",101,3373,10,6,0) 5600^^^ "KRN",101,3373,10,6,"^") EDP MONITOR "KRN",101,3392,-1) 2^4 "KRN",101,3392,0) GMRC EVSEND OR^Consults event sent to OE/RR^^X^10000000179^^^^^^^294 "KRN",101,3392,10,0) ^101.01PA^5^5 "KRN",101,3392,10,5,0) 5600^^^ "KRN",101,3392,10,5,"^") EDP MONITOR "KRN",101,3411,-1) 2^3 "KRN",101,3411,0) FH EVSEND OR^FH --> OR event messages^^X^10000000179^^^^^^^ "KRN",101,3411,10,0) ^101.01PA^3^3 "KRN",101,3411,10,3,0) 5600^^^ "KRN",101,3411,10,3,"^") EDP MONITOR "KRN",101,3529,-1) 2^15 "KRN",101,3529,0) OR EVSEND RA^OE/RR => RAD/NM MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3529,10,0) ^101.01PA^3^3 "KRN",101,3529,10,3,0) 5602^^^ "KRN",101,3529,10,3,"^") EDP OR MONITOR "KRN",101,3530,-1) 2^13 "KRN",101,3530,0) OR EVSEND LRCH^OE/RR => LAB MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3530,10,0) ^101.01PA^3^3 "KRN",101,3530,10,3,0) 5602^^^ "KRN",101,3530,10,3,"^") EDP OR MONITOR "KRN",101,3535,-1) 2^11 "KRN",101,3535,0) OR EVSEND FH^OE/RR => DIET MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3535,10,0) ^101.01PA^3^3 "KRN",101,3535,10,3,0) 5602^^^ "KRN",101,3535,10,3,"^") EDP OR MONITOR "KRN",101,3536,-1) 2^6 "KRN",101,3536,0) OR EVSEND ORG^OE/RR => GENERIC MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3536,10,0) ^101.01PA^3^3 "KRN",101,3536,10,3,0) 5600^^^ "KRN",101,3536,10,3,"^") EDP MONITOR "KRN",101,3537,-1) 2^14 "KRN",101,3537,0) OR EVSEND PS^OE/RR => PHARMACY MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3537,10,0) ^101.01PA^3^3 "KRN",101,3537,10,3,0) 5602^^^ "KRN",101,3537,10,3,"^") EDP OR MONITOR "KRN",101,3539,-1) 2^12 "KRN",101,3539,0) OR EVSEND GMRC^OE/RR => CONSULTS MESSAGE EVENT^^X^10000000179^^^^^^^ "KRN",101,3539,10,0) ^101.01PA^4^4 "KRN",101,3539,10,4,0) 5602^^^ "KRN",101,3539,10,4,"^") EDP OR MONITOR "KRN",101,5600,-1) 0^2 "KRN",101,5600,0) EDP MONITOR^Monitor order messages for EDP Log^^A^^^^^^^^ "KRN",101,5600,1,0) ^^4^4^3080612^ "KRN",101,5600,1,1,0) This protocol monitors ordering events for the Emergency Department "KRN",101,5600,1,2,0) tracking board. It is placed on the * EVSEND OR protocols to check for "KRN",101,5600,1,3,0) updates being sent from ancillary packages to order entry; it monitors "KRN",101,5600,1,4,0) when orders are transmitted and when orders are completed. "KRN",101,5600,20) D EN^EDPFMON(.XQORMSG) "KRN",101,5600,99) 61619,57148 "KRN",101,5601,-1) 0^1 "KRN",101,5601,0) EDP CHECK-IN^Monitor for ED check-in^^A^^^^^^^^ "KRN",101,5601,1,0) ^101.06^3^3^3080321^^ "KRN",101,5601,1,1,0) This protocol will monitor Scheduling events for patients being checked-in "KRN",101,5601,1,2,0) to the Emergency Department. It is placed on the SDAM APPOINTMENT EVENTS "KRN",101,5601,1,3,0) protocol. "KRN",101,5601,20) D SDAM^EDPFMON "KRN",101,5601,99) 61619,57148 "KRN",101,5602,-1) 0^10 "KRN",101,5602,0) EDP OR MONITOR^Monitor order messages for EDP Log^^A^^^^^^^^ "KRN",101,5602,1,0) ^^3^3^3080612^ "KRN",101,5602,1,1,0) This protocol monitors ordering events for the Emergency Department "KRN",101,5602,1,2,0) tracking board. It is placed on the OR EVSEND * protocols to look for "KRN",101,5602,1,3,0) order numbers assigned to new orders placed from the ancillary packages. "KRN",101,5602,20) D ENOR^EDPFMON(.XQORMSG) "KRN",101,5602,99) 61619,57148 "KRN",101,5603,-1) 0^16 "KRN",101,5603,0) EDP NEW PATIENT^New EDIS Patient Event^^X^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5603,1,0) ^^13^13^3090126^ "KRN",101,5603,1,1,0) This extended action protocol will be processed when a new patient is "KRN",101,5603,1,2,0) added to the EDIS Patient Board. Items added to this event may look for: "KRN",101,5603,1,3,0) "KRN",101,5603,1,4,0) EDPDATA = ED Log ien ^ DFN ^ Time In ^ Hospital Location ien "KRN",101,5603,1,5,0) "KRN",101,5603,1,6,0) To support some devices that previously monitored SDAM APPOINTMENT EVENTS, "KRN",101,5603,1,7,0) the following variables will also be defined: "KRN",101,5603,1,8,0) "KRN",101,5603,1,9,0) DFN = Patient file #2 ien "KRN",101,5603,1,10,0) SDT = Time In "KRN",101,5603,1,11,0) SDCL = Hospital Location file #44 ien "KRN",101,5603,1,12,0) SDATA = ^DFN ^ SDT ^ SDCL "KRN",101,5603,1,13,0) SDAMEVT = 1 (unscheduled new visit) "KRN",101,5603,10,0) ^101.01PA "KRN",101,5603,99) 61619,57148 "KRN",101,5604,-1) 0^17 "KRN",101,5604,0) EDPF ADD BOARD^Add^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5604,1,0) ^^1^1^3090224^ "KRN",101,5604,1,1,0) This action adds a display board. "KRN",101,5604,20) D ADD^EDPBKS "KRN",101,5604,99) 61619,57148 "KRN",101,5605,-1) 0^24 "KRN",101,5605,0) EDPF REMOVE BOARD^Remove^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5605,1,0) ^^1^1^3090224^ "KRN",101,5605,1,1,0) This action removes a display board. "KRN",101,5605,20) D REM^EDPBKS "KRN",101,5605,99) 61619,57148 "KRN",101,5606,-1) 0^22 "KRN",101,5606,0) EDPF CHANGE BOARD^Change^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5606,1,0) ^^1^1^3090224^ "KRN",101,5606,1,1,0) This action can change a computer name or display board. "KRN",101,5606,20) D CHG^EDPBKS "KRN",101,5606,99) 61619,57148 "KRN",101,5607,-1) 0^25 "KRN",101,5607,0) EDPF SELECT DIVISION^Select Division^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5607,1,0) ^^1^1^3090224^ "KRN",101,5607,1,1,0) This action allows the editor to switch to values for another division. "KRN",101,5607,20) D NEWDIV^EDPBKS "KRN",101,5607,99) 61619,57148 "KRN",101,5608,-1) 0^18 "KRN",101,5608,0) EDPF BIGBOARD MENU^Board Kiosk parameter edit menu^^M^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5608,1,0) ^101.06^2^2^3090224^^ "KRN",101,5608,1,1,0) This is the menu of actions for the EDPF BIGBOARD KIOSK list template, "KRN",101,5608,1,2,0) which allows editing of the parameter of the same name. "KRN",101,5608,4) 26 "KRN",101,5608,10,0) ^101.01PA^8^8 "KRN",101,5608,10,1,0) 5604^^11^ "KRN",101,5608,10,1,"^") EDPF ADD BOARD "KRN",101,5608,10,2,0) 5605^^12^ "KRN",101,5608,10,2,"^") EDPF REMOVE BOARD "KRN",101,5608,10,3,0) 5606^^21^ "KRN",101,5608,10,3,"^") EDPF CHANGE BOARD "KRN",101,5608,10,4,0) 5607^^31^ "KRN",101,5608,10,4,"^") EDPF SELECT DIVISION "KRN",101,5608,10,5,0) 5612^^32^ "KRN",101,5608,10,5,"^") EDPF QUIT "KRN",101,5608,10,6,0) 5609^^22^ "KRN",101,5608,10,6,"^") EDPF BLANK 1 "KRN",101,5608,10,7,0) 5610^^13^ "KRN",101,5608,10,7,"^") EDPF BLANK 2 "KRN",101,5608,10,8,0) 5611^^23^ "KRN",101,5608,10,8,"^") EDPF BLANK 3 "KRN",101,5608,26) D SHOW^VALM "KRN",101,5608,28) Select action: "KRN",101,5608,99) 61619,57148 "KRN",101,5609,-1) 0^19 "KRN",101,5609,0) EDPF BLANK 1^ ^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5609,1,0) ^101.06^2^2^3090305^^^^ "KRN",101,5609,1,1,0) Displays a blank line; used for whitespace on menus. (Item text is 3 "KRN",101,5609,1,2,0) spaces.) "KRN",101,5609,2,0) ^101.02A^1^1 "KRN",101,5609,2,1,0) BLANK "KRN",101,5609,2,"B","BLANK",1) "KRN",101,5609,99) 61619,57148 "KRN",101,5610,-1) 0^20 "KRN",101,5610,0) EDPF BLANK 2^ ^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5610,1,0) ^101.06^2^2^3090305^^^^ "KRN",101,5610,1,1,0) Displays a blank line; used for whitespace on menus. (Item text is 3 "KRN",101,5610,1,2,0) spaces.) "KRN",101,5610,2,0) ^101.02A^1^1 "KRN",101,5610,2,1,0) BLANK "KRN",101,5610,2,"B","BLANK",1) "KRN",101,5610,99) 61619,57148 "KRN",101,5611,-1) 0^21 "KRN",101,5611,0) EDPF BLANK 3^ ^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5611,1,0) ^101.06^2^2^3090305^^^^ "KRN",101,5611,1,1,0) Displays a blank line; used for whitespace on menus. (Item text is 3 "KRN",101,5611,1,2,0) spaces.) "KRN",101,5611,2,0) ^101.02A^1^1 "KRN",101,5611,2,1,0) BLANK "KRN",101,5611,2,"B","BLANK",1) "KRN",101,5611,99) 61619,57148 "KRN",101,5612,-1) 0^23 "KRN",101,5612,0) EDPF QUIT^Quit^^A^^^^^^^^EMERGENCY DEPARTMENT "KRN",101,5612,1,0) ^^1^1^3090305^ "KRN",101,5612,1,1,0) This action exits the list template. "KRN",101,5612,2,0) ^101.02A^1^1 "KRN",101,5612,2,1,0) QUIT "KRN",101,5612,2,"B","QUIT",1) "KRN",101,5612,20) Q "KRN",101,5612,99) 61619,57148 "KRN",409.61,733,-1) 0^1 "KRN",409.61,733,0) EDPF BIGBOARD KIOSKS^1^^80^5^19^0^1^^EDPF BIGBOARD MENU^EDPF BIGBOARD KIOSKS^1^^0 "KRN",409.61,733,1) ^VALM HIDDEN ACTIONS "KRN",409.61,733,"ARRAY") EDPB "KRN",409.61,733,"COL",0) ^409.621^2^2 "KRN",409.61,733,"COL",1,0) NAME^5^40^Computer Name "KRN",409.61,733,"COL",2,0) VALUE^45^30^Display Board "KRN",409.61,733,"COL","B","NAME",1) "KRN",409.61,733,"COL","B","VALUE",2) "KRN",409.61,733,"FNL") D EXIT^EDPBKS "KRN",409.61,733,"HDR") D HDR^EDPBKS "KRN",409.61,733,"HLP") D HELP^EDPBKS "KRN",409.61,733,"INIT") D INIT^EDPBKS "KRN",8989.5,12668,0) 562;DIC(9.4,^EDPF SCREEN SIZES^10 "KRN",8989.5,12668,1) 640x480 "KRN",8989.5,12669,0) 562;DIC(9.4,^EDPF SCREEN SIZES^20 "KRN",8989.5,12669,1) 800x600 "KRN",8989.5,12670,0) 562;DIC(9.4,^EDPF SCREEN SIZES^30 "KRN",8989.5,12670,1) 1024x768 "KRN",8989.5,12671,0) 562;DIC(9.4,^EDPF SCREEN SIZES^50 "KRN",8989.5,12671,1) 1280x1024 "KRN",8989.5,12672,0) 562;DIC(9.4,^EDPF SCREEN SIZES^40 "KRN",8989.5,12672,1) 1280x800 "KRN",8989.5,12673,0) 562;DIC(9.4,^EDPF NURSE STAFF SCREEN^1 "KRN",8989.5,12673,1) 3 "KRN",8989.5,12675,0) 562;DIC(9.4,^EDPF SCHEDULING TRIGGER^1 "KRN",8989.5,12675,1) 4 "KRN",8989.51,510,-1) 0^1 "KRN",8989.51,510,0) EDPF LOCATION^Location(s) for Emergency Department^1^Time Range (ex. 0800-1200) or Sequence^Emergency Department Location "KRN",8989.51,510,1) P^44^Enter a HOSPITAL LOCATION used by the Emergency Department. "KRN",8989.51,510,3) I $P(^(0),U,3)'="W" "KRN",8989.51,510,6) F^^Enter a time range (like 0800-1200) or a sequential number. "KRN",8989.51,510,7) I '((X?1.3N)!(X?4N1"-"4N)) K X "KRN",8989.51,510,20,0) ^^18^18^3080506^ "KRN",8989.51,510,20,1,0) This parameter lists the entry or entries from the Hospital Location "KRN",8989.51,510,20,2,0) file (#44) that are used by the Emergency Department. If there are "KRN",8989.51,510,20,3,0) multiple Hospital Location file entries for the Emergency Department "KRN",8989.51,510,20,4,0) there are two choices when prompted for "Time Range or Sequence": "KRN",8989.51,510,20,5,0) "KRN",8989.51,510,20,6,0) Time Range allows you to map Hospital Location entries by time of day. "KRN",8989.51,510,20,7,0) When creating an encounter in PCE, EDIS will match the Hospital Location "KRN",8989.51,510,20,8,0) based on the current time of day. You may enter the time range in "KRN",8989.51,510,20,9,0) military time. For example, 0800-1600 or 1800-2400 would be two possible "KRN",8989.51,510,20,10,0) time range entries. "KRN",8989.51,510,20,11,0) "KRN",8989.51,510,20,12,0) Sequence allows you to map Hospital Location entries in a preferred "KRN",8989.51,510,20,13,0) order. When creating an encounter in PCE, EDIS will use the entry with "KRN",8989.51,510,20,14,0) the lowest sequence number to create the visit. "KRN",8989.51,510,20,15,0) "KRN",8989.51,510,20,16,0) When creating the encounter by using the scheduling package to check-in, "KRN",8989.51,510,20,17,0) any matches to the list (whether time range or sequence based) will cause "KRN",8989.51,510,20,18,0) the checked-in patient to be added to the display board. "KRN",8989.51,510,30,0) ^8989.513I^2^1 "KRN",8989.51,510,30,2,0) 2^4 "KRN",8989.51,512,-1) 0^2 "KRN",8989.51,512,0) EDPF SCREEN SIZES^Available Screen Sizes^1^Sequence^Screen Size (WIDTHxHEIGHT) "KRN",8989.51,512,1) F^^Enter the width by height of the screen size (640x480, for example). "KRN",8989.51,512,2) S X=$TR(X,"X","x") I '(X?1.5N1"x"1.5N) K X "KRN",8989.51,512,6) N^1:999^Enter a number, 1-999 as the sequence for this screen size. "KRN",8989.51,512,20,0) ^8989.512^3^3^3080502^^ "KRN",8989.51,512,20,1,0) This list contains the screen sizes that are selectable for the EDIS "KRN",8989.51,512,20,2,0) display board. It generally lists the sizes of LCD or Plasma screens "KRN",8989.51,512,20,3,0) that may be used for the large display. "KRN",8989.51,512,30,0) ^8989.513I^3^3 "KRN",8989.51,512,30,1,0) 10^9.4 "KRN",8989.51,512,30,2,0) 7^4.2 "KRN",8989.51,512,30,3,0) 5^4 "KRN",8989.51,513,-1) 0^3 "KRN",8989.51,513,0) EDPF NURSE STAFF SCREEN^Nursing Staff Screen for EDIS^0^^Allow Persons "KRN",8989.51,513,1) S^0:Active in NURS STAFF (210);1:Hold ORELSE Key;2:Hold PSJ RNURSE Key;3:All Persons (No Screen)^Enter the type of screen that should be applied to the NEW PERSON file. "KRN",8989.51,513,20,0) ^^9^9^3090602^ "KRN",8989.51,513,20,1,0) This allows a site to select which type of filtering, or screening, that "KRN",8989.51,513,20,2,0) should be applied to the New Person file (200) when selecting nurses in "KRN",8989.51,513,20,3,0) EDIS. The default is to allow all entries in the NEW PERSON file. The "KRN",8989.51,513,20,4,0) options are: "KRN",8989.51,513,20,5,0) "KRN",8989.51,513,20,6,0) 0: Allow only persons present and active in the NURS STAFF file (210). "KRN",8989.51,513,20,7,0) 1: Allow only persons holding the ORELSE key. "KRN",8989.51,513,20,8,0) 2: Allow only persons holding the PSJ RNURSE key. "KRN",8989.51,513,20,9,0) 3: Allow selection from all entries in the NEW PERSON file (200). "KRN",8989.51,513,30,0) ^8989.513I^3^3 "KRN",8989.51,513,30,1,0) 10^9.4 "KRN",8989.51,513,30,2,0) 5^4.2 "KRN",8989.51,513,30,3,0) 3^4 "KRN",8989.51,514,-1) 0^4 "KRN",8989.51,514,0) EDPF DEBUG START TIME^Debug Log Timestamp^0^^Start Time ($H Format) "KRN",8989.51,514,1) F^7:11^Enter the start time for 30 minutes of logging in $H format. "KRN",8989.51,514,2) K:X'?1.5N1","1.5N X "KRN",8989.51,514,20,0) ^^2^2^3080910^ "KRN",8989.51,514,20,1,0) This sets a $H timestamp to signal that EDIS RPC's should be logged for "KRN",8989.51,514,20,2,0) the 30 minutes following the timestamp. "KRN",8989.51,514,30,0) ^8989.513I^1^1 "KRN",8989.51,514,30,1,0) 10^4.2 "KRN",8989.51,515,-1) 0^5 "KRN",8989.51,515,0) EDPF SCHEDULING TRIGGER^Scheduling Trigger for EDIS^0^^Trigger Addition to Board On "KRN",8989.51,515,1) S^1:Make Appointment;4:Check-in;D:Disable^Enter which scheduling event should add the patient to the board or Disable. "KRN",8989.51,515,20,0) ^^8^8^3090911^ "KRN",8989.51,515,20,1,0) This allows a site to select which scheduling event should trigger an "KRN",8989.51,515,20,2,0) automatic addition of the patient to the board. "KRN",8989.51,515,20,3,0) "KRN",8989.51,515,20,4,0) 1: Patient will be added to the board when an appointment is made "KRN",8989.51,515,20,5,0) 4: Patient will be added to the board when checked-in "KRN",8989.51,515,20,6,0) "KRN",8989.51,515,20,7,0) D: Disable automatic adding of the patient to the board via appointment "KRN",8989.51,515,20,8,0) management "KRN",8989.51,515,30,0) ^8989.513I^3^3 "KRN",8989.51,515,30,1,0) 10^9.4 "KRN",8989.51,515,30,2,0) 5^4.2 "KRN",8989.51,515,30,3,0) 3^4 "KRN",8989.51,516,-1) 0^6 "KRN",8989.51,516,0) EDPF BIGBOARD KIOSKS^Display Board Kiosk^1^Computer Name^Display Board Name^ "KRN",8989.51,516,1) F^^Enter the name of the display board for this kiosk. "KRN",8989.51,516,2) "KRN",8989.51,516,6) F^^Use the EDPF BIGBOARD KIOSKS option to edit this parameter! "KRN",8989.51,516,7) K:'$G(EDPSITE) X "KRN",8989.51,516,20,0) ^8989.512^3^3^3090224^^^^ "KRN",8989.51,516,20,1,0) This parameter maps fully qualified computer names to the display board "KRN",8989.51,516,20,2,0) that they should show. Values must be added or changed via the option "KRN",8989.51,516,20,3,0) EDPF BIGBOARD KIOSKS. "KRN",8989.51,516,30,0) ^8989.513I^1^1 "KRN",8989.51,516,30,1,0) 2^4 "KRN",8994,2518,-1) 0^2 "KRN",8994,2518,0) EDPCTRL RPC^RPC^EDPCTRL^2^R^^^^1^^0 "KRN",8994,2518,1,0) ^^5^5^3080307^ "KRN",8994,2518,1,1,0) This RPC acts as the "front controller" for the EDIS Tracking Application. "KRN",8994,2518,1,2,0) It accepts requests that are initially passed into a web server. The RPC "KRN",8994,2518,1,3,0) uses the parameters that are passed in to determine which command to "KRN",8994,2518,1,4,0) execute. The returned data is formatted as XML. The XML structure varies "KRN",8994,2518,1,5,0) based a what data were requested. "KRN",8994,2518,2,0) ^8994.02A^1^1 "KRN",8994,2518,2,1,0) PARAMS^2^^1^1 "KRN",8994,2518,2,1,1,0) ^^2^2^3080307^ "KRN",8994,2518,2,1,1,1,0) This is a list of parameters that were passed to the Java middle tier via "KRN",8994,2518,2,1,1,2,0) an HTTP Post message. "KRN",8994,2518,2,"B","PARAMS",1) "KRN",8994,2518,2,"B","REQ",1) "KRN",8994,2518,2,"PARAMSEQ",1,1) "KRN",8994,2518,3,0) ^^1^1^3080307^ "KRN",8994,2518,3,1,0) The return results are formatted as an XML document. "KRN",8994,2519,-1) 0^1 "KRN",8994,2519,0) EDPCBRD RPC^RPC^EDPCBRD^2^R^^^^^^1 "KRN",8994,2519,1,0) ^^8^8^3080307^ "KRN",8994,2519,1,1,0) This RPC acts as the "front controller" for the EDIS Display Board. It "KRN",8994,2519,1,2,0) accepts requests that are initially passed into a web server. The RPC "KRN",8994,2519,1,3,0) uses the parameters that are passed in to determine which command to "KRN",8994,2519,1,4,0) execute. The returned data is formatted as XML. The XML structure "KRN",8994,2519,1,5,0) varies based a what data were requested. "KRN",8994,2519,1,6,0) "KRN",8994,2519,1,7,0) Since the Display Board runs in a "kiosk" mode, this RPC allows proxy "KRN",8994,2519,1,8,0) user access. "KRN",8994,2519,2,0) ^8994.02A^2^2 "KRN",8994,2519,2,1,0) SESS^1^^1^1 "KRN",8994,2519,2,1,1,0) ^^3^3^3080307^ "KRN",8994,2519,2,1,1,1,0) This identifies the user and site that are passed in from the Java middle "KRN",8994,2519,2,1,1,2,0) tier. In cases when the display board is running with a proxy user (in "KRN",8994,2519,2,1,1,3,0) kiosk mode), the SSL configuration will determine the user and site. "KRN",8994,2519,2,2,0) PARAMS^2^^^2 "KRN",8994,2519,2,2,1,0) ^^2^2^3080307^ "KRN",8994,2519,2,2,1,1,0) This is a list of parameters that were passed to the Java middle tier via "KRN",8994,2519,2,2,1,2,0) an HTTP Post message. "KRN",8994,2519,2,"B","PARAMS",2) "KRN",8994,2519,2,"B","SESS",1) "KRN",8994,2519,2,"PARAMSEQ",1,1) "KRN",8994,2519,2,"PARAMSEQ",2,2) "KRN",8994,2519,3,0) ^^1^1^3080307^ "KRN",8994,2519,3,1,0) The return results are formatted as an XML document. "MBREQ") 0 "ORD",3,19.1) 19.1;3;1;;KEY^XPDTA1;;;KEYF2^XPDIA1;;KEYDEL^XPDIA1 "ORD",3,19.1,0) SECURITY KEY "ORD",15,101) 101;15;;;PRO^XPDTA;PROF1^XPDIA;PROE1^XPDIA;PROF2^XPDIA;;PRODEL^XPDIA "ORD",15,101,0) PROTOCOL "ORD",16,8994) 8994;16;1;;;;;;;RPCDEL^XPDIA1 "ORD",16,8994,0) REMOTE PROCEDURE "ORD",17,409.61) 409.61;17;1;;;;;;;LMDEL^XPDIA1 "ORD",17,409.61,0) LIST TEMPLATE "ORD",18,19) 19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA "ORD",18,19,0) OPTION "ORD",20,8989.51) 8989.51;20;;;PAR1E1^XPDTA2;PAR1F1^XPDIA3;PAR1E1^XPDIA3;PAR1F2^XPDIA3;;PAR1DEL^XPDIA3(%) "ORD",20,8989.51,0) PARAMETER DEFINITION "PGL",233.1,0,4,.04) NATIONAL CODE^P233.1'^EDPB(233.1,^0;4^Q "PGL",233.21,0,2,.02) CODE^P233.1'^EDPB(233.1,^0;2^Q "PKG",562,-1) 1^1 "PKG",562,0) EMERGENCY DEPARTMENT^EDP^Emergency Department Information System "PKG",562,1,0) ^^1^1^3080111^ "PKG",562,1,1,0) This is the Emergency Department Information System (EDIS). "PKG",562,20,0) ^9.402P^^ "PKG",562,22,0) ^9.49I^1^1 "PKG",562,22,1,0) 1.0^3100902^3090915^10000000179 "PKG",562,22,1,1,0) ^^4^4^3100902 "PKG",562,22,1,1,1,0) This is the initial installation of the Emergency Department Information "PKG",562,22,1,1,2,0) System (EDIS). This is the module that handles tracking of a patient "PKG",562,22,1,1,3,0) through an emergency department visit. The user interface for this "PKG",562,22,1,1,4,0) application is a web application. "PKG",562,"VERSION") 1.0 "QUES","XPF1",0) Y "QUES","XPF1","??") ^D REP^XPDH "QUES","XPF1","A") Shall I write over your |FLAG| File "QUES","XPF1","B") YES "QUES","XPF1","M") D XPF1^XPDIQ "QUES","XPF2",0) Y "QUES","XPF2","??") ^D DTA^XPDH "QUES","XPF2","A") Want my data |FLAG| yours "QUES","XPF2","B") YES "QUES","XPF2","M") D XPF2^XPDIQ "QUES","XPI1",0) YO "QUES","XPI1","??") ^D INHIBIT^XPDH "QUES","XPI1","A") Want KIDS to INHIBIT LOGONs during the install "QUES","XPI1","B") YES "QUES","XPI1","M") D XPI1^XPDIQ "QUES","XPM1",0) PO^VA(200,:EM "QUES","XPM1","??") ^D MG^XPDH "QUES","XPM1","A") Enter the Coordinator for Mail Group '|FLAG|' "QUES","XPM1","B") "QUES","XPM1","M") D XPM1^XPDIQ "QUES","XPO1",0) Y "QUES","XPO1","??") ^D MENU^XPDH "QUES","XPO1","A") Want KIDS to Rebuild Menu Trees Upon Completion of Install "QUES","XPO1","B") YES "QUES","XPO1","M") D XPO1^XPDIQ "QUES","XPZ1",0) Y "QUES","XPZ1","??") ^D OPT^XPDH "QUES","XPZ1","A") Want to DISABLE Scheduled Options, Menu Options, and Protocols "QUES","XPZ1","B") YES "QUES","XPZ1","M") D XPZ1^XPDIQ "QUES","XPZ2",0) Y "QUES","XPZ2","??") ^D RTN^XPDH "QUES","XPZ2","A") Want to MOVE routines to other CPUs "QUES","XPZ2","B") NO "QUES","XPZ2","M") D XPZ2^XPDIQ "RTN") 55 "RTN","EDPBCF") 0^25^B25096927 "RTN","EDPBCF",1,0) EDPBCF ;SLC/KCM - Display Board Configuration "RTN","EDPBCF",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBCF",3,0) ; "RTN","EDPBCF",4,0) LOAD(AREA) ; Load General Configuration for an Area "RTN","EDPBCF",5,0) N I,NODE "RTN","EDPBCF",6,0) ; "RTN","EDPBCF",7,0) D XML^EDPX("") "RTN","EDPBCF",8,0) D COLORS^EDPBCM "RTN","EDPBCF",9,0) D XML^EDPX("") "RTN","EDPBCF",10,0) D LOAD^EDPBCM(AREA) ; load the color spec "RTN","EDPBCF",11,0) ; "RTN","EDPBCF",12,0) D LOAD^EDPBRM(AREA) ; load rooms/beds "RTN","EDPBCF",13,0) D DFLTRM^EDPBRM(AREA) ; load multi rooms "RTN","EDPBCF",14,0) ; "RTN","EDPBCF",15,0) D LOAD^EDPBPM(AREA) ; load parameters "RTN","EDPBCF",16,0) ; "RTN","EDPBCF",17,0) D XML^EDPX("") ; load available columns "RTN","EDPBCF",18,0) F I=1:1 S NODE=$P($T(COLUMNS+I),";",3,99) Q:$E(NODE,1,5)="zzzzz" D "RTN","EDPBCF",19,0) . N X "RTN","EDPBCF",20,0) . S X("label")=$P(NODE,U) "RTN","EDPBCF",21,0) . S X("att")=$P(NODE,U,2) "RTN","EDPBCF",22,0) . S X("header")=$P(NODE,U,3) "RTN","EDPBCF",23,0) . S X("width")=50 "RTN","EDPBCF",24,0) . D XML^EDPX($$XMLA^EDPX("col",.X)) "RTN","EDPBCF",25,0) D XML^EDPX("") "RTN","EDPBCF",26,0) ; "RTN","EDPBCF",27,0) D CHOICES^EDPBRM ; load 'display when' choices "RTN","EDPBCF",28,0) ; "RTN","EDPBCF",29,0) N EDPSCRNS D GETLST^XPAR(.EDPSCRNS,"ALL","EDPF SCREEN SIZES","I") "RTN","EDPBCF",30,0) D XML^EDPX("") "RTN","EDPBCF",31,0) S I=0 F S I=$O(EDPSCRNS(I)) Q:'I D "RTN","EDPBCF",32,0) . S EDPSCRNS(I)=$TR(EDPSCRNS(I),"X","x") "RTN","EDPBCF",33,0) . N X "RTN","EDPBCF",34,0) . S X("label")=EDPSCRNS(I) "RTN","EDPBCF",35,0) . S X("width")=$P(EDPSCRNS(I),"x") "RTN","EDPBCF",36,0) . S X("height")=$P(EDPSCRNS(I),"x",2) "RTN","EDPBCF",37,0) . D XML^EDPX($$XMLA^EDPX("size",.X)) "RTN","EDPBCF",38,0) D XML^EDPX("") "RTN","EDPBCF",39,0) Q "RTN","EDPBCF",40,0) LOADBRD(AREA,IEN) ; Load Named Board Spec "RTN","EDPBCF",41,0) N I,X,TOKEN "RTN","EDPBCF",42,0) S:'IEN IEN=$O(^EDPB(231.9,AREA,4,0)) Q:'IEN "RTN","EDPBCF",43,0) ; "RTN","EDPBCF",44,0) D READL^EDPBLK(AREA,"board",.TOKEN) ; read lock the board config "RTN","EDPBCF",45,0) D XML^EDPX(""_TOKEN_"") "RTN","EDPBCF",46,0) D BRDLST(AREA) "RTN","EDPBCF",47,0) S X("boardID")=IEN,X("boardName")=$P(^EDPB(231.9,AREA,4,IEN,0),U) "RTN","EDPBCF",48,0) D XML^EDPX($$XMLA^EDPX("spec",.X,"")) "RTN","EDPBCF",49,0) S I=0 F S I=$O(^EDPB(231.9,AREA,4,IEN,1,I)) Q:'I D "RTN","EDPBCF",50,0) . D XML^EDPX(^EDPB(231.9,AREA,4,IEN,1,I,0)) "RTN","EDPBCF",51,0) D XML^EDPX("") "RTN","EDPBCF",52,0) D READU^EDPBLK(AREA,"board",.TOKEN) ; read unlock the board config "RTN","EDPBCF",53,0) Q "RTN","EDPBCF",54,0) BRDLST(AREA) ; List of boards "RTN","EDPBCF",55,0) N I,X "RTN","EDPBCF",56,0) D XML^EDPX("") "RTN","EDPBCF",57,0) S I=0 F S I=$O(^EDPB(231.9,AREA,4,I)) Q:'I D "RTN","EDPBCF",58,0) . S X=$P(^EDPB(231.9,AREA,4,I,0),U) "RTN","EDPBCF",59,0) . D XML^EDPX($$XMLS^EDPX("board",I,X)) "RTN","EDPBCF",60,0) D XML^EDPX("") "RTN","EDPBCF",61,0) Q "RTN","EDPBCF",62,0) SAVEBRD(REQ) ; Save Configuration "RTN","EDPBCF",63,0) N X,AREA,DFLTNM "RTN","EDPBCF",64,0) S X="col-",AREA=$G(REQ("area",1)),DFLTNM="Main (default)" "RTN","EDPBCF",65,0) I 'AREA D SAVERR^EDPX("fail","Missing area") Q "RTN","EDPBCF",66,0) ; "RTN","EDPBCF",67,0) N NAME,IEN,WP,MSG "RTN","EDPBCF",68,0) S NAME=$G(REQ("boardName",1)),IEN=+$G(REQ("boardID",1)) "RTN","EDPBCF",69,0) I (IEN>0),($P(^EDPB(231.9,AREA,4,IEN,0),U)=DFLTNM),(NAME'=DFLTNM) D Q "RTN","EDPBCF",70,0) . D SAVERR^EDPX("fail","Default name may not be changed.") "RTN","EDPBCF",71,0) I NAME="" D Q "RTN","EDPBCF",72,0) . D SAVERR^EDPX("fail","Missing name") "RTN","EDPBCF",73,0) I (IEN=0),$O(^EDPB(231.9,AREA,4,"B",NAME,0)) D Q "RTN","EDPBCF",74,0) . D SAVERR^EDPX("fail","Board name must be unique") "RTN","EDPBCF",75,0) ; "RTN","EDPBCF",76,0) ; save XML spec as word processing "RTN","EDPBCF",77,0) N TOKEN,LOCKERR "RTN","EDPBCF",78,0) S TOKEN=$G(REQ("boardToken",1)) "RTN","EDPBCF",79,0) D SAVEL^EDPBLK(AREA,"board",.TOKEN,.LOCKERR) ; save board config -- LOCK "RTN","EDPBCF",80,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOADBRD(AREA,IEN) Q "RTN","EDPBCF",81,0) ; "RTN","EDPBCF",82,0) F S X=$O(REQ(X)) Q:$E(X,1,4)'="col-" S WP(+$P(X,"-",2))=REQ(X,1) "RTN","EDPBCF",83,0) D UPDBRD(AREA,.IEN,NAME,.WP,.MSG) "RTN","EDPBCF",84,0) D SAVEU^EDPBLK(AREA,"board",.TOKEN) ; save board config -- UNLOCK "RTN","EDPBCF",85,0) ; "RTN","EDPBCF",86,0) I $L(MSG) D SAVERR^EDPX("fail",MSG) Q "RTN","EDPBCF",87,0) D UPDLAST(AREA) ; update last config save date "RTN","EDPBCF",88,0) ; "RTN","EDPBCF",89,0) D XML^EDPX("") "RTN","EDPBCF",90,0) D LOADBRD(AREA,+IEN) "RTN","EDPBCF",91,0) Q "RTN","EDPBCF",92,0) UPDLAST(AREA) ; update last config save date "RTN","EDPBCF",93,0) N FDA,FDAIEN,DIERR "RTN","EDPBCF",94,0) S FDA(231.9,AREA_",",.03)=$$NOW^XLFDT "RTN","EDPBCF",95,0) D FILE^DIE("","FDA","ERR") "RTN","EDPBCF",96,0) D CLEAN^DILF "RTN","EDPBCF",97,0) Q "RTN","EDPBCF",98,0) UPDBRD(AREA,EDPIEN,NAME,SPEC,MSG) ; Add/Update a Spec "RTN","EDPBCF",99,0) S MSG="" "RTN","EDPBCF",100,0) S:'EDPIEN EDPIEN="+1" S EDPIEN=EDPIEN_","_AREA_"," "RTN","EDPBCF",101,0) ; "RTN","EDPBCF",102,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBCF",103,0) S FDA(231.94,EDPIEN,.01)=NAME "RTN","EDPBCF",104,0) I $E(EDPIEN,1,2)="+1" D "RTN","EDPBCF",105,0) . D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBCF",106,0) E D "RTN","EDPBCF",107,0) . D FILE^DIE("","FDA","ERR") "RTN","EDPBCF",108,0) I $D(DIERR) S MSG="save board name failed: "_$G(EDPIEN) "RTN","EDPBCF",109,0) I '$D(DIERR) D "RTN","EDPBCF",110,0) . I $E(EDPIEN,1,2)="+1" S EDPIEN=+FDAIEN(1)_","_AREA_"," "RTN","EDPBCF",111,0) . D WP^DIE(231.94,EDPIEN,1,"","SPEC") "RTN","EDPBCF",112,0) . I $D(DIERR) S MSG="save board spec failed: "_$G(EDPIEN) "RTN","EDPBCF",113,0) D CLEAN^DILF "RTN","EDPBCF",114,0) Q "RTN","EDPBCF",115,0) COLUMNS ;; Available Columns "RTN","EDPBCF",116,0) ;;Room / Bed^@bedNm^Room "RTN","EDPBCF",117,0) ;;Patient Name^@ptNm^Patient "RTN","EDPBCF",118,0) ;;Patient X9999^@last4^Patient "RTN","EDPBCF",119,0) ;;Visit Created^@visit^Visit "RTN","EDPBCF",120,0) ;;Clinic^@clinicNm^Clinic "RTN","EDPBCF",121,0) ;;Complaint^@complaint^Complaint "RTN","EDPBCF",122,0) ;;Comment^@comment^Comment "RTN","EDPBCF",123,0) ;;Provider Initials^@mdNm^Prv "RTN","EDPBCF",124,0) ;;Resident Initials^@resNm^Res "RTN","EDPBCF",125,0) ;;Nurse Initials^@rnNm^RN "RTN","EDPBCF",126,0) ;;Acuity^@acuityNm^Acuity "RTN","EDPBCF",127,0) ;;Status^@statusNm^Status "RTN","EDPBCF",128,0) ;;Lab Active/Complete^@lab^L "RTN","EDPBCF",129,0) ;;Imaging Active/Complete^@rad^I "RTN","EDPBCF",130,0) ;;New (Unverified) Orders^@ordNew^New "RTN","EDPBCF",131,0) ;;Total Minutes^@emins^E Mins "RTN","EDPBCF",132,0) ;;Minutes at Location^@lmins^Mins "RTN","EDPBCF",133,0) ;;zzzzz "RTN","EDPBCM") 0^26^B17076528 "RTN","EDPBCM",1,0) EDPBCM ;SLC/KCM - Available color maps "RTN","EDPBCM",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBCM",3,0) ; "RTN","EDPBCM",4,0) LOAD(AREA) ; Load Color Spec "RTN","EDPBCM",5,0) N I,TOKEN "RTN","EDPBCM",6,0) ; "RTN","EDPBCM",7,0) D READL^EDPBLK(AREA,"color",.TOKEN) ; read color config -- LOCK "RTN","EDPBCM",8,0) D XML^EDPX(""_TOKEN_"") "RTN","EDPBCM",9,0) D XML^EDPX("") "RTN","EDPBCM",10,0) S I=0 F S I=$O(^EDPB(231.9,AREA,3,I)) Q:'I D "RTN","EDPBCM",11,0) . D XML^EDPX(^EDPB(231.9,AREA,3,I,0)) "RTN","EDPBCM",12,0) D XML^EDPX("") "RTN","EDPBCM",13,0) D READU^EDPBLK(AREA,"color",.TOKEN) ; read color config -- UNLOCK "RTN","EDPBCM",14,0) Q "RTN","EDPBCM",15,0) SAVE(REQ) ; Save Configuration "RTN","EDPBCM",16,0) N X,WP,AREA,TOKEN,LOCKERR "RTN","EDPBCM",17,0) S X="xml-",AREA=$G(REQ("area",1)) "RTN","EDPBCM",18,0) I 'AREA D SAVERR^EDPX("fail","Missing area") Q "RTN","EDPBCM",19,0) ; "RTN","EDPBCM",20,0) S TOKEN=$G(REQ("colorToken",1)) "RTN","EDPBCM",21,0) D SAVEL^EDPBLK(AREA,"color",.TOKEN,.LOCKERR) ; save color config -- LOCK "RTN","EDPBCM",22,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA) Q "RTN","EDPBCM",23,0) ; "RTN","EDPBCM",24,0) F S X=$O(REQ(X)) Q:$E(X,1,4)'="xml-" S WP(+$P(X,"-",2))=REQ(X,1) "RTN","EDPBCM",25,0) D WP^DIE(231.9,AREA_",",3,"","WP") "RTN","EDPBCM",26,0) D SAVEU^EDPBLK(AREA,"color",.TOKEN) ; save color config -- UNLOCK "RTN","EDPBCM",27,0) ; "RTN","EDPBCM",28,0) I $D(DIERR) D SAVERR^EDPX("fail","save failed") Q "RTN","EDPBCM",29,0) D XML^EDPX("") "RTN","EDPBCM",30,0) D LOAD(AREA) ; return updated list of colors "RTN","EDPBCM",31,0) D UPDLAST^EDPBCF(AREA) ; update last config date "RTN","EDPBCM",32,0) Q "RTN","EDPBCM",33,0) COLORS ;; Available Color Maps "RTN","EDPBCM",34,0) D ENMAP("none"," ","none") ; for no selection "RTN","EDPBCM",35,0) ; "RTN","EDPBCM",36,0) D ENMAP("stsAcuity","Status / Acuity","val") "RTN","EDPBCM",37,0) D CODES("status"),CODES("acuity"),EXMAP "RTN","EDPBCM",38,0) ; "RTN","EDPBCM",39,0) D ENMAP("status","Status","val") "RTN","EDPBCM",40,0) D CODES("status"),EXMAP "RTN","EDPBCM",41,0) ; "RTN","EDPBCM",42,0) D ENMAP("acuity","Acuity","val") "RTN","EDPBCM",43,0) D CODES("acuity"),EXMAP "RTN","EDPBCM",44,0) ; "RTN","EDPBCM",45,0) D ENMAP("bed","Room / Bed","bed") "RTN","EDPBCM",46,0) D ENMAP("md","Provider","staff") "RTN","EDPBCM",47,0) D ENMAP("res","Resident","staff") "RTN","EDPBCM",48,0) D ENMAP("rn","Nurse","staff") "RTN","EDPBCM",49,0) ; "RTN","EDPBCM",50,0) D ENMAP("labUrg","Urgency - Lab","val") "RTN","EDPBCM",51,0) D URG("labUrg"),EXMAP "RTN","EDPBCM",52,0) ;D ENMAP("medUrg","Urgency - Medications","val") "RTN","EDPBCM",53,0) ;D URG("medUrg"),EXMAP "RTN","EDPBCM",54,0) D ENMAP("radUrg","Urgency - Radiology","val") "RTN","EDPBCM",55,0) D URG("radUrg"),EXMAP "RTN","EDPBCM",56,0) ; "RTN","EDPBCM",57,0) D ENMAP("emins","Total Elapsed Minutes","rng") "RTN","EDPBCM",58,0) D ENMAP("lmins","Minutes at Location","rng") "RTN","EDPBCM",59,0) D ENMAP("minLab","Minutes for Lab Order","rng") "RTN","EDPBCM",60,0) ;D ENMAP("minMed","Minutes for Medication Order","rng") "RTN","EDPBCM",61,0) D ENMAP("minRad","Minutes for Imaging Order","rng") "RTN","EDPBCM",62,0) D ENMAP("minVer","Minutes for Unverified Order","rng") "RTN","EDPBCM",63,0) Q "RTN","EDPBCM",64,0) ENMAP(ID,NM,TYP) ; create element for colormap "RTN","EDPBCM",65,0) N X,END "RTN","EDPBCM",66,0) S END="/" S:TYP="val" END="" "RTN","EDPBCM",67,0) S X("id")=ID "RTN","EDPBCM",68,0) S X("nm")=NM "RTN","EDPBCM",69,0) S X("type")=TYP "RTN","EDPBCM",70,0) D XML^EDPX($$XMLA^EDPX("colors",.X,END)) "RTN","EDPBCM",71,0) Q "RTN","EDPBCM",72,0) EXMAP ; create closing tag "RTN","EDPBCM",73,0) D XML^EDPX("") "RTN","EDPBCM",74,0) Q "RTN","EDPBCM",75,0) CODES(NM) ; create map elements for a set of codes "RTN","EDPBCM",76,0) N CODESET,IEN "RTN","EDPBCM",77,0) S CODESET=EDPSTA_"."_NM "RTN","EDPBCM",78,0) I '$D(^EDPB(233.2,"B",CODESET)) S CODESET="edp."_NM "RTN","EDPBCM",79,0) S IEN=$O(^EDPB(233.2,"B",CODESET,0)) "RTN","EDPBCM",80,0) Q:'IEN "RTN","EDPBCM",81,0) ; "RTN","EDPBCM",82,0) N SEQ,CODE,DA "RTN","EDPBCM",83,0) S SEQ=0 F S SEQ=$O(^EDPB(233.2,IEN,1,"B",SEQ)) Q:'SEQ D "RTN","EDPBCM",84,0) . S DA=0 F S DA=$O(^EDPB(233.2,IEN,1,"B",SEQ,DA)) Q:'DA D "RTN","EDPBCM",85,0) . . S CODE=$P(^EDPB(233.2,IEN,1,DA,0),U,2) "RTN","EDPBCM",86,0) . . Q:'CODE "RTN","EDPBCM",87,0) . . D MAP(NM,CODE,$P(^EDPB(233.1,CODE,0),U,2)) "RTN","EDPBCM",88,0) Q "RTN","EDPBCM",89,0) URG(ATT) ; create map elements for standard urgencies "RTN","EDPBCM",90,0) D MAP(ATT,0,"No Orders") "RTN","EDPBCM",91,0) D MAP(ATT,1,"Active Orders") "RTN","EDPBCM",92,0) D MAP(ATT,2,"STAT Orders") "RTN","EDPBCM",93,0) Q "RTN","EDPBCM",94,0) MAP(ATT,VAL,NM) ; create a single map element "RTN","EDPBCM",95,0) N X "RTN","EDPBCM",96,0) S X("att")="@"_ATT "RTN","EDPBCM",97,0) S X("val")=VAL "RTN","EDPBCM",98,0) S X("nm")=NM "RTN","EDPBCM",99,0) S X("clr")=0 "RTN","EDPBCM",100,0) D XML^EDPX($$XMLA^EDPX("map",.X)) "RTN","EDPBCM",101,0) Q "RTN","EDPBCM",102,0) LIST ; Build selection list for color maps -- OBSOLETE? "RTN","EDPBCM",103,0) N I,X "RTN","EDPBCM",104,0) F I=1:1 S X=$P($T(MAPLST+I),";",3,99) Q:$E(X,1,5)="zzzzz" D "RTN","EDPBCM",105,0) . S X("data")=$P(X,U,1),X("label")=$P(X,U,2) "RTN","EDPBCM",106,0) . D XML^EDPX($$XMLA^EDPX("colors",.X)) "RTN","EDPBCM",107,0) Q "RTN","EDPBCM",108,0) MAPLST ; list of available color maps "RTN","EDPBCM",109,0) ;;^ ^ "RTN","EDPBCM",110,0) ;;stsAcuity^Status / Acuity "RTN","EDPBCM",111,0) ;;status^Status "RTN","EDPBCM",112,0) ;;acuity^Acuity "RTN","EDPBCM",113,0) ;;bed^Room / Bed "RTN","EDPBCM",114,0) ;;staff^Staff "RTN","EDPBCM",115,0) ;;labUrg^Urgency - Lab "RTN","EDPBCM",116,0) ;;radUrg^Urgency - Imaging "RTN","EDPBCM",117,0) ;;emins^Total Minutes "RTN","EDPBCM",118,0) ;;lmins^Minutes at Location "RTN","EDPBCM",119,0) ;;minLab^Minutes for Lab Order "RTN","EDPBCM",120,0) ;;minRad^Minutes for Imaging Order "RTN","EDPBCM",121,0) ;;minVer^Minutes for Unverified Order "RTN","EDPBCM",122,0) ;;zzzzz "RTN","EDPBDL") 0^56^B11063047 "RTN","EDPBDL",1,0) EDPBDL ;SLC/KCM - Delete/Inactivate Config Entries "RTN","EDPBDL",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBDL",3,0) ; "RTN","EDPBDL",4,0) BED ; Delete Room/Area entries "RTN","EDPBDL",5,0) N AREA,IEN "RTN","EDPBDL",6,0) D SETAREA(.AREA) Q:'AREA "RTN","EDPBDL",7,0) W !,"EDIS Delete Room-Bed Tool",! "RTN","EDPBDL",8,0) W !,"This will delete or inactivate an entry from the TRACKING ROOM-BED file." "RTN","EDPBDL",9,0) W !,"This may take time, as it must search for usage of the Room-Bed entry." "RTN","EDPBDL",10,0) W !,"If the entry has been referenced, it will be inactivated." "RTN","EDPBDL",11,0) W !,"Otherwise the entry will be deleted.",! "RTN","EDPBDL",12,0) F S IEN=$$LKBED(AREA) Q:'IEN D DELBED(IEN) "RTN","EDPBDL",13,0) Q "RTN","EDPBDL",14,0) LKBED(AREA) ; Lookup a bed "RTN","EDPBDL",15,0) N DIC,X,Y,DTOUT,DUOUT "RTN","EDPBDL",16,0) S DIC="^EDPB(231.8,",DIC(0)="AEMQ" "RTN","EDPBDL",17,0) S DIC("S")="I ($P(^(0),U,2)=DUZ(2)),($P(^(0),U,3)=AREA)" "RTN","EDPBDL",18,0) D ^DIC "RTN","EDPBDL",19,0) Q:+Y>0 +Y "RTN","EDPBDL",20,0) Q "" "RTN","EDPBDL",21,0) ; "RTN","EDPBDL",22,0) DELBED(IEN) ; Delete bed if nothing references it, otherwise inactivate "RTN","EDPBDL",23,0) N NM,DA,DIE,DR,DIK,DTOUT,DUOUT "RTN","EDPBDL",24,0) S NM=$P($G(^EDPB(231.8,IEN,0)),U) "RTN","EDPBDL",25,0) I $$BEDUSED(IEN) D "RTN","EDPBDL",26,0) . S DA=IEN,DR=".01///Z"_NM_";.04///1",DIE="^EDPB(231.8," "RTN","EDPBDL",27,0) . D ^DIE W !,NM," inactivated and renamed 'Z"_NM_"'.",! "RTN","EDPBDL",28,0) E D "RTN","EDPBDL",29,0) . S DA=IEN,DIK="^EDPB(231.8," D ^DIK "RTN","EDPBDL",30,0) . W !,$S($D(^EDPB(231.8,DA,0)):" not",1:"")_" deleted.",! "RTN","EDPBDL",31,0) Q "RTN","EDPBDL",32,0) BEDUSED(IEN) ; Return true if log entry references bed "RTN","EDPBDL",33,0) W !,"Searching for usages of ",$P(^EDPB(231.8,IEN,0),U) "RTN","EDPBDL",34,0) N I,FOUND,COUNT "RTN","EDPBDL",35,0) S I=0,FOUND=0,COUNT=0 "RTN","EDPBDL",36,0) F S I=$O(^EDP(230.1,I)) Q:'I D Q:FOUND "RTN","EDPBDL",37,0) . I $P($G(^EDP(230.1,I,3)),U,4)=IEN W "...found" S FOUND=1 "RTN","EDPBDL",38,0) . S COUNT=COUNT+1 I COUNT#100=0 W "." "RTN","EDPBDL",39,0) Q FOUND "RTN","EDPBDL",40,0) BOARD ; Delete Board entries "RTN","EDPBDL",41,0) Q "RTN","EDPBDL",42,0) CODE ; Delete Selection entries "RTN","EDPBDL",43,0) N AREA,SET "RTN","EDPBDL",44,0) D SETAREA(.AREA) Q:'AREA "RTN","EDPBDL",45,0) W !,"EDIS Delete Selection Tool",! "RTN","EDPBDL",46,0) W !,"This will delete a locally defined selection from" "RTN","EDPBDL",47,0) W !,"an EDIS selection list.",! "RTN","EDPBDL",48,0) S SET=$$LKSEL(AREA) Q:'SET "RTN","EDPBDL",49,0) ; "RTN","EDPBDL",50,0) N DIC,X,Y,X0,NM,DTOUT,DUOUT "RTN","EDPBDL",51,0) S DIC="^EDPB(233.2,"_SET_",1,",DIC(0)="AEMQ" "RTN","EDPBDL",52,0) S DIC("W")="W $P(^(0),U,4)" "RTN","EDPBDL",53,0) D ^DIC "RTN","EDPBDL",54,0) Q:Y<1 "RTN","EDPBDL",55,0) S X0=^EDPB(233.2,SET,1,+Y,0),NM=$P(^EDPB(233.1,+$P(X0,U,2),0),U) "RTN","EDPBDL",56,0) I $E(NM,1,3)="edp" W !,"Cannot delete nationally defined item." Q "RTN","EDPBDL",57,0) D DELCODE(SET,+Y) "RTN","EDPBDL",58,0) Q "RTN","EDPBDL",59,0) LKSEL(AREA) ; Choose selection list for deletion "RTN","EDPBDL",60,0) N DIR,X,Y,DTOUT,DUOUT,DIRUT "RTN","EDPBDL",61,0) S DIR(0)="SABO^1:Status;2:Disposition;3:Delay Reason;4:Source" "RTN","EDPBDL",62,0) S DIR("A")="Selection List (1/2/3/4):" "RTN","EDPBDL",63,0) S DIR("A",1)="Choose the list you with to delete from -" "RTN","EDPBDL",64,0) S DIR("A",2)="1: Status",DIR("A",3)="2: Disposition" "RTN","EDPBDL",65,0) S DIR("A",4)="3: Delay Reason",DIR("A",5)="4: Source" "RTN","EDPBDL",66,0) D ^DIR "RTN","EDPBDL",67,0) Q:'Y "" "RTN","EDPBDL",68,0) ; "RTN","EDPBDL",69,0) N SETNM,IEN "RTN","EDPBDL",70,0) S SETNM=$S(1:".status",2:".disposition",3:".delay",4:".arrival",1:"") "RTN","EDPBDL",71,0) Q:SETNM="" "" "RTN","EDPBDL",72,0) S SETNM=$$STA^XUAF4(DUZ(2))_SETNM "RTN","EDPBDL",73,0) S IEN=$O(^EDPB(233.2,"B",SETNM,0)) "RTN","EDPBDL",74,0) I 'IEN W !,"No locally defined selections found." Q "" "RTN","EDPBDL",75,0) Q IEN "RTN","EDPBDL",76,0) ; "RTN","EDPBDL",77,0) DELCODE(SET,DA) ; Delete from inside selection multiple "RTN","EDPBDL",78,0) N DIK "RTN","EDPBDL",79,0) W !,$P(^EDPB(233.2,SET,1,DA,0),U,4) "RTN","EDPBDL",80,0) S DIK="^EDPB(233.2,"_SET_",1,",DA(1)=SET D ^DIK "RTN","EDPBDL",81,0) W " ",$S($D(^EDPB(233.2,SET,1,DA,0)):" not",1:"")," deleted",! "RTN","EDPBDL",82,0) Q "RTN","EDPBDL",83,0) ; "RTN","EDPBDL",84,0) SETAREA(AREA) ; Set to default area for institution in DUZ(2) "RTN","EDPBDL",85,0) S AREA=$O(^EDPB(231.9,"C",DUZ(2),0)) "RTN","EDPBDL",86,0) I 'AREA W !,"No tracking area is configured." "RTN","EDPBDL",87,0) Q "RTN","EDPBKS") 0^57^B15371728 "RTN","EDPBKS",1,0) EDPBKS ;SLC/MKB -- EDPF BIGBOARD KIOSKS list template "RTN","EDPBKS",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBKS",3,0) ; "RTN","EDPBKS",4,0) EN ; -- main entry point "RTN","EDPBKS",5,0) S EDPSITE=$$DIV Q:EDPSITE<1 "RTN","EDPBKS",6,0) D EN^VALM("EDPF BIGBOARD KIOSKS") "RTN","EDPBKS",7,0) Q "RTN","EDPBKS",8,0) ; "RTN","EDPBKS",9,0) HDR ; -- header code "RTN","EDPBKS",10,0) N X S X=$$NS^XUAF4(EDPSITE) "RTN","EDPBKS",11,0) S VALMHDR(1)="Division: "_$P(X,U)_" ("_$P(X,U,2)_")" "RTN","EDPBKS",12,0) Q "RTN","EDPBKS",13,0) ; "RTN","EDPBKS",14,0) INIT ; -- init variables and list array EDPB "RTN","EDPBKS",15,0) N EDPX,I,X K EDPB "RTN","EDPBKS",16,0) D GETLST^XPAR(.EDPX,"DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS") "RTN","EDPBKS",17,0) S VALMCNT=EDPX I EDPX F I=1:1:EDPX D "RTN","EDPBKS",18,0) . S X=EDPX(I),EDPB("IDX",I)=X "RTN","EDPBKS",19,0) . N X1,X2 S X1=$P(X,U),X2=$P(X,U,2) "RTN","EDPBKS",20,0) . S:$L(X1)>37 X1=$E(X1,1,37)_"..." S:$L(X2)>27 X2=$E(X2,1,27)_"..." "RTN","EDPBKS",21,0) . S EDPB(I,0)=$$LJ^XLFSTR(I,4)_$$LJ^XLFSTR(X1,40)_X2 "RTN","EDPBKS",22,0) Q "RTN","EDPBKS",23,0) ; "RTN","EDPBKS",24,0) HELP ; -- help code "RTN","EDPBKS",25,0) S X="?" D DISP^XQORM1 W !! "RTN","EDPBKS",26,0) Q "RTN","EDPBKS",27,0) ; "RTN","EDPBKS",28,0) EXIT ; -- exit code "RTN","EDPBKS",29,0) K EDPSITE "RTN","EDPBKS",30,0) Q "RTN","EDPBKS",31,0) ; "RTN","EDPBKS",32,0) DIV() ; -- select division "RTN","EDPBKS",33,0) N X,Y,DIC "RTN","EDPBKS",34,0) S DIC=4,DIC(0)="AEQM" "RTN","EDPBKS",35,0) ; DIC("S")= only local divisions ?? "RTN","EDPBKS",36,0) D ^DIC S Y=$S(Y<1:"",1:+Y) "RTN","EDPBKS",37,0) Q Y "RTN","EDPBKS",38,0) ; "RTN","EDPBKS",39,0) ENTER(NAME,DEFAULT) ; -- prompt for NAME "RTN","EDPBKS",40,0) N X,Y,DIR,DTOUT,DUOUT "RTN","EDPBKS",41,0) S DIR(0)="FAO",DIR("A")=NAME_": " S:$L($G(DEFAULT)) DIR("B")=DEFAULT "RTN","EDPBKS",42,0) I $E(NAME)="C" S DIR("?")="Enter a fully specified computer name; this will be saved in lowercase." "RTN","EDPBKS",43,0) E S DIR("?")="Enter the name of the board to be displayed on this computer; this value is case-sensitive." "RTN","EDPBKS",44,0) D ^DIR I $G(DTOUT)!$G(DUOUT) S Y="" "RTN","EDPBKS",45,0) Q Y "RTN","EDPBKS",46,0) ; "RTN","EDPBKS",47,0) SELECT() ; -- select item from list by number "RTN","EDPBKS",48,0) N X,Y,DIR,DTOUT,DUOUT "RTN","EDPBKS",49,0) S DIR(0)="NAO^1:"_VALMCNT,DIR("A")="Select computer/board: " "RTN","EDPBKS",50,0) D ^DIR "RTN","EDPBKS",51,0) Q Y "RTN","EDPBKS",52,0) ; "RTN","EDPBKS",53,0) SURE(NAME) ; -- are you sure? "RTN","EDPBKS",54,0) N X,Y,DIR,DTOUT,DUOUT W ! "RTN","EDPBKS",55,0) S DIR("A",1)="Deletions are done immediately!" "RTN","EDPBKS",56,0) S DIR(0)="YA",DIR("A")="Are you sure"_$S($L($G(NAME)):" you want to remove "_NAME,1:"")_"? " "RTN","EDPBKS",57,0) D ^DIR "RTN","EDPBKS",58,0) Q Y "RTN","EDPBKS",59,0) ; "RTN","EDPBKS",60,0) ; -- EDPF BIGBOARD MENU actions -- "RTN","EDPBKS",61,0) ; "RTN","EDPBKS",62,0) NEWDIV ; -- select new division "RTN","EDPBKS",63,0) N X D FULL^VALM1 S VALMBCK="R" "RTN","EDPBKS",64,0) S X=$$DIV I X,X'=EDPSITE D "RTN","EDPBKS",65,0) . W !,"Rebuilding list ..." H 1 "RTN","EDPBKS",66,0) . S EDPSITE=X D INIT "RTN","EDPBKS",67,0) . K VALMHDR "RTN","EDPBKS",68,0) Q "RTN","EDPBKS",69,0) ; "RTN","EDPBKS",70,0) ADD ; -- add a computer/board "RTN","EDPBKS",71,0) N INST,VAL,DONE,EDPERR,MORE "RTN","EDPBKS",72,0) D FULL^VALM1 S VALMBCK="R" W ! "RTN","EDPBKS",73,0) S (DONE,MORE)=0 F D Q:DONE "RTN","EDPBKS",74,0) . S INST=$$ENTER("Computer Name") I '$L(INST) S DONE=1 Q "RTN","EDPBKS",75,0) . S INST=$$LOW^XLFSTR(INST) ;enforce lowercase "RTN","EDPBKS",76,0) . S VAL=$$ENTER("Display Board") I '$L(VAL) S DONE=1 Q "RTN","EDPBKS",77,0) . D ADD^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,VAL,.EDPERR) "RTN","EDPBKS",78,0) . I EDPERR W !,$P(EDPERR,U,2),! H 2 Q "RTN","EDPBKS",79,0) . S MORE=1 W ! "RTN","EDPBKS",80,0) D:MORE INIT "RTN","EDPBKS",81,0) Q "RTN","EDPBKS",82,0) ; "RTN","EDPBKS",83,0) REM ; -- remove a computer/board "RTN","EDPBKS",84,0) N NUM,INST,EDPERR S VALMBCK="" "RTN","EDPBKS",85,0) S NUM=$$SELECT Q:NUM<1 "RTN","EDPBKS",86,0) S INST=$P($G(EDPB("IDX",NUM)),U) "RTN","EDPBKS",87,0) I '$L(INST) W !,"Invalid selection" H 1 Q "RTN","EDPBKS",88,0) Q:'$$SURE(INST) "RTN","EDPBKS",89,0) D DEL^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,.EDPERR) "RTN","EDPBKS",90,0) I EDPERR W !,$P(EDPERR,U,2) H 2 Q "RTN","EDPBKS",91,0) W !,"Board removed." H 1 "RTN","EDPBKS",92,0) D INIT S VALMBCK="R" "RTN","EDPBKS",93,0) Q "RTN","EDPBKS",94,0) ; "RTN","EDPBKS",95,0) CHG ; -- change a computer or board name "RTN","EDPBKS",96,0) N NUM,OLD,INST,VAL,EDPERR S VALMBCK="" "RTN","EDPBKS",97,0) S NUM=$$SELECT Q:NUM<1 "RTN","EDPBKS",98,0) S OLD=$G(EDPB("IDX",NUM)),VALMBCK="R" "RTN","EDPBKS",99,0) S INST=$$ENTER("Computer Name",$P(OLD,U)) Q:'$L(INST) "RTN","EDPBKS",100,0) S INST=$$LOW^XLFSTR(INST) ;enforce lowercase "RTN","EDPBKS",101,0) S VAL=$$ENTER("Display Board",$P(OLD,U,2)) Q:'$L(VAL) "RTN","EDPBKS",102,0) I OLD=(INST_U_VAL) Q ;no change "RTN","EDPBKS",103,0) I INST'=$P(OLD,U) D Q:EDPERR "RTN","EDPBKS",104,0) . D REP^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",$P(OLD,U),INST,.EDPERR) "RTN","EDPBKS",105,0) . I EDPERR W !,$P(EDPERR,U,2) H 2 "RTN","EDPBKS",106,0) I VAL'=$P(OLD,U,2) D "RTN","EDPBKS",107,0) . D CHG^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,VAL,.EDPERR) "RTN","EDPBKS",108,0) . I EDPERR W !,$P(EDPERR,U,2) H 2 Q "RTN","EDPBKS",109,0) D INIT "RTN","EDPBKS",110,0) Q "RTN","EDPBLK") 0^55^B7330093 "RTN","EDPBLK",1,0) EDPBLK ;SLC/KCM - Handle locking for configuration "RTN","EDPBLK",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBLK",3,0) ; "RTN","EDPBLK",4,0) READL(AREA,PART,TOKEN) ; lock for reading "RTN","EDPBLK",5,0) N DAY,SEQ "RTN","EDPBLK",6,0) S DAY=$$INITLOCK "RTN","EDPBLK",7,0) L +^XTMP("EDP-LOCK-"_DAY,AREA,PART):10 E Q "" "RTN","EDPBLK",8,0) S SEQ=+$G(^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ"))+1 "RTN","EDPBLK",9,0) S ^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ")=SEQ "RTN","EDPBLK",10,0) S TOKEN=DAY_"-"_SEQ "RTN","EDPBLK",11,0) Q "RTN","EDPBLK",12,0) READU(AREA,PART,TOKEN) ; unlock for reading "RTN","EDPBLK",13,0) Q:$G(TOKEN)="" "RTN","EDPBLK",14,0) L -^XTMP("EDP-LOCK-"_$P(TOKEN,"-"),AREA,PART) "RTN","EDPBLK",15,0) Q "RTN","EDPBLK",16,0) INITLOCK() ; returns lock table id, initializing new table if necessary "RTN","EDPBLK",17,0) S DAY=+$H "RTN","EDPBLK",18,0) I '$D(^XTMP("EDP-LOCK-"_DAY,0)) D "RTN","EDPBLK",19,0) . S ^XTMP("EDP-LOCK-"_DAY,0)=$$FMADD^XLFDT(DT,2)_U_DT_U_"ED Locks" "RTN","EDPBLK",20,0) . N X S X=DAY-3 ; delete any older than 3 days "RTN","EDPBLK",21,0) . F S X=$O(^XTMP("EDP-LOCK-"_X),-1) Q:$E(X,1,8)'="EDP-LOCK" D "RTN","EDPBLK",22,0) . . S X=$P(X,"-",3) "RTN","EDPBLK",23,0) . . K ^XTMP("EDP-LOCK-"_X) "RTN","EDPBLK",24,0) Q DAY "RTN","EDPBLK",25,0) ; "RTN","EDPBLK",26,0) SAVEL(AREA,PART,TOKEN,ERR) ; lock for saving configuration "RTN","EDPBLK",27,0) ; ERR is return, empty if successful, message if lock fails "RTN","EDPBLK",28,0) ; TOKEN is returned with save token, contains read token initially "RTN","EDPBLK",29,0) S ERR="" "RTN","EDPBLK",30,0) I '$L(TOKEN) S ERR="Unable to update with empty token" Q "RTN","EDPBLK",31,0) ; "RTN","EDPBLK",32,0) ; extract from token the time of the GET "RTN","EDPBLK",33,0) N GDAY,GSEQ "RTN","EDPBLK",34,0) S GDAY=$P(TOKEN,"-"),GSEQ=$P(TOKEN,"-",2) "RTN","EDPBLK",35,0) ; "RTN","EDPBLK",36,0) ; lock out all reads during the update "RTN","EDPBLK",37,0) N DAY "RTN","EDPBLK",38,0) S DAY=$$INITLOCK "RTN","EDPBLK",39,0) L +^XTMP("EDP-LOCK-"_DAY,AREA,PART):10 E S ERR="Unable to obtain lock" Q "RTN","EDPBLK",40,0) ; "RTN","EDPBLK",41,0) ; look backwards for interfering updates since GET "RTN","EDPBLK",42,0) N COLLIDE,SEQ,X,Y "RTN","EDPBLK",43,0) S COLLIDE="",X="EDP-LOCK-?" "RTN","EDPBLK",44,0) F S X=$O(^XTMP(X),-1) Q:$E(X,1,8)'="EDP-LOCK" Q:$P(X,"-",3)"_TOKEN_"") "RTN","EDPBPM",8,0) S X1=$G(^EDPB(231.9,AREA,1)) "RTN","EDPBPM",9,0) S X("reqDiag")=+$P(X1,U,1) "RTN","EDPBPM",10,0) S X("codedDiag")=+$P(X1,U,2) "RTN","EDPBPM",11,0) S X("reqDisp")=+$P(X1,U,3) "RTN","EDPBPM",12,0) S X("reqDelay")=+$P(X1,U,4) "RTN","EDPBPM",13,0) S X("minDelay")=+$P(X1,U,5) "RTN","EDPBPM",14,0) S X("shiftOne")=$P(X1,U,6) "RTN","EDPBPM",15,0) S X("shiftLen")=$P(X1,U,7) "RTN","EDPBPM",16,0) S X("residents")=$P(X1,U,8) "RTN","EDPBPM",17,0) S X("clinics")=$P(X1,U,9) "RTN","EDPBPM",18,0) S X("ambulance")=$P(X1,U,11) "RTN","EDPBPM",19,0) S X("dfltroom")=$P(X1,U,12) "RTN","EDPBPM",20,0) D XML^EDPX($$XMLA^EDPX("params",.X)) "RTN","EDPBPM",21,0) D READU^EDPBLK(AREA,"param",.TOKEN) ; read param config -- UNLOCK "RTN","EDPBPM",22,0) Q "RTN","EDPBPM",23,0) SAVE(AREA,PARAM) ; save updated parameters "RTN","EDPBPM",24,0) I '$D(^EDPB(231.9,AREA,0)) D SAVERR^EDPX("fail","Area not set up") Q "RTN","EDPBPM",25,0) ; "RTN","EDPBPM",26,0) N TOKEN,LOCKERR "RTN","EDPBPM",27,0) S TOKEN=$G(REQ("paramToken",1)) "RTN","EDPBPM",28,0) D SAVEL^EDPBLK(AREA,"param",.TOKEN,.LOCKERR) ; save param config -- LOCK "RTN","EDPBPM",29,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA) Q "RTN","EDPBPM",30,0) ; "RTN","EDPBPM",31,0) N FLD D NVPARSE^EDPX(.FLD,PARAM) "RTN","EDPBPM",32,0) N FDA,FDAIEN,DIERR "RTN","EDPBPM",33,0) S AREA=AREA_"," "RTN","EDPBPM",34,0) I FLD("ambulance")=-1 S FLD("ambulance")="@" "RTN","EDPBPM",35,0) I FLD("dfltroom")=-1 S FLD("dfltroom")="@" "RTN","EDPBPM",36,0) S FDA(231.9,AREA,1.1)=FLD("reqDiag") "RTN","EDPBPM",37,0) S FDA(231.9,AREA,1.2)=FLD("codedDiag") "RTN","EDPBPM",38,0) S FDA(231.9,AREA,1.3)=FLD("reqDisp") "RTN","EDPBPM",39,0) S FDA(231.9,AREA,1.4)=FLD("reqDelay") "RTN","EDPBPM",40,0) S FDA(231.9,AREA,1.5)=FLD("minDelay") "RTN","EDPBPM",41,0) S FDA(231.9,AREA,1.6)=FLD("shiftOne") "RTN","EDPBPM",42,0) S FDA(231.9,AREA,1.7)=FLD("shiftLen") "RTN","EDPBPM",43,0) S FDA(231.9,AREA,1.8)=FLD("residents") "RTN","EDPBPM",44,0) S FDA(231.9,AREA,1.9)=FLD("clinics") "RTN","EDPBPM",45,0) S FDA(231.9,AREA,1.11)=FLD("ambulance") "RTN","EDPBPM",46,0) S FDA(231.9,AREA,1.12)=FLD("dfltroom") "RTN","EDPBPM",47,0) D FILE^DIE("","FDA","ERR") "RTN","EDPBPM",48,0) D SAVEU^EDPBLK(+AREA,"param",.TOKEN) ; save param config -- UNLOCK "RTN","EDPBPM",49,0) ; "RTN","EDPBPM",50,0) I $D(DIERR) D SAVERR^EDPX("fail",$G(ERR("DIERR",1,"TEXT",1))) Q "RTN","EDPBPM",51,0) D XML^EDPX("") "RTN","EDPBPM",52,0) D LOAD(+AREA) "RTN","EDPBPM",53,0) Q "RTN","EDPBPM",54,0) TZSAVE(AREA,TZDIFF) ; save time zone difference in minutes "RTN","EDPBPM",55,0) N FDA,FDAIEN,DIERR "RTN","EDPBPM",56,0) S AREA=AREA_"," "RTN","EDPBPM",57,0) S FDA(231.9,AREA,.03)=TZDIFF "RTN","EDPBPM",58,0) D FILE^DIE("","FDA","ERR") "RTN","EDPBPM",59,0) Q "RTN","EDPBRM") 0^28^B24385375 "RTN","EDPBRM",1,0) EDPBRM ;SLC/KCM - Room/Bed Configuration "RTN","EDPBRM",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBRM",3,0) ; "RTN","EDPBRM",4,0) LOAD(AREA) ; Load the list of rooms/beds for this area "RTN","EDPBRM",5,0) N BED,SEQ,BEDS,X0,TOKEN "RTN","EDPBRM",6,0) ; "RTN","EDPBRM",7,0) D READL^EDPBLK(AREA,"bed",.TOKEN) ; read bed config -- LOCK "RTN","EDPBRM",8,0) D XML^EDPX(""_TOKEN_"") "RTN","EDPBRM",9,0) ; "RTN","EDPBRM",10,0) ; Get a list of all the beds in sequence for this area "RTN","EDPBRM",11,0) S BED=0 F S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPBRM",12,0) . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999 "RTN","EDPBRM",13,0) . S BEDS(SEQ,BED)="" "RTN","EDPBRM",14,0) ; "RTN","EDPBRM",15,0) ; Build the XML for each bed in sequence "RTN","EDPBRM",16,0) D XML^EDPX("") "RTN","EDPBRM",17,0) S SEQ=0 F S SEQ=$O(BEDS(SEQ)) Q:'SEQ D "RTN","EDPBRM",18,0) . S BED=0 F S BED=$O(BEDS(SEQ,BED)) Q:'BED D "RTN","EDPBRM",19,0) . . S X0=^EDPB(231.8,BED,0) "RTN","EDPBRM",20,0) . . N X "RTN","EDPBRM",21,0) . . S X("id")=BED "RTN","EDPBRM",22,0) . . S X("name")=$P(X0,U) "RTN","EDPBRM",23,0) . . S X("site")=$P(X0,U,2) "RTN","EDPBRM",24,0) . . S X("area")=$P(X0,U,3) "RTN","EDPBRM",25,0) . . S X("inactive")=$P(X0,U,4) "RTN","EDPBRM",26,0) . . S X("seq")=$P(X0,U,5) "RTN","EDPBRM",27,0) . . S X("display")=$P(X0,U,6) "RTN","EDPBRM",28,0) . . S X("when")=$P(X0,U,7) "RTN","EDPBRM",29,0) . . S X("status")=$P(X0,U,8) "RTN","EDPBRM",30,0) . . S X("category")=$P(X0,U,9) "RTN","EDPBRM",31,0) . . S X("shared")=$P(X0,U,10) "RTN","EDPBRM",32,0) . . S X("board")=$P(X0,U,11) "RTN","EDPBRM",33,0) . . S X("color")=$P(X0,U,12) "RTN","EDPBRM",34,0) . . D XML^EDPX($$XMLA^EDPX("bed",.X)) "RTN","EDPBRM",35,0) D XML^EDPX("") "RTN","EDPBRM",36,0) ; "RTN","EDPBRM",37,0) D READU^EDPBLK(AREA,"bed",.TOKEN) ; read bed config -- UNLOCK "RTN","EDPBRM",38,0) Q "RTN","EDPBRM",39,0) SAVE(REQ,AREA) ; Save the updated bed list "RTN","EDPBRM",40,0) ; loop thru the records and update where changed "RTN","EDPBRM",41,0) N X,BED,ERR,TOKEN,LOCKERR "RTN","EDPBRM",42,0) ; "RTN","EDPBRM",43,0) S TOKEN=$G(REQ("bedToken",1)) "RTN","EDPBRM",44,0) D SAVEL^EDPBLK(AREA,"bed",.TOKEN,.LOCKERR) ; save bed config -- LOCK "RTN","EDPBRM",45,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA),DFLTRM(AREA) Q "RTN","EDPBRM",46,0) ; "RTN","EDPBRM",47,0) S X="bed-",ERR="" "RTN","EDPBRM",48,0) F S X=$O(REQ(X)) Q:$E(X,1,4)'="bed-" D "RTN","EDPBRM",49,0) . K BED S BED="" "RTN","EDPBRM",50,0) . D NVPARSE^EDPX(.BED,REQ(X,1)) "RTN","EDPBRM",51,0) . S BED("name")=$$TRIM^XLFSTR(BED("name")) "RTN","EDPBRM",52,0) . I '$L(BED("name")) S ERR=ERR_"Name may not be blank. " Q "RTN","EDPBRM",53,0) . I BED("changed") D UPD(.BED,.ERR) "RTN","EDPBRM",54,0) D SAVEU^EDPBLK(AREA,"bed",.TOKEN) ; save bed config -- UNLOCK "RTN","EDPBRM",55,0) ; "RTN","EDPBRM",56,0) I $L(ERR) D SAVERR^EDPX("fail",ERR) Q "RTN","EDPBRM",57,0) D XML^EDPX("") "RTN","EDPBRM",58,0) D LOAD(AREA) ; return updated list of beds "RTN","EDPBRM",59,0) D DFLTRM(AREA) ; return new default lists of beds "RTN","EDPBRM",60,0) Q "RTN","EDPBRM",61,0) UPD(FLD,ERRMSG) ; Add/Update Record "RTN","EDPBRM",62,0) N EDPIEN "RTN","EDPBRM",63,0) S EDPIEN=FLD("id")_"," "RTN","EDPBRM",64,0) I FLD("id")=0 S EDPIEN="+1," "RTN","EDPBRM",65,0) ; "RTN","EDPBRM",66,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBRM",67,0) S FDA(231.8,EDPIEN,.01)=FLD("name") "RTN","EDPBRM",68,0) S FDA(231.8,EDPIEN,.02)=EDPSITE "RTN","EDPBRM",69,0) S FDA(231.8,EDPIEN,.03)=FLD("area") "RTN","EDPBRM",70,0) S FDA(231.8,EDPIEN,.04)=FLD("inactive") "RTN","EDPBRM",71,0) S FDA(231.8,EDPIEN,.05)=FLD("seq") "RTN","EDPBRM",72,0) S FDA(231.8,EDPIEN,.06)=FLD("display") "RTN","EDPBRM",73,0) S FDA(231.8,EDPIEN,.07)=FLD("when") "RTN","EDPBRM",74,0) S FDA(231.8,EDPIEN,.08)=FLD("status") "RTN","EDPBRM",75,0) S FDA(231.8,EDPIEN,.09)=FLD("category") "RTN","EDPBRM",76,0) S FDA(231.8,EDPIEN,.1)=FLD("shared") "RTN","EDPBRM",77,0) S FDA(231.8,EDPIEN,.11)=FLD("board") "RTN","EDPBRM",78,0) S FDA(231.8,EDPIEN,.12)=FLD("color") "RTN","EDPBRM",79,0) I EDPIEN="+1," D "RTN","EDPBRM",80,0) . D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBRM",81,0) . I $D(DIERR) S ERRMSG=ERRMSG_"Adding "_FLD("name")_" failed. " "RTN","EDPBRM",82,0) E D "RTN","EDPBRM",83,0) . D FILE^DIE("","FDA","ERR") "RTN","EDPBRM",84,0) . I $D(DIERR) S ERRMSG=ERRMSG_"Updating "_FLD("name")_" failed. " "RTN","EDPBRM",85,0) D CLEAN^DILF "RTN","EDPBRM",86,0) Q "RTN","EDPBRM",87,0) DFLTRM(AREA) ; Load the multi-areas "RTN","EDPBRM",88,0) N BED,X,X0,ALPHA "RTN","EDPBRM",89,0) D XML^EDPX("") "RTN","EDPBRM",90,0) D XML^EDPX($$XMLS^EDPX("item",-1,"(None Selected)")) ;non-selected (-1 will delete) "RTN","EDPBRM",91,0) S BED=0 F S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPBRM",92,0) . S X0=^EDPB(231.8,BED,0) "RTN","EDPBRM",93,0) . I $P(X0,U,4) Q ; inactive "RTN","EDPBRM",94,0) . I ($P(X0,U,9)=1)!($P(X0,U,9)=2) S ALPHA($P(X0,U)_" ("_$P(X0,U,6)_")")=BED "RTN","EDPBRM",95,0) S X="" F S X=$O(ALPHA(X)) Q:X="" D XML^EDPX($$XMLS^EDPX("item",ALPHA(X),X)) "RTN","EDPBRM",96,0) D XML^EDPX("") "RTN","EDPBRM",97,0) Q "RTN","EDPBRM",98,0) CHOICES ; Load the choice lists "RTN","EDPBRM",99,0) N I,X "RTN","EDPBRM",100,0) F I=1:1 S X=$P($T(WHEN+I),";",3,99) Q:X="ZZZZZ" D XML^EDPX(X) "RTN","EDPBRM",101,0) F I=1:1 S X=$P($T(CATS+I),";",3,99) Q:X="ZZZZZ" D XML^EDPX(X) "RTN","EDPBRM",102,0) D CODES^EDPQLE1("status","status") "RTN","EDPBRM",103,0) Q "RTN","EDPBRM",104,0) WHEN ; Display When Choices "RTN","EDPBRM",105,0) ;; "RTN","EDPBRM",106,0) ;; "RTN","EDPBRM",107,0) ;; "RTN","EDPBRM",108,0) ;; "RTN","EDPBRM",109,0) ;; "RTN","EDPBRM",110,0) ;;ZZZZZ "RTN","EDPBRM",111,0) CATS ; Category Choices "RTN","EDPBRM",112,0) ;; "RTN","EDPBRM",113,0) ;; "RTN","EDPBRM",114,0) ;; "RTN","EDPBRM",115,0) ;; "RTN","EDPBRM",116,0) ;; "RTN","EDPBRM",117,0) ;; "RTN","EDPBRM",118,0) ;; "RTN","EDPBRM",119,0) ;;ZZZZZ "RTN","EDPBRS") 0^29^B19077772 "RTN","EDPBRS",1,0) EDPBRS ;SLC/KCM - Reset Board Configuration "RTN","EDPBRS",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBRS",3,0) ; "RTN","EDPBRS",4,0) RESET(AREA) ; Set initial configuration for site & area "RTN","EDPBRS",5,0) D SPEC(AREA),COLOR(AREA),ROOMS(AREA),PARAMS(AREA) "RTN","EDPBRS",6,0) S ^EDPB(231.9,AREA,231)=$H "RTN","EDPBRS",7,0) Q "RTN","EDPBRS",8,0) SPEC(AREA) ; Set up default board spec "RTN","EDPBRS",9,0) ; assumes site, area passed in "RTN","EDPBRS",10,0) N I,X,WP,MSG "RTN","EDPBRS",11,0) F I=1:1 S X=$P($T(BRDXML+I),";",3,99) Q:$E(X,1,5)="zzzzz" S WP(I)=X "RTN","EDPBRS",12,0) D UPDBRD^EDPBCF(AREA,0,"Main (default)",.WP,.MSG) "RTN","EDPBRS",13,0) Q "RTN","EDPBRS",14,0) BRDXML ; XML for the board spec "RTN","EDPBRS",15,0) ;; "RTN","EDPBRS",16,0) ;; "RTN","EDPBRS",17,0) ;; "RTN","EDPBRS",18,0) ;; "RTN","EDPBRS",19,0) ;; "RTN","EDPBRS",20,0) ;; "RTN","EDPBRS",21,0) ;; "RTN","EDPBRS",22,0) ;; "RTN","EDPBRS",23,0) ;; "RTN","EDPBRS",24,0) ;; "RTN","EDPBRS",25,0) ;; "RTN","EDPBRS",26,0) ;; "RTN","EDPBRS",27,0) ;;zzzzz "RTN","EDPBRS",28,0) ;; "RTN","EDPBRS",29,0) COLOR(AREA) ; Set up default colors "RTN","EDPBRS",30,0) N I,X,WP "RTN","EDPBRS",31,0) F I=1:1 S X=$P($T(CLRXML+I),";",3,99) Q:$E(X,1,5)="zzzzz" S WP(I)=X "RTN","EDPBRS",32,0) D WP^DIE(231.9,AREA_",",3,"","WP") "RTN","EDPBRS",33,0) I $D(DIERR) W !,"spec update failed" "RTN","EDPBRS",34,0) D CLEAN^DILF "RTN","EDPBRS",35,0) Q "RTN","EDPBRS",36,0) CLRXML ; XML for the color spec "RTN","EDPBRS",37,0) ;; "RTN","EDPBRS",38,0) ;; "RTN","EDPBRS",39,0) ;; "RTN","EDPBRS",40,0) ;; "RTN","EDPBRS",41,0) ;; "RTN","EDPBRS",42,0) ;; "RTN","EDPBRS",43,0) ;; "RTN","EDPBRS",44,0) ;; "RTN","EDPBRS",45,0) ;; "RTN","EDPBRS",46,0) ;; "RTN","EDPBRS",47,0) ;; "RTN","EDPBRS",48,0) ;; "RTN","EDPBRS",49,0) ;; "RTN","EDPBRS",50,0) ;; "RTN","EDPBRS",51,0) ;; "RTN","EDPBRS",52,0) ;; "RTN","EDPBRS",53,0) ;; "RTN","EDPBRS",54,0) ;; "RTN","EDPBRS",55,0) ;; "RTN","EDPBRS",56,0) ;; "RTN","EDPBRS",57,0) ;; "RTN","EDPBRS",58,0) ;; "RTN","EDPBRS",59,0) ;; "RTN","EDPBRS",60,0) ;; "RTN","EDPBRS",61,0) ;;zzzzz "RTN","EDPBRS",62,0) ;; "RTN","EDPBRS",63,0) ROOMS(AREA) ; baseline rooms "RTN","EDPBRS",64,0) N I,X "RTN","EDPBRS",65,0) F I=1:1 S X=$P($T(ROOMLST+I),";",3,99) Q:$E(X,1,5)="zzzzz" D "RTN","EDPBRS",66,0) . N FDA,FDAIEN,DIERR,ERR "RTN","EDPBRS",67,0) . S FDA(231.8,"+1,",.01)=$P(X,U) "RTN","EDPBRS",68,0) . S FDA(231.8,"+1,",.02)=EDPSITE "RTN","EDPBRS",69,0) . S FDA(231.8,"+1,",.03)=AREA "RTN","EDPBRS",70,0) . S FDA(231.8,"+1,",.05)=$P(X,U,3) "RTN","EDPBRS",71,0) . S FDA(231.8,"+1,",.06)=$P(X,U,2) "RTN","EDPBRS",72,0) . S FDA(231.8,"+1,",.07)=$P(X,U,4) "RTN","EDPBRS",73,0) . S FDA(231.8,"+1,",.09)=$P(X,U,5) "RTN","EDPBRS",74,0) . D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBRS",75,0) D CLEAN^DILF "RTN","EDPBRS",76,0) Q "RTN","EDPBRS",77,0) ROOMLST ; Name^Display Name^Seq^When^Category "RTN","EDPBRS",78,0) ;;Waiting^WAIT^1^0^2 "RTN","EDPBRS",79,0) ;;Ambulance^AMBU^5^0^1 "RTN","EDPBRS",80,0) ;;Hallway^HALL^10^0^1 "RTN","EDPBRS",81,0) ;;General Radiology^RAD^110^0^1 "RTN","EDPBRS",82,0) ;;CT^CT^120^0^1 "RTN","EDPBRS",83,0) ;;MRI^MRI^130^0^1 "RTN","EDPBRS",84,0) ;;Cardiac Cath^CATH^140^0^1 "RTN","EDPBRS",85,0) ;;Cardiac Stress Test^STEST^150^0^1 "RTN","EDPBRS",86,0) ;;Dialysis^DIAL^160^0^1 "RTN","EDPBRS",87,0) ;;Subspecialty Clinic^SCLIN^170^0^1 "RTN","EDPBRS",88,0) ;;zzzzz "RTN","EDPBRS",89,0) PARAMS(AREA) ; baseline parameters "RTN","EDPBRS",90,0) N FDA,DIERR "RTN","EDPBRS",91,0) S AREA=AREA_"," "RTN","EDPBRS",92,0) S FDA(231.9,AREA,1.1)=1 "RTN","EDPBRS",93,0) S FDA(231.9,AREA,1.2)=1 "RTN","EDPBRS",94,0) S FDA(231.9,AREA,1.3)=1 "RTN","EDPBRS",95,0) S FDA(231.9,AREA,1.4)=1 "RTN","EDPBRS",96,0) S FDA(231.9,AREA,1.5)=300 "RTN","EDPBRS",97,0) S FDA(231.9,AREA,1.6)=420 "RTN","EDPBRS",98,0) S FDA(231.9,AREA,1.7)=480 "RTN","EDPBRS",99,0) S FDA(231.9,AREA,1.8)=1 "RTN","EDPBRS",100,0) S FDA(231.9,AREA,1.11)=$O(^EDPB(231.8,"AC",EDPSITE,+AREA,"AMBU",0)) "RTN","EDPBRS",101,0) S FDA(231.9,AREA,1.12)=$O(^EDPB(231.8,"AC",EDPSITE,+AREA,"WAIT",0)) "RTN","EDPBRS",102,0) D FILE^DIE("","FDA","ERR") "RTN","EDPBRS",103,0) D CLEAN^DILF "RTN","EDPBRS",104,0) Q "RTN","EDPBSL") 0^30^B20029785 "RTN","EDPBSL",1,0) EDPBSL ;SLC/KCM - Selection List Configuration "RTN","EDPBSL",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBSL",3,0) ; "RTN","EDPBSL",4,0) LOAD(AREA) ; Load selection lists for area "RTN","EDPBSL",5,0) N TOKEN "RTN","EDPBSL",6,0) D READL^EDPBLK(AREA,"selection",.TOKEN) ; read selection config -- LOCK "RTN","EDPBSL",7,0) D XML^EDPX(""_TOKEN_"") "RTN","EDPBSL",8,0) ;D LIST("acuity","Acuity") "RTN","EDPBSL",9,0) D LIST("status","Status") "RTN","EDPBSL",10,0) D LIST("arrival","Source") "RTN","EDPBSL",11,0) D LIST("disposition","Disposition") "RTN","EDPBSL",12,0) D LIST("delay","Delay Reason") "RTN","EDPBSL",13,0) D READU^EDPBLK(AREA,"selection",.TOKEN) ; read selection config -- UNLOCK "RTN","EDPBSL",14,0) Q "RTN","EDPBSL",15,0) LIST(NM,TITLE) ; build XML for selection list "RTN","EDPBSL",16,0) N SETNM S SETNM=EDPSTA_"."_NM "RTN","EDPBSL",17,0) I '$D(^EDPB(233.2,"B",SETNM)) S SETNM="edp."_NM "RTN","EDPBSL",18,0) D XML^EDPX("<"_NM_" title='"_TITLE_"'>") "RTN","EDPBSL",19,0) N IEN,SEQ,DA,X0 "RTN","EDPBSL",20,0) S IEN=$O(^EDPB(233.2,"B",SETNM,0)) "RTN","EDPBSL",21,0) S SEQ=0 F S SEQ=$O(^EDPB(233.2,IEN,1,"B",SEQ)) Q:'SEQ D "RTN","EDPBSL",22,0) . S DA=0 F S DA=$O(^EDPB(233.2,IEN,1,"B",SEQ,DA)) Q:'DA D "RTN","EDPBSL",23,0) . . S X0=^EDPB(233.2,IEN,1,DA,0) "RTN","EDPBSL",24,0) . . N X "RTN","EDPBSL",25,0) . . S X("seq")=SEQ "RTN","EDPBSL",26,0) . . S X("id")=$P(X0,U,2) "RTN","EDPBSL",27,0) . . S X("inact")=$P(X0,U,3) "RTN","EDPBSL",28,0) . . S X("show")=$P(X0,U,4) "RTN","EDPBSL",29,0) . . S X("abbr")=$P(X0,U,5) "RTN","EDPBSL",30,0) . . ; switch to entry in 233.1 now "RTN","EDPBSL",31,0) . . S X0=^EDPB(233.1,X("id"),0) "RTN","EDPBSL",32,0) . . I X("show")="" S X("show")=$P(X0,U,2) "RTN","EDPBSL",33,0) . . I X("abbr")="" S X("abbr")=$P(X0,U,3) "RTN","EDPBSL",34,0) . . S X("flag")=$P(X0,U,5) "RTN","EDPBSL",35,0) . . S X("natl")=$S($E(X0,1,3)="edp":$P(X0,U,2),1:"(local)") "RTN","EDPBSL",36,0) . . D XML^EDPX($$XMLA^EDPX("code",.X)) "RTN","EDPBSL",37,0) D XML^EDPX("") "RTN","EDPBSL",38,0) Q "RTN","EDPBSL",39,0) SAVE(EDPAREA,REQ) ; save the selection changes "RTN","EDPBSL",40,0) N CTYP,SET,SETNM,CODE,X,EDPERR,TOKEN,LOCKERR "RTN","EDPBSL",41,0) ; "RTN","EDPBSL",42,0) S TOKEN=$G(REQ("selectionToken",1)) "RTN","EDPBSL",43,0) D SAVEL^EDPBLK(EDPAREA,"selection",.TOKEN,.LOCKERR) ; save selection config -- LOCK "RTN","EDPBSL",44,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(EDPAREA) Q "RTN","EDPBSL",45,0) ; "RTN","EDPBSL",46,0) S EDPERR="" "RTN","EDPBSL",47,0) F CTYP="status","disposition","delay","arrival" D "RTN","EDPBSL",48,0) . I $E($O(REQ(CTYP)),1,$L(CTYP))'=CTYP Q "RTN","EDPBSL",49,0) . S SETNM=EDPSTA_"."_CTYP,SET=$O(^EDPB(233.2,"B",SETNM,0)) "RTN","EDPBSL",50,0) . I 'SET D NEWSET(SETNM) S SET=$O(^EDPB(233.2,"B",SETNM,0)) "RTN","EDPBSL",51,0) . D CLEARSET(SET) "RTN","EDPBSL",52,0) . S X=CTYP F S X=$O(REQ(X)) Q:$E(X,1,$L(CTYP))'=CTYP D "RTN","EDPBSL",53,0) . . K CODE S CODE="" D NVPARSE^EDPX(.CODE,REQ(X,1)) "RTN","EDPBSL",54,0) . . ; I CODE("id")>0 D UPDCODE(CTYP,.CODE) -- want to keep codes matched to nat'l --KCM "RTN","EDPBSL",55,0) . . I CODE("id")<1 D ADDCODE(CTYP,.CODE) "RTN","EDPBSL",56,0) . . D ADD2SET(SET,.CODE) "RTN","EDPBSL",57,0) D SAVEU^EDPBLK(EDPAREA,"selection",.TOKEN) ; save selection config -- UNLOCK "RTN","EDPBSL",58,0) ; "RTN","EDPBSL",59,0) I $L(EDPERR) D SAVERR^EDPX("fail",EDPERR) Q "RTN","EDPBSL",60,0) D XML^EDPX("") "RTN","EDPBSL",61,0) D LOAD(EDPAREA) "RTN","EDPBSL",62,0) S ^EDPB(231.9,EDPAREA,231)=$H ; update choices timestamp "RTN","EDPBSL",63,0) Q "RTN","EDPBSL",64,0) NEWSET(SETNM) ; Create a new code set for a site "RTN","EDPBSL",65,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBSL",66,0) S FDA(233.2,"+1,",.01)=SETNM "RTN","EDPBSL",67,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBSL",68,0) I $D(DIERR) S EDPERR=EDPERR_"new code set failed;" "RTN","EDPBSL",69,0) Q "RTN","EDPBSL",70,0) CLEARSET(SET) ; Clear the CODES mulitple "RTN","EDPBSL",71,0) I '$O(^EDPB(233.2,SET,1,0)) Q ; no child nodes "RTN","EDPBSL",72,0) N DA,DIK S DA=0,DA(1)=SET,DIK="^EDPB(233.2,"_DA(1)_",1," "RTN","EDPBSL",73,0) F S DA=$O(^EDPB(233.2,SET,1,DA)) Q:'DA D ^DIK "RTN","EDPBSL",74,0) Q "RTN","EDPBSL",75,0) UPDCODE(CTYP,X) ; Update an existing code in the TRACKING CODE file "RTN","EDPBSL",76,0) Q:+$G(X("id"))'>0 "RTN","EDPBSL",77,0) N OLD,DIFF,I "RTN","EDPBSL",78,0) S OLD=$G(^EDPB(233.1,+$G(X("id")),0)),DIFF=0 "RTN","EDPBSL",79,0) F I="2^show","3^abbr","5^flag" I $P(OLD,U,+I)'=$G(X($P(I,U,2))) S DIFF=1 Q "RTN","EDPBSL",80,0) Q:'DIFF ;no change "RTN","EDPBSL",81,0) I $E(OLD,1,4)="edp." S X("id")=0 D ADDCODE(CTYP,.X) Q "RTN","EDPBSL",82,0) ; update local code "RTN","EDPBSL",83,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBSL",84,0) S FDAIEN=+X("id")_"," "RTN","EDPBSL",85,0) S FDA(233.1,FDAIEN,.02)=X("show") "RTN","EDPBSL",86,0) S FDA(233.1,FDAIEN,.03)=X("abbr") "RTN","EDPBSL",87,0) S FDA(233.1,FDAIEN,.05)=X("flag") "RTN","EDPBSL",88,0) D FILE^DIE("","FDA","ERR") "RTN","EDPBSL",89,0) I $D(DIERR) S EDPERR=EDPERR_"update code "_NAME_"failed;" "RTN","EDPBSL",90,0) S X("nm")=$P(OLD,U) "RTN","EDPBSL",91,0) Q "RTN","EDPBSL",92,0) ADDCODE(CTYP,X) ; Add a new code to the TRACKING CODE file "RTN","EDPBSL",93,0) Q:X("id")'=0 "RTN","EDPBSL",94,0) N NAME,DNAME,I "RTN","EDPBSL",95,0) S NAME=EDPSTA_"."_CTYP_"."_$TR(X("show")," ","") "RTN","EDPBSL",96,0) I $O(^EDPB(233.1,"B",NAME,0)) D "RTN","EDPBSL",97,0) . F I=1:1:99 Q:'$O(^EDPB(233.1,"B",NAME_I,0)) "RTN","EDPBSL",98,0) . S NAME=NAME_I "RTN","EDPBSL",99,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBSL",100,0) S FDA(233.1,"+1,",.01)=NAME "RTN","EDPBSL",101,0) S FDA(233.1,"+1,",.02)=X("show") "RTN","EDPBSL",102,0) S FDA(233.1,"+1,",.03)=X("abbr") "RTN","EDPBSL",103,0) S FDA(233.1,"+1,",.05)=X("flag") "RTN","EDPBSL",104,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBSL",105,0) I $D(DIERR) S EDPERR=EDPERR_"add code "_NAME_"failed;" "RTN","EDPBSL",106,0) S X("id")=FDAIEN(1),X("nm")=NAME "RTN","EDPBSL",107,0) Q "RTN","EDPBSL",108,0) ADD2SET(SET,X) ; Add a new code to the CODES multiple "RTN","EDPBSL",109,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBSL",110,0) S FDA(233.21,"+1,"_SET_",",.01)=X("seq") "RTN","EDPBSL",111,0) S FDA(233.21,"+1,"_SET_",",.02)=X("id") "RTN","EDPBSL",112,0) S FDA(233.21,"+1,"_SET_",",.03)=X("inact") "RTN","EDPBSL",113,0) S FDA(233.21,"+1,"_SET_",",.04)=X("show") "RTN","EDPBSL",114,0) S FDA(233.21,"+1,"_SET_",",.05)=X("abbr") "RTN","EDPBSL",115,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBSL",116,0) I $D(DIERR) S EDPERR=EDPERR_"add to set "_X("show")_" failed;" "RTN","EDPBSL",117,0) Q "RTN","EDPBST") 0^31^B8664749 "RTN","EDPBST",1,0) EDPBST ;SLC/KCM - Staff Configuration "RTN","EDPBST",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPBST",3,0) ; "RTN","EDPBST",4,0) MATCH(X) ; Return matching providers "RTN","EDPBST",5,0) Q "RTN","EDPBST",6,0) LOAD(AREA) ; Return nurse and provider sources, staff config "RTN","EDPBST",7,0) N TOKEN "RTN","EDPBST",8,0) D READL^EDPBLK(AREA,"staff",.TOKEN) ; read staff config -- LOCK "RTN","EDPBST",9,0) D XML^EDPX(""_TOKEN_"") "RTN","EDPBST",10,0) D XML^EDPX(""),ACTIVE(AREA,"P"),XML^EDPX("") "RTN","EDPBST",11,0) D XML^EDPX(""),ACTIVE(AREA,"R"),XML^EDPX("") "RTN","EDPBST",12,0) D XML^EDPX(""),ACTIVE(AREA,"N"),XML^EDPX("") "RTN","EDPBST",13,0) D READU^EDPBLK(AREA,"staff",.TOKEN) ; read staff config -- UNLOCK "RTN","EDPBST",14,0) Q "RTN","EDPBST",15,0) ACTIVE(AREA,ROLE) ; build list of active for a role "RTN","EDPBST",16,0) N IEN,X0,X,EDPNURS "RTN","EDPBST",17,0) I ROLE="N" S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN") "RTN","EDPBST",18,0) S IEN=0 F S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN D "RTN","EDPBST",19,0) . S X0=^EDPB(231.7,IEN,0) "RTN","EDPBST",20,0) . I '$$ALLOW^EDPFPER(+X0,ROLE) Q "RTN","EDPBST",21,0) . S X("duz")=$P(X0,U) "RTN","EDPBST",22,0) . S X("nm")=$P(^VA(200,X("duz"),0),U) "RTN","EDPBST",23,0) . S X("role")=$P(X0,U,6) "RTN","EDPBST",24,0) . S X("itl")=$P(^VA(200,X("duz"),0),U,2) "RTN","EDPBST",25,0) . S X("clr")=$P(X0,U,8) "RTN","EDPBST",26,0) . D XML^EDPX($$XMLA^EDPX("staff",.X)) "RTN","EDPBST",27,0) Q "RTN","EDPBST",28,0) SAVE(REQ) ; save updated staff members "RTN","EDPBST",29,0) N X,STAFF,ERR,EDPAREA,TOKEN,LOCKERR "RTN","EDPBST",30,0) S EDPAREA=$G(REQ("area",1)) "RTN","EDPBST",31,0) I EDPAREA="" D SAVERR^EDPX("fail","Missing Area") Q "RTN","EDPBST",32,0) ; "RTN","EDPBST",33,0) S TOKEN=$G(REQ("staffToken",1)) "RTN","EDPBST",34,0) D SAVEL^EDPBLK(EDPAREA,"staff",.TOKEN,.LOCKERR) ; save staff config -- LOCK "RTN","EDPBST",35,0) I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(EDPAREA) Q "RTN","EDPBST",36,0) ; "RTN","EDPBST",37,0) S X="staff-",ERR="" "RTN","EDPBST",38,0) F S X=$O(REQ(X)) Q:$E(X,1,6)'="staff-" D "RTN","EDPBST",39,0) . K STAFF S STAFF="" "RTN","EDPBST",40,0) . D NVPARSE^EDPX(.STAFF,REQ(X,1)) "RTN","EDPBST",41,0) . I STAFF("chg") D UPD(.STAFF,.ERR) "RTN","EDPBST",42,0) D SAVEU^EDPBLK(EDPAREA,"staff",.TOKEN) ; save staff config -- UNLOCK "RTN","EDPBST",43,0) ; "RTN","EDPBST",44,0) I $L(ERR) D SAVERR^EDPX("fail",ERR) Q "RTN","EDPBST",45,0) D XML^EDPX("") "RTN","EDPBST",46,0) D LOAD(EDPAREA) "RTN","EDPBST",47,0) S ^EDPB(231.9,EDPAREA,231)=$H ; update choices timestamp "RTN","EDPBST",48,0) Q "RTN","EDPBST",49,0) UPD(FLD,ERRMSG) ; Add/Update Record (expects EDPAREA, EDPSITE to be defined) "RTN","EDPBST",50,0) N EDPIEN "RTN","EDPBST",51,0) S EDPIEN=$O(^EDPB(231.7,"AD",EDPSITE,EDPAREA,+FLD("duz"),0))_"," "RTN","EDPBST",52,0) I 'EDPIEN,FLD("inact") Q ; don't add inactive selection "RTN","EDPBST",53,0) I 'EDPIEN S EDPIEN="+1," "RTN","EDPBST",54,0) ; "RTN","EDPBST",55,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPBST",56,0) S FDA(231.7,EDPIEN,.01)=FLD("duz") "RTN","EDPBST",57,0) S FDA(231.7,EDPIEN,.02)=EDPSITE "RTN","EDPBST",58,0) S FDA(231.7,EDPIEN,.03)=EDPAREA "RTN","EDPBST",59,0) S FDA(231.7,EDPIEN,.04)=FLD("inact") "RTN","EDPBST",60,0) S FDA(231.7,EDPIEN,.06)=FLD("role") "RTN","EDPBST",61,0) ;S FDA(231.7,EDPIEN,.07)=FLD("itl") --NtoL "RTN","EDPBST",62,0) S FDA(231.7,EDPIEN,.08)=FLD("clr") "RTN","EDPBST",63,0) I EDPIEN="+1," D "RTN","EDPBST",64,0) . D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPBST",65,0) . I $D(DIERR) S ERRMSG=ERRMSG_"Adding "_FLD("name")_" failed. " "RTN","EDPBST",66,0) E D "RTN","EDPBST",67,0) . D FILE^DIE("","FDA","ERR") "RTN","EDPBST",68,0) . I $D(DIERR) S ERRMSG=ERRMSG_"Updating "_FLD("name")_" failed. " "RTN","EDPBST",69,0) Q "RTN","EDPCBRD") 0^32^B4350223 "RTN","EDPCBRD",1,0) EDPCBRD ;SLC/KCM - Controller for ED Tracking Board "RTN","EDPCBRD",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCBRD",3,0) ; "RTN","EDPCBRD",4,0) RPC(EDPXML,SESS,PARAMS) ; Process request via RPC instead of CSP "RTN","EDPCBRD",5,0) N X,REQ,EDPSITE,EDPUSER,EDPDBUG "RTN","EDPCBRD",6,0) K EDPXML "RTN","EDPCBRD",7,0) S EDPUSER=$P($G(SESS),U),EDPSTA=$P($G(SESS),U,2),EDPSITE=$$IEN^XUAF4(EDPSTA) "RTN","EDPCBRD",8,0) S X="" F S X=$O(PARAMS(X)) Q:X="" S REQ(X,1)=PARAMS(X) "RTN","EDPCBRD",9,0) S EDPDBUG=$$DEBUG^EDPCDBG("board") "RTN","EDPCBRD",10,0) I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS) "RTN","EDPCBRD",11,0) ; "RTN","EDPCBRD",12,0) COMMON ; Come here for both CSP and RPC Mode "RTN","EDPCBRD",13,0) ; "RTN","EDPCBRD",14,0) N EDPFAIL,CMD "RTN","EDPCBRD",15,0) S CMD=$G(REQ("command",1)) "RTN","EDPCBRD",16,0) I $L($G(REQ("machine",1))) D G:$D(EDPXML)>0 OUT ; exit on error "RTN","EDPCBRD",17,0) . N BRD "RTN","EDPCBRD",18,0) . S REQ("machine",1)=$$LOW^XLFSTR(REQ("machine",1)) "RTN","EDPCBRD",19,0) . S BRD=$$GET^XPAR(EDPSITE_";DIC(4,","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I") "RTN","EDPCBRD",20,0) . I '$L(BRD) D XML^EDPX("Computer name not found.") Q "RTN","EDPCBRD",21,0) . S REQ("board",1)=BRD "RTN","EDPCBRD",22,0) ; "RTN","EDPCBRD",23,0) ; switch on command "RTN","EDPCBRD",24,0) ; "RTN","EDPCBRD",25,0) ; --------------------------------- "RTN","EDPCBRD",26,0) ; "RTN","EDPCBRD",27,0) ; initTracking "RTN","EDPCBRD",28,0) ; return ... "RTN","EDPCBRD",29,0) I CMD="initTracking" D DFLTAREA^EDPQAR($$VAL("area")) G OUT "RTN","EDPCBRD",30,0) ; "RTN","EDPCBRD",31,0) ; --------------------------------- "RTN","EDPCBRD",32,0) ; "RTN","EDPCBRD",33,0) ; initDisplayBoard "RTN","EDPCBRD",34,0) ; return "RTN","EDPCBRD",35,0) ; ...... "RTN","EDPCBRD",36,0) ; ... "RTN","EDPCBRD",37,0) I CMD="initDisplayBoard" D G OUT "RTN","EDPCBRD",38,0) . D GET^EDPQDBS($$VAL("area"),$$VAL("board")) "RTN","EDPCBRD",39,0) . D GET^EDPQDB($$VAL("area"),$$VAL("board"),-1) "RTN","EDPCBRD",40,0) ; "RTN","EDPCBRD",41,0) ; --------------------------------- "RTN","EDPCBRD",42,0) ; "RTN","EDPCBRD",43,0) ; refreshDisplayBoard "RTN","EDPCBRD",44,0) ; return ... "RTN","EDPCBRD",45,0) I CMD="refreshDisplayBoard" D G OUT "RTN","EDPCBRD",46,0) . D GET^EDPQDB($$VAL("area"),$$VAL("board"),$$VAL("last")) "RTN","EDPCBRD",47,0) ; "RTN","EDPCBRD",48,0) ; --------------------------------- "RTN","EDPCBRD",49,0) ; else "RTN","EDPCBRD",50,0) D XML^EDPX("") "RTN","EDPCBRD",51,0) ; end switch "RTN","EDPCBRD",52,0) ; "RTN","EDPCBRD",53,0) OUT ; output the XML "RTN","EDPCBRD",54,0) I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML) "RTN","EDPCBRD",55,0) I $L($G(EDPHTTP)) D ; if in CSP mode "RTN","EDPCBRD",56,0) . U EDPHTTP "RTN","EDPCBRD",57,0) . W "",! "RTN","EDPCBRD",58,0) . N I S I=0 F S I=$O(EDPXML(I)) Q:'I W EDPXML(I),! "RTN","EDPCBRD",59,0) . W "",! "RTN","EDPCBRD",60,0) END Q "RTN","EDPCBRD",61,0) ; "RTN","EDPCBRD",62,0) VAL(X) ; return value from request "RTN","EDPCBRD",63,0) Q $G(REQ(X,1)) "RTN","EDPCDBG") 0^53^B4038807 "RTN","EDPCDBG",1,0) EDPCDBG ;SLC/KCM - Debugging for Controller "RTN","EDPCDBG",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCDBG",3,0) ; "RTN","EDPCDBG",4,0) DEBUG(SWFID) ; return TRUE if debugging "RTN","EDPCDBG",5,0) N CTS,DTS,DIF "RTN","EDPCDBG",6,0) S CTS=$H,DTS=$$GET^XPAR("SYS","EDPF DEBUG START TIME",1,"I") "RTN","EDPCDBG",7,0) Q:'DTS 0 ;no debug param "RTN","EDPCDBG",8,0) Q:($P(CTS,",")'=$P(DTS,",")) 0 ;not the same day "RTN","EDPCDBG",9,0) S DIF=$P(CTS,",",2)-$P(DTS,",",2) "RTN","EDPCDBG",10,0) I DIF<0 Q 0 ;future debug time "RTN","EDPCDBG",11,0) I DIF<1800 Q $$NEXTSEQ(SWFID) ;TRUE, within 30 minutes of start "RTN","EDPCDBG",12,0) Q 0 "RTN","EDPCDBG",13,0) ; "RTN","EDPCDBG",14,0) NEXTSEQ(LOGID) ; return sequence for this session as EDPF-DEBUG-LOG-swfid^sequence "RTN","EDPCDBG",15,0) S:'$L(LOGID) LOGID="init" "RTN","EDPCDBG",16,0) I '$D(^XTMP("EDP-DEBUG-LOG",0)) S ^XTMP("EDP-DEBUG-LOG",0)=$$FMADD^XLFDT(DT,1)_U_DT_U_"ED debug log" "RTN","EDPCDBG",17,0) L +^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"):2 E Q 0 "RTN","EDPCDBG",18,0) S ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")=+$G(^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"))+1 "RTN","EDPCDBG",19,0) L -^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ") "RTN","EDPCDBG",20,0) Q ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")_U_LOGID "RTN","EDPCDBG",21,0) ; "RTN","EDPCDBG",22,0) PUTREQ(SEQ,REQ) ; save the request at this sequence number "RTN","EDPCDBG",23,0) M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"REQ")=REQ "RTN","EDPCDBG",24,0) Q "RTN","EDPCDBG",25,0) PUTXML(SEQ,XML) ; save the XML result at this sequence number "RTN","EDPCDBG",26,0) M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"XML")=XML "RTN","EDPCDBG",27,0) Q "RTN","EDPCDBG",28,0) ; "RTN","EDPCDBG",29,0) SETON ; turn on debugging for EDIS "RTN","EDPCDBG",30,0) N DIR,X,Y "RTN","EDPCDBG",31,0) W !,"Enable EDIS Debugging Log" "RTN","EDPCDBG",32,0) W !,"Logging will occur for 30 minutes after start time." "RTN","EDPCDBG",33,0) W !,"Log is stored in ^XTMP(""EDP-DEBUG-LOG"")",! "RTN","EDPCDBG",34,0) S DIR(0)="DO^::EFR" "RTN","EDPCDBG",35,0) S DIR("A")="Logging Start Time" "RTN","EDPCDBG",36,0) S DIR("B")="NOW" "RTN","EDPCDBG",37,0) D ^DIR "RTN","EDPCDBG",38,0) Q:'Y "RTN","EDPCDBG",39,0) K ^XTMP("EDP-DEBUG-LOG") "RTN","EDPCDBG",40,0) D EN^XPAR("SYS","EDPF DEBUG START TIME",1,$$FMTH^XLFDT(Y)) "RTN","EDPCDBG",41,0) Q "RTN","EDPCDBG",42,0) SETOFF ; turn off debugging for EDIS "RTN","EDPCDBG",43,0) W !,"EDIS Debugging Log Stopped" "RTN","EDPCDBG",44,0) D DEL^XPAR("SYS","EDPF DEBUG START TIME",1) "RTN","EDPCDBG",45,0) Q "RTN","EDPCONV") 0^24^B47887788 "RTN","EDPCONV",1,0) EDPCONV ;SLC/MKB - Process incoming mail to convert local ED Visits "RTN","EDPCONV",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCONV",3,0) ; "RTN","EDPCONV",4,0) AREA(DIV) ; -- Return #231.9 ien for DIVision (#4 ien) "RTN","EDPCONV",5,0) Q +$O(^EDPB(231.9,"C",DIV,0)) "RTN","EDPCONV",6,0) ; "RTN","EDPCONV",7,0) VST(OLD) ; -- Copy OLD(node) ER visit entry into ^EDP(230) "RTN","EDPCONV",8,0) N X,I,EDPY,EDPSITE,EDPDIFF,EDPAREA,EDPSTA,EDPLOG,EDPI,PNM,SSN "RTN","EDPCONV",9,0) S EDPSITE=$G(OLD("SITE")),X=$G(OLD("TZ")),EDPDIFF=0 ;$$TZONE(X) "RTN","EDPCONV",10,0) S EDPAREA=$$AREA(EDPSITE) Q:EDPAREA<1 "RTN","EDPCONV",11,0) S EDPSTA=$$STA^XUAF4(EDPSITE) ;station number "RTN","EDPCONV",12,0) F I=0,1,2,3,4,6,9 S OLD(I)=$G(OLD(I)) ;defined "RTN","EDPCONV",13,0) S X=$P(OLD(0),U,5),EDPY=$$NEW(230,X) Q:EDPY<1 "RTN","EDPCONV",14,0) S PNM=$P(OLD(0),U),SSN=$P(OLD(0),U,3) ;patient name, ssn "RTN","EDPCONV",15,0) S EDPLOG(0)=X_U_EDPSITE_U_EDPAREA_U_PNM_U_SSN_U_$P(OLD(6),U,2)_U_$G(OLD("CLOSED"))_U_$P(OLD(4),U,4,5)_U_$$ARR($P(OLD(0),U,6))_U_$$PID(PNM,SSN) ;_U_EDPDIFF "RTN","EDPCONV",16,0) S X=$P(OLD(9),U,3) S:'X X=$P(OLD(6),U,3) ;disposition "RTN","EDPCONV",17,0) S EDPLOG(1)=$P(OLD(1),U)_U_$$DISP(X)_U_$P(OLD(9),U,2)_U_$P(OLD(9),U)_U_$$DEL($P(OLD(4),U,7)) "RTN","EDPCONV",18,0) S X=$P(OLD(2),U) S:$L(X) EDPLOG(2)=X "RTN","EDPCONV",19,0) S EDPLOG(3)=U_$$STS($P(OLD(0),U,4))_U_$$ACU($P(OLD(4),U,3))_U_$$LOC($P(OLD(3),U,2))_U_$P(OLD(4),U)_U_$P(OLD(4),U,2)_U_$P(OLD(4),U,6)_U_$P(OLD(6),U) "RTN","EDPCONV",20,0) I $D(OLD(8)) M EDPLOG(4)=OLD(8) S $P(EDPLOG(4,0),U,2)="230.04A" "RTN","EDPCONV",21,0) ; Save/Xref log entry "RTN","EDPCONV",22,0) M ^EDP(230,EDPY)=EDPLOG "RTN","EDPCONV",23,0) D XREF(230,EDPY) "RTN","EDPCONV",24,0) ; "RTN","EDPCONV",25,0) ; Set History from Movement nodes "RTN","EDPCONV",26,0) S EDPI="MVT" F S EDPI=$O(OLD(EDPI)) Q:EDPI'?1"MVT"1.N D HIST(EDPI,EDPY) "RTN","EDPCONV",27,0) ; "RTN","EDPCONV",28,0) ; Create Orders list for active visits "RTN","EDPCONV",29,0) I '$G(OLD("CLOSED")) S X=EDPLOG(0) D ORDERS(EDPY,X) "RTN","EDPCONV",30,0) ; "RTN","EDPCONV",31,0) S OLD(230)=EDPY ;return new ien "RTN","EDPCONV",32,0) Q "RTN","EDPCONV",33,0) ; "RTN","EDPCONV",34,0) HIST(MVTI,LOG) ; -- Copy OLD(MVTI) into ^EDP(230.1) "RTN","EDPCONV",35,0) N EDPY,MVT,ACT "RTN","EDPCONV",36,0) S EDPY=$$NEW(230.1,LOG) Q:EDPY<1 "RTN","EDPCONV",37,0) S MVT=OLD(MVTI) "RTN","EDPCONV",38,0) S ACT(0)=LOG_U_$P(MVT,U,2)_U_U_$P($G(^EDP(230,LOG,0)),U,4,6) "RTN","EDPCONV",39,0) S ACT(3)=U_$$STS($P(MVT,U,3))_U_$$ACU($P(MVT,U,4))_U_$$LOC($P(MVT,U,5))_U_$P(MVT,U,6,8) "RTN","EDPCONV",40,0) ; Save/Xref history "RTN","EDPCONV",41,0) M ^EDP(230.1,EDPY)=ACT "RTN","EDPCONV",42,0) D XREF(230.1,EDPY) "RTN","EDPCONV",43,0) Q "RTN","EDPCONV",44,0) ; "RTN","EDPCONV",45,0) NEW(FILE,X) ; -- Return ien of new entry in FILE "RTN","EDPCONV",46,0) N DO,DIC,DA,Y "RTN","EDPCONV",47,0) S DIC="^EDP("_FILE_",",DIC(0)="LF" D FILE^DICN "RTN","EDPCONV",48,0) Q +Y "RTN","EDPCONV",49,0) ; "RTN","EDPCONV",50,0) XREF(FILE,DA) ; -- Set all xrefs for DA in FILE "RTN","EDPCONV",51,0) N DIK "RTN","EDPCONV",52,0) S DIK="^EDP("_FILE_"," D IX1^DIK "RTN","EDPCONV",53,0) Q "RTN","EDPCONV",54,0) ; "RTN","EDPCONV",55,0) PID(NM,ID) ; -- Return brief id (L0000) for patient "RTN","EDPCONV",56,0) N Y S Y=$E(NM)_$E(ID,6,9) "RTN","EDPCONV",57,0) Q Y "RTN","EDPCONV",58,0) ; "RTN","EDPCONV",59,0) TZONE(X) ; -- Return #minutes local offset for time zone "RTN","EDPCONV",60,0) N Y S Y=$E(X)_(60*$E(X,2,3)+$E(X,4,5)) "RTN","EDPCONV",61,0) Q Y "RTN","EDPCONV",62,0) ; "RTN","EDPCONV",63,0) ACU(X) ; -- Return[/add] #233.1 ien for Acuity X "RTN","EDPCONV",64,0) I $G(X)="" Q "" "RTN","EDPCONV",65,0) N Y,NODE S NODE=$G(OLD("ACU"_+X)) Q:NODE="" $$NOVALUE "RTN","EDPCONV",66,0) S X=$P(NODE,U,2),Y="" "RTN","EDPCONV",67,0) S:$L(X) Y=+$O(^EDPB(233.1,"AB","acuity",X,0)) Q:Y Y "RTN","EDPCONV",68,0) ; add local item "RTN","EDPCONV",69,0) N FDA,FDAIEN,DIERR,ERR,NM "RTN","EDPCONV",70,0) S NM=$P(NODE,U),NM=$S(NM["-":$P(NM,"-",2),1:NM) "RTN","EDPCONV",71,0) S FDA(233.1,"+1,",.01)=EDPSTA_".acuity."_$$LOW^XLFSTR(NM) "RTN","EDPCONV",72,0) S FDA(233.1,"+1,",.02)=X "RTN","EDPCONV",73,0) S FDA(233.1,"+1,",.03)=X "RTN","EDPCONV",74,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",75,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",76,0) Q Y "RTN","EDPCONV",77,0) ; "RTN","EDPCONV",78,0) STS(X) ; -- Return[/add] #233.1 ien for Status X "RTN","EDPCONV",79,0) I $G(X)="" Q "" "RTN","EDPCONV",80,0) N Y,NODE "RTN","EDPCONV",81,0) S NODE=$G(OLD("STS"_+X)),Y="" Q:NODE="" $$NOVALUE "RTN","EDPCONV",82,0) S X=$P(NODE,U,1) S:$L(X) Y=+$O(^EDPB(233.1,"AC","status",X,0)) Q:Y Y "RTN","EDPCONV",83,0) S X=$P(NODE,U,4) S:$L(X) Y=+$O(^EDPB(233.1,"AB","status",X,0)) Q:Y Y "RTN","EDPCONV",84,0) ; add local item "RTN","EDPCONV",85,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPCONV",86,0) S FDA(233.1,"+1,",.01)=EDPSTA_".status."_$$LOW^XLFSTR(X) "RTN","EDPCONV",87,0) S FDA(233.1,"+1,",.02)=$P(NODE,U) ;text "RTN","EDPCONV",88,0) S FDA(233.1,"+1,",.03)=X ;display/abbreviation "RTN","EDPCONV",89,0) S:$P(NODE,U,6)="Y" FDA(233.1,"+1,",.05)="A" ;admission flag "RTN","EDPCONV",90,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",91,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",92,0) Q Y "RTN","EDPCONV",93,0) ; "RTN","EDPCONV",94,0) DEL(X) ; -- Return[/add] #233.1 ien for Delay Reason X "RTN","EDPCONV",95,0) I $G(X)="" Q "" "RTN","EDPCONV",96,0) N Y,NODE "RTN","EDPCONV",97,0) S NODE=$G(OLD("DEL"_+X)),Y="" Q:NODE="" $$NOVALUE "RTN","EDPCONV",98,0) S X=$P(NODE,U,1) S:$L(X) Y=+$O(^EDPB(233.1,"AC","delay",X,0)) Q:Y Y "RTN","EDPCONV",99,0) S X=$P(NODE,U,3) S:$L(X) Y=+$O(^EDPB(233.1,"AB","delay",X,0)) Q:Y Y "RTN","EDPCONV",100,0) ; add local item "RTN","EDPCONV",101,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPCONV",102,0) S FDA(233.1,"+1,",.01)=EDPSTA_".delay."_$$LOW^XLFSTR(X) "RTN","EDPCONV",103,0) S FDA(233.1,"+1,",.02)=$P(NODE,U) ;name "RTN","EDPCONV",104,0) S FDA(233.1,"+1,",.03)=$P(NODE,U,3) ;abbreviation "RTN","EDPCONV",105,0) S FDA(233.1,"+1,",.05)=$P(NODE,U,5) ;report flag "RTN","EDPCONV",106,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",107,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",108,0) Q Y "RTN","EDPCONV",109,0) ; "RTN","EDPCONV",110,0) ARR(X) ; -- Return[/add] #233.1 ien for Arrival Mode X "RTN","EDPCONV",111,0) I $G(X)="" Q "" "RTN","EDPCONV",112,0) N Y,NODE "RTN","EDPCONV",113,0) S NODE=$G(OLD("ARR"_+X)),Y="" Q:NODE="" $$NOVALUE "RTN","EDPCONV",114,0) S X=$P($P(NODE,U)," ") S:$L(X) Y=+$O(^EDPB(233.1,"AC","source",X,0)) Q:Y Y "RTN","EDPCONV",115,0) ; add local item "RTN","EDPCONV",116,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPCONV",117,0) S FDA(233.1,"+1,",.01)=EDPSTA_".source."_$$LOW^XLFSTR(X) "RTN","EDPCONV",118,0) S FDA(233.1,"+1,",.02)=X "RTN","EDPCONV",119,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",120,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",121,0) Q Y "RTN","EDPCONV",122,0) ; "RTN","EDPCONV",123,0) DISP(X) ; -- Return[/add] #233.1 ien for Disposition code X "RTN","EDPCONV",124,0) I $G(X)="" Q "" "RTN","EDPCONV",125,0) N Y,NODE "RTN","EDPCONV",126,0) S NODE=$G(OLD("DIS"_X)),Y="" Q:NODE="" $$NOVALUE "RTN","EDPCONV",127,0) S:X X=$P(NODE,U,5) ;ien -> abbreviation "RTN","EDPCONV",128,0) I $L(X) S Y=+$O(^EDPB(233.1,"AB","disposition",X,0)) Q:Y Y "RTN","EDPCONV",129,0) E S X=$P(NODE,U) S:$L(X) Y=+$O(^EDPB(233.1,"AC","disposition",X,0)) Q:Y Y "RTN","EDPCONV",130,0) ; add local item "RTN","EDPCONV",131,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPCONV",132,0) S X=$P($P(NODE,U)," ") ;1st word, for name "RTN","EDPCONV",133,0) S FDA(233.1,"+1,",.01)=EDPSTA_".disposition."_$$LOW^XLFSTR(X) "RTN","EDPCONV",134,0) S FDA(233.1,"+1,",.02)=$P(NODE,U) ;Display Name "RTN","EDPCONV",135,0) S FDA(233.1,"+1,",.03)=$P(NODE,U,5) ;Abbreviation "RTN","EDPCONV",136,0) S:$P(NODE,U,7) FDA(233.1,"+1,",.05)="M" ;Missed Opportunity "RTN","EDPCONV",137,0) S:$P(NODE,U,6) FDA(233.1,"+1,",.05)="A" ;Admission "RTN","EDPCONV",138,0) S:$P(NODE,U,8) FDA(233.1,"+1,",.05)="VA" ;VA Admission "RTN","EDPCONV",139,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",140,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",141,0) Q Y "RTN","EDPCONV",142,0) ; "RTN","EDPCONV",143,0) LOC(X) ; -- Return[/add] #231.8 ien for Location X "RTN","EDPCONV",144,0) I $G(X)="" Q "" "RTN","EDPCONV",145,0) N Y,NODE "RTN","EDPCONV",146,0) S NODE=$G(OLD("LOC"_+X)) S:NODE="" NODE="UNKNOWN^UNK^^0^^^0" "RTN","EDPCONV",147,0) S X=$P(NODE,U,2),Y="" "RTN","EDPCONV",148,0) S:$L(X) Y=+$O(^EDPB(231.8,"AC",EDPSITE,EDPAREA,X,0)) Q:Y Y "RTN","EDPCONV",149,0) ; add local item "RTN","EDPCONV",150,0) N FDA,FDAIEN,DIERR,ERR,X "RTN","EDPCONV",151,0) S FDA(231.8,"+1,",.01)=$TR($P(NODE,U),"-") ;Name "RTN","EDPCONV",152,0) S FDA(231.8,"+1,",.02)=EDPSTA ;Station# "RTN","EDPCONV",153,0) S FDA(231.8,"+1,",.03)=EDPAREA ;Area ien "RTN","EDPCONV",154,0) S FDA(231.8,"+1,",.04)='$P(NODE,U,4) ;Inactive "RTN","EDPCONV",155,0) S FDA(231.8,"+1,",.05)=$P(NODE,U,6) ;Sequence "RTN","EDPCONV",156,0) S FDA(231.8,"+1,",.06)=$P(NODE,U,2) ;Display Name "RTN","EDPCONV",157,0) S X=$P(NODE,U,7),X=$S(X=2:0,X=0:2,1:1) "RTN","EDPCONV",158,0) S FDA(231.8,"+1,",.07)=X ;Display When "RTN","EDPCONV",159,0) S FDA(231.8,"+1,",.08)=$$STS($P(NODE,U,8)) ;Default Status ien "RTN","EDPCONV",160,0) S FDA(231.8,"+1,",.1)=$P(NODE,U,9) ;Shared Name [Room] "RTN","EDPCONV",161,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPCONV",162,0) S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"") "RTN","EDPCONV",163,0) LCQ ;exit "RTN","EDPCONV",164,0) Q Y "RTN","EDPCONV",165,0) ; "RTN","EDPCONV",166,0) NOVALUE() Q $O(^EDPB(233.1,"B","edp.reserved.novalue",0)) "RTN","EDPCONV",167,0) ; "RTN","EDPCONV",168,0) ORDERS(LOG,NODE) ; -- build Orders multiple "RTN","EDPCONV",169,0) N ORLIST,DFN,IN,OUT,ORI,ORIFN,STS,REL,PKG,X,Y,DIC,DA "RTN","EDPCONV",170,0) S DFN=+$P(NODE,U,6) Q:DFN<1 "RTN","EDPCONV",171,0) S IN=$P(NODE,U,8) Q:IN<1 Q:IN<$$FMADD^XLFDT(DT,-1) ;old "RTN","EDPCONV",172,0) S OUT=$P(NODE,U,9) S:OUT<1 OUT=$$NOW^XLFDT "RTN","EDPCONV",173,0) K ^TMP("ORR",$J) D EN^ORQ1(DFN_";DPT(",,1,,IN,OUT) S ORI=0 "RTN","EDPCONV",174,0) F S ORI=$O(^TMP("ORR",$J,ORLIST,ORI)) Q:ORI<1 S ORIFN=+$G(^(ORI)) D "RTN","EDPCONV",175,0) . Q:$O(^EDP(230,LOG,8,"B",ORIFN,0)) "RTN","EDPCONV",176,0) . S X=$$GET1^DIQ(100,ORIFN_",",5,"I") Q:(X=10)!(X=11) ;unreleased "RTN","EDPCONV",177,0) . S STS=$S("^1^2^7^12^13^14^"[(U_X_U):"C","^3^6^9^15^"[(U_X_U):"A",1:"N") "RTN","EDPCONV",178,0) . S REL=$$GET1^DIQ(100.008,"1,"_ORIFN_",",16,"I") "RTN","EDPCONV",179,0) . S X=$$GET1^DIQ(100,ORIFN_",","12:1") "RTN","EDPCONV",180,0) . S PKG=$S($E(X,1,2)="LR":"L",$E(X,1,2)="PS":"M",$E(X,1,2)="RA":"R",X="GMRC":"C",1:"A") "RTN","EDPCONV",181,0) . ; add to subfile "RTN","EDPCONV",182,0) . K X,Y,DIC,DA "RTN","EDPCONV",183,0) . S DIC="^EDP(230,"_LOG_",8,",DIC(0)="LZ",DA(1)=LOG,X=+ORIFN "RTN","EDPCONV",184,0) . S DIC("DR")=".02///"_PKG_";.03///"_STS_";.05///"_REL "RTN","EDPCONV",185,0) . ;S:$$VAL("stat") DIC("DR")=DIC("DR")_";.04///1" "RTN","EDPCONV",186,0) . D FILE^DICN "RTN","EDPCONV",187,0) K ^TMP("ORR",$J,ORLIST) "RTN","EDPCONV",188,0) Q "RTN","EDPCONV1") 0^52^B10237522 "RTN","EDPCONV1",1,0) EDPCONV1 ;SLC/MKB - Convert local ED configuration "RTN","EDPCONV1",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCONV1",3,0) ; "RTN","EDPCONV1",4,0) CONFIG(OLD) ; -- Save local OLD(NODE) configuration into ^EDPB(231.9) "RTN","EDPCONV1",5,0) N EDPSITE,TZDIFF,EDPAREA,X,X2,X3,X5,Y,NODE "RTN","EDPCONV1",6,0) S EDPSITE=$G(OLD("SITE")),X=$G(OLD("TZ")),TZDIFF=0 ;$$TZONE(X) "RTN","EDPCONV1",7,0) S EDPAREA=+$O(^EDPB(231.9,"C",EDPSITE,0)) Q:EDPAREA<1 "RTN","EDPCONV1",8,0) S X2=$G(OLD(2)),X3=$G(OLD(3)),X5=$G(OLD(5)) "RTN","EDPCONV1",9,0) ; update entry "RTN","EDPCONV1",10,0) S:$L(TZDIFF) $P(^EDPB(231.9,EDPAREA,0),U,3)=TZDIFF "RTN","EDPCONV1",11,0) S NODE=$G(^EDPB(231.9,EDPAREA,1)) "RTN","EDPCONV1",12,0) S X=$P(X5,U,1) S:$L(X) $P(NODE,U,1)=X ;Dx Reqd "RTN","EDPCONV1",13,0) S X=$P(X5,U,4) S:$L(X) $P(NODE,U,3)=X ;Disp Reqd "RTN","EDPCONV1",14,0) S X=$P(X5,U,5) S:$L(X) $P(NODE,U,4)=X ;Delay Reqd "RTN","EDPCONV1",15,0) S X=$P(X5,U,6) S:$L(X) $P(NODE,U,5)=X ;Delay Minutes "RTN","EDPCONV1",16,0) S X=$P(X2,U,4) I $L(X) D "RTN","EDPCONV1",17,0) . S Y=(+$P(X,":")*60)+$P(X,":",2) ;HH:MM -> minutes since Midnight "RTN","EDPCONV1",18,0) . S $P(NODE,U,6)=Y ;First Shift Start "RTN","EDPCONV1",19,0) S X=$P(X2,U,5) I X D "RTN","EDPCONV1",20,0) . S Y=X*60 ;hours -> minutes "RTN","EDPCONV1",21,0) . S $P(NODE,U,7)=Y ;Shift Duration "RTN","EDPCONV1",22,0) S ^EDPB(231.9,EDPAREA,1)=NODE "RTN","EDPCONV1",23,0) C1 ; Color Spec "RTN","EDPCONV1",24,0) N CSPEC,N,I,BACK,FONT "RTN","EDPCONV1",25,0) S CSPEC(1,0)="",N=1 "RTN","EDPCONV1",26,0) S I="STS" F S I=$O(OLD(I)) Q:I'?1"STS"1.N D "RTN","EDPCONV1",27,0) . S NODE=$G(OLD(I)),FONT=$P(NODE,U,2),BACK=$P(NODE,U,3) "RTN","EDPCONV1",28,0) . S X="" "RTN","EDPCONV1",30,0) . E S X=X_"1,"_$$CLR(BACK)_","_$$CLR(FONT)_""" val="""_Y_""" />" "RTN","EDPCONV1",31,0) . S N=N+1,CSPEC(N,0)=X "RTN","EDPCONV1",32,0) S I="ACU" F S I=$O(OLD(I)) Q:I'?1"ACU"1.N D "RTN","EDPCONV1",33,0) . S NODE=$G(OLD(I)),FONT=$$CLR($P(NODE,U,3)),BACK=$$CLR($P(NODE,U,4)) "RTN","EDPCONV1",34,0) . S X="" "RTN","EDPCONV1",36,0) . E S X=X_"1,"_BACK_","_FONT_""" val="""_Y_""" />" "RTN","EDPCONV1",37,0) . S N=N+1,CSPEC(N,0)=X "RTN","EDPCONV1",38,0) S N=N+1,CSPEC(N,0)="" "RTN","EDPCONV1",39,0) F I=1:1 S X=$P($T(ORDCLR+I),";",3) Q:X="ZZZZ" S N=N+1,CSPEC(N,0)=X "RTN","EDPCONV1",40,0) S CSPEC(0)="^^"_N_U_N_U_DT "RTN","EDPCONV1",41,0) K ^EDPB(231.9,EDPAREA,3) M ^(3)=CSPEC "RTN","EDPCONV1",42,0) Q "RTN","EDPCONV1",43,0) ; "RTN","EDPCONV1",44,0) CLR(X) ; -- Return code for color X "RTN","EDPCONV1",45,0) I X="CLRED" Q "0xff0000" "RTN","EDPCONV1",46,0) I X="CLBLUE" Q "0x0000ff" "RTN","EDPCONV1",47,0) I X="CLGREEN" Q "0x00ff00" "RTN","EDPCONV1",48,0) I X="CLYELLOW" Q "0xffff00" "RTN","EDPCONV1",49,0) I X="CLWHITE" Q "0xffffff" "RTN","EDPCONV1",50,0) I X="CLBLACK" Q "0x000000" "RTN","EDPCONV1",51,0) I X="CLNAVY" Q "0x000088" "RTN","EDPCONV1",52,0) I X="CLFUCHSIA" Q "0xff00ff" "RTN","EDPCONV1",53,0) I X="CLMONEYGREEN" Q "0xc0dcc0" "RTN","EDPCONV1",54,0) I X="CLSKYBLUE" Q "0xa6caf0" "RTN","EDPCONV1",55,0) I X="CLCREAM" Q "0xfffbf0" "RTN","EDPCONV1",56,0) I X="CLMAROON" Q "0x880000" "RTN","EDPCONV1",57,0) I X="CLTEAL" Q "0x008888" "RTN","EDPCONV1",58,0) I X="CLOLIVE" Q "0x888800" "RTN","EDPCONV1",59,0) Q "" "RTN","EDPCONV1",60,0) ; "RTN","EDPCONV1",61,0) ORDCLR ; -- default color scheme for order urgencies "RTN","EDPCONV1",62,0) ;; "RTN","EDPCONV1",63,0) ;; "RTN","EDPCONV1",64,0) ;; "RTN","EDPCONV1",65,0) ;; "RTN","EDPCONV1",66,0) ;; "RTN","EDPCONV1",67,0) ;; "RTN","EDPCONV1",68,0) ;; "RTN","EDPCONV1",69,0) ;; "RTN","EDPCONV1",70,0) ;; "RTN","EDPCONV1",71,0) ;; "RTN","EDPCONV1",72,0) ;;ZZZZ "RTN","EDPCONV1",73,0) Q "RTN","EDPCSV") 0^48^B906612 "RTN","EDPCSV",1,0) EDPCSV ;SLC/MKB - CSV format utilities "RTN","EDPCSV",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCSV",3,0) ; "RTN","EDPCSV",4,0) EN(REQ) ; Controller for HTTP request "RTN","EDPCSV",5,0) ; "RTN","EDPCSV",6,0) ;S:'$G(EDPTEST) $ETRAP="D ^%ZTER H" "RTN","EDPCSV",7,0) ; "RTN","EDPCSV",8,0) N EDPSITE,EDPHTTP,EDPNULL,EDPFAIL,EDPCSV,I "RTN","EDPCSV",9,0) D UESREQ^EDPX(.REQ) ; unescape the posted data "RTN","EDPCSV",10,0) ; "RTN","EDPCSV",11,0) ;D SET^EDPZCTRL ; set up the environment, use null device "RTN","EDPCSV",12,0) ; "RTN","EDPCSV",13,0) D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1) "RTN","EDPCSV",14,0) ; "RTN","EDPCSV",15,0) U EDPHTTP "RTN","EDPCSV",16,0) ;W "",! "RTN","EDPCSV",17,0) S I=0 F S I=$O(EDPCSV(I)) Q:'I W EDPCSV(I),! "RTN","EDPCSV",18,0) ;W "",! "RTN","EDPCSV",19,0) Q "RTN","EDPCSV",20,0) ; "RTN","EDPCSV",21,0) VAL(X) ; return value from request "RTN","EDPCSV",22,0) Q $G(REQ(X,1)) "RTN","EDPCSV",23,0) ; "RTN","EDPCSV",24,0) ADD(X) ; -- add line X "RTN","EDPCSV",25,0) S EDPCSV=+$G(EDPCSV)+1,EDPCSV(EDPCSV)=X "RTN","EDPCSV",26,0) Q "RTN","EDPCSV",27,0) ; "RTN","EDPCSV",28,0) BLANK ; -- add blank line "RTN","EDPCSV",29,0) S EDPCSV=+$G(EDPCSV)+1,EDPCSV(EDPCSV)="" "RTN","EDPCSV",30,0) Q "RTN","EDPCTRL") 0^34^B33410398 "RTN","EDPCTRL",1,0) EDPCTRL ;SLC/KCM - Controller for ED Tracking "RTN","EDPCTRL",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPCTRL",3,0) ; "RTN","EDPCTRL",4,0) RPC(EDPXML,PARAMS) ; Process request via RPC instead of CSP "RTN","EDPCTRL",5,0) N X,REQ,EDPSITE,EDPUSER,EDPDBUG "RTN","EDPCTRL",6,0) K EDPXML "RTN","EDPCTRL",7,0) S EDPUSER=DUZ,EDPSITE=DUZ(2),EDPSTA=$$STA^XUAF4(DUZ(2)) "RTN","EDPCTRL",8,0) S X="" F S X=$O(PARAMS(X)) Q:X="" S REQ(X,1)=PARAMS(X) "RTN","EDPCTRL",9,0) S EDPDBUG=$$DEBUG^EDPCDBG($G(PARAMS("swfID"))) "RTN","EDPCTRL",10,0) I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS) "RTN","EDPCTRL",11,0) ; "RTN","EDPCTRL",12,0) COMMON ; Come here for both CSP and RPC Mode "RTN","EDPCTRL",13,0) ; "RTN","EDPCTRL",14,0) N EDPFAIL,CMD "RTN","EDPCTRL",15,0) S CMD=$G(REQ("command",1)) "RTN","EDPCTRL",16,0) ; "RTN","EDPCTRL",17,0) ; switch on command "RTN","EDPCTRL",18,0) ; "RTN","EDPCTRL",19,0) ; --------------------------------- "RTN","EDPCTRL",20,0) ; "RTN","EDPCTRL",21,0) ; initUser "RTN","EDPCTRL",22,0) ; return "RTN","EDPCTRL",23,0) ; ... "RTN","EDPCTRL",24,0) I CMD="initUser" D G OUT "RTN","EDPCTRL",25,0) . D SESS^EDPFAA,VIEWS^EDPFAA "RTN","EDPCTRL",26,0) ; "RTN","EDPCTRL",27,0) ; --------------------------------- "RTN","EDPCTRL",28,0) ; "RTN","EDPCTRL",29,0) ; matchPatients "RTN","EDPCTRL",30,0) ; return ... "RTN","EDPCTRL",31,0) I CMD="matchPatients" D G OUT "RTN","EDPCTRL",32,0) . D MATCH^EDPFPTL($$VAL("partial")) "RTN","EDPCTRL",33,0) ; "RTN","EDPCTRL",34,0) ; --------------------------------- "RTN","EDPCTRL",35,0) ; "RTN","EDPCTRL",36,0) ; getPatientChecks "RTN","EDPCTRL",37,0) ; return "RTN","EDPCTRL",38,0) ; "RTN","EDPCTRL",39,0) ; "RTN","EDPCTRL",40,0) ; ... "RTN","EDPCTRL",41,0) I CMD="getPatientChecks" D G OUT "RTN","EDPCTRL",42,0) . D CHK^EDPFPTC($$VAL("area"),$$VAL("patient"),$$VAL("name")) "RTN","EDPCTRL",43,0) ; "RTN","EDPCTRL",44,0) ; --------------------------------- "RTN","EDPCTRL",45,0) ; "RTN","EDPCTRL",46,0) ; saveSecurityLog "RTN","EDPCTRL",47,0) ; return "RTN","EDPCTRL",48,0) I CMD="saveSecurityLog" D G OUT "RTN","EDPCTRL",49,0) . D LOG^EDPFPTC($$VAL("patient")) "RTN","EDPCTRL",50,0) ; "RTN","EDPCTRL",51,0) ; --------------------------------- "RTN","EDPCTRL",52,0) ; "RTN","EDPCTRL",53,0) ; getLexiconMatches "RTN","EDPCTRL",54,0) ; return ... "RTN","EDPCTRL",55,0) I CMD="getLexiconMatches" D G OUT "RTN","EDPCTRL",56,0) . D ICD^EDPFLEX($$VAL("text")) "RTN","EDPCTRL",57,0) ; "RTN","EDPCTRL",58,0) ; --------------------------------- "RTN","EDPCTRL",59,0) ; "RTN","EDPCTRL",60,0) ; initLogArea "RTN","EDPCTRL",61,0) ; return "RTN","EDPCTRL",62,0) ; "RTN","EDPCTRL",63,0) ; ... "RTN","EDPCTRL",64,0) I CMD="initLogArea" D G OUT "RTN","EDPCTRL",65,0) . I $L($$VAL("logEntry")) D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL) "RTN","EDPCTRL",66,0) . D PARAM^EDPQAR($$VAL("area")) "RTN","EDPCTRL",67,0) . D GET^EDPQLP($$VAL("area"),-1) ;-1 = force refresh "RTN","EDPCTRL",68,0) ; "RTN","EDPCTRL",69,0) ; --------------------------------- "RTN","EDPCTRL",70,0) ; "RTN","EDPCTRL",71,0) ; checkLogin -- OBSOLETE "RTN","EDPCTRL",72,0) ; return "RTN","EDPCTRL",73,0) I CMD="checkLogin" D SESS^EDPFAA G OUT "RTN","EDPCTRL",74,0) ; "RTN","EDPCTRL",75,0) ; --------------------------------- "RTN","EDPCTRL",76,0) ; "RTN","EDPCTRL",77,0) ; refreshLogSelector "RTN","EDPCTRL",78,0) ; return ... "RTN","EDPCTRL",79,0) I CMD="refreshLogSelector" D G OUT "RTN","EDPCTRL",80,0) . D GET^EDPQLP($$VAL("area"),$$VAL("token")) "RTN","EDPCTRL",81,0) ; "RTN","EDPCTRL",82,0) ; --------------------------------- "RTN","EDPCTRL",83,0) ; "RTN","EDPCTRL",84,0) ; switchLogEntry "RTN","EDPCTRL",85,0) ; return "RTN","EDPCTRL",86,0) ; log fields... "RTN","EDPCTRL",87,0) ; choice lists... "RTN","EDPCTRL",88,0) I CMD="switchLogEntry" D G OUT "RTN","EDPCTRL",89,0) . I $L($$VAL("logEntry")) D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL) "RTN","EDPCTRL",90,0) . D GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS")) "RTN","EDPCTRL",91,0) ; "RTN","EDPCTRL",92,0) ; --------------------------------- "RTN","EDPCTRL",93,0) ; "RTN","EDPCTRL",94,0) ; saveLogEntry "RTN","EDPCTRL",95,0) ; return "RTN","EDPCTRL",96,0) I CMD="saveLogEntry" D G OUT "RTN","EDPCTRL",97,0) . D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL) "RTN","EDPCTRL",98,0) ; "RTN","EDPCTRL",99,0) ; --------------------------------- "RTN","EDPCTRL",100,0) ; "RTN","EDPCTRL",101,0) ; addPatientToLog "RTN","EDPCTRL",102,0) ; return "RTN","EDPCTRL",103,0) ; "RTN","EDPCTRL",104,0) ; log fields... "RTN","EDPCTRL",105,0) ; choice lists... "RTN","EDPCTRL",106,0) ; ... "RTN","EDPCTRL",107,0) I CMD="addPatientToLog" D G OUT "RTN","EDPCTRL",108,0) . D ADD^EDPLOGA($$VAL("addPatient"),$$VAL("area"),$$VAL("localTime"),$$VAL("choiceTS")) "RTN","EDPCTRL",109,0) . Q:$G(EDPFAIL) "RTN","EDPCTRL",110,0) . D GET^EDPQLP($$VAL("area"),-1) "RTN","EDPCTRL",111,0) ; "RTN","EDPCTRL",112,0) ; --------------------------------- "RTN","EDPCTRL",113,0) ; "RTN","EDPCTRL",114,0) ; deleteStubEntry "RTN","EDPCTRL",115,0) ; return "RTN","EDPCTRL",116,0) I CMD="deleteStubEntry" D G OUT "RTN","EDPCTRL",117,0) . D DEL^EDPLOGA($$VAL("area"),$$VAL("logID")) "RTN","EDPCTRL",118,0) ; "RTN","EDPCTRL",119,0) ; --------------------------------- "RTN","EDPCTRL",120,0) ; "RTN","EDPCTRL",121,0) ; removeLogEntry "RTN","EDPCTRL",122,0) ; return "RTN","EDPCTRL",123,0) ; ... "RTN","EDPCTRL",124,0) I CMD="removeLogEntry" D G OUT "RTN","EDPCTRL",125,0) . D UPD^EDPLOG($$VAL("logEntry"),1) Q:$G(EDPFAIL) "RTN","EDPCTRL",126,0) . D GET^EDPQLP($$VAL("area"),-1) "RTN","EDPCTRL",127,0) ; "RTN","EDPCTRL",128,0) ; --------------------------------- "RTN","EDPCTRL",129,0) ; "RTN","EDPCTRL",130,0) ; matchClosed "RTN","EDPCTRL",131,0) ; return ... "RTN","EDPCTRL",132,0) I CMD="matchClosed" D G OUT "RTN","EDPCTRL",133,0) . D CLOSED^EDPQLP($$VAL("area"),$$VAL("partial")) "RTN","EDPCTRL",134,0) ; "RTN","EDPCTRL",135,0) ; --------------------------------- "RTN","EDPCTRL",136,0) ; "RTN","EDPCTRL",137,0) ; loadConfiguration "RTN","EDPCTRL",138,0) ; return ...... "RTN","EDPCTRL",139,0) ; ... "RTN","EDPCTRL",140,0) ; ... "RTN","EDPCTRL",141,0) ; ... "RTN","EDPCTRL",142,0) ; "RTN","EDPCTRL",143,0) ; ... "RTN","EDPCTRL",144,0) ; ... "RTN","EDPCTRL",145,0) ; ... "RTN","EDPCTRL",146,0) I CMD="loadConfiguration" D G OUT "RTN","EDPCTRL",147,0) . D LOAD^EDPBCF($$VAL("area")) "RTN","EDPCTRL",148,0) ; "RTN","EDPCTRL",149,0) ; --------------------------------- "RTN","EDPCTRL",150,0) ; "RTN","EDPCTRL",151,0) ; loadBoardConfig "RTN","EDPCTRL",152,0) ; return ... "RTN","EDPCTRL",153,0) I CMD="loadBoardConfig" D G OUT "RTN","EDPCTRL",154,0) . D LOADBRD^EDPBCF($$VAL("area"),$$VAL("boardID")) "RTN","EDPCTRL",155,0) ; "RTN","EDPCTRL",156,0) ; --------------------------------- "RTN","EDPCTRL",157,0) ; "RTN","EDPCTRL",158,0) ; saveConfigBoard "RTN","EDPCTRL",159,0) ; return "RTN","EDPCTRL",160,0) I CMD="saveConfigBoard" D G OUT "RTN","EDPCTRL",161,0) . D SAVEBRD^EDPBCF(.REQ) ; pass whole request for parsing "RTN","EDPCTRL",162,0) ; "RTN","EDPCTRL",163,0) ; --------------------------------- "RTN","EDPCTRL",164,0) ; "RTN","EDPCTRL",165,0) ; saveBedConfig "RTN","EDPCTRL",166,0) ; return "RTN","EDPCTRL",167,0) I CMD="saveBedConfig" D G OUT "RTN","EDPCTRL",168,0) . D SAVE^EDPBRM(.REQ,$$VAL("area")) ; pass whole request for parsing "RTN","EDPCTRL",169,0) ; "RTN","EDPCTRL",170,0) ; --------------------------------- "RTN","EDPCTRL",171,0) ; "RTN","EDPCTRL",172,0) ; saveColorConfig "RTN","EDPCTRL",173,0) ; return "RTN","EDPCTRL",174,0) I CMD="saveColorConfig" D G OUT "RTN","EDPCTRL",175,0) . D SAVE^EDPBCM(.REQ) ; pass whole request for parsing "RTN","EDPCTRL",176,0) ; "RTN","EDPCTRL",177,0) ; --------------------------------- "RTN","EDPCTRL",178,0) ; "RTN","EDPCTRL",179,0) ; loadSelectionConfig "RTN","EDPCTRL",180,0) ; return ....... "RTN","EDPCTRL",181,0) I CMD="loadSelectionConfig" D G OUT "RTN","EDPCTRL",182,0) . D LOAD^EDPBSL($$VAL("area")) "RTN","EDPCTRL",183,0) ; "RTN","EDPCTRL",184,0) ; --------------------------------- "RTN","EDPCTRL",185,0) ; "RTN","EDPCTRL",186,0) ; loadStaffConfig "RTN","EDPCTRL",187,0) ; return providers, nurses, staff for area "RTN","EDPCTRL",188,0) I CMD="loadStaffConfig" D G OUT "RTN","EDPCTRL",189,0) . D LOAD^EDPBST($$VAL("area")) "RTN","EDPCTRL",190,0) ; "RTN","EDPCTRL",191,0) ; --------------------------------- "RTN","EDPCTRL",192,0) ; "RTN","EDPCTRL",193,0) ; saveStaffConfig "RTN","EDPCTRL",194,0) ; return "RTN","EDPCTRL",195,0) I CMD="saveStaffConfig" D G OUT "RTN","EDPCTRL",196,0) . D SAVE^EDPBST(.REQ) ; pass whole request for parsing "RTN","EDPCTRL",197,0) ; "RTN","EDPCTRL",198,0) ; --------------------------------- "RTN","EDPCTRL",199,0) ; "RTN","EDPCTRL",200,0) ; matchPersons "RTN","EDPCTRL",201,0) ; return ... "RTN","EDPCTRL",202,0) I CMD="matchPersons" D G OUT "RTN","EDPCTRL",203,0) . D MATCH^EDPFPER($$VAL("partial"),$$VAL("personType")) "RTN","EDPCTRL",204,0) ; "RTN","EDPCTRL",205,0) ; --------------------------------- "RTN","EDPCTRL",206,0) ; "RTN","EDPCTRL",207,0) ; saveParamConfig "RTN","EDPCTRL",208,0) ; return "RTN","EDPCTRL",209,0) I CMD="saveParamConfig" D G OUT "RTN","EDPCTRL",210,0) . D SAVE^EDPBPM($$VAL("area"),$$VAL("param")) "RTN","EDPCTRL",211,0) ; "RTN","EDPCTRL",212,0) ; --------------------------------- "RTN","EDPCTRL",213,0) ; "RTN","EDPCTRL",214,0) ; saveSelectionConfig "RTN","EDPCTRL",215,0) ; return "RTN","EDPCTRL",216,0) I CMD="saveSelectionConfig" D G OUT "RTN","EDPCTRL",217,0) . D SAVE^EDPBSL($$VAL("area"),.REQ) "RTN","EDPCTRL",218,0) ; "RTN","EDPCTRL",219,0) ; --------------------------------- "RTN","EDPCTRL",220,0) ; "RTN","EDPCTRL",221,0) ; getReport "RTN","EDPCTRL",222,0) ; return ... "RTN","EDPCTRL",223,0) ; "RTN","EDPCTRL",224,0) ; ... "RTN","EDPCTRL",225,0) I CMD="getReport" D G OUT "RTN","EDPCTRL",226,0) . D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id")) "RTN","EDPCTRL",227,0) ; "RTN","EDPCTRL",228,0) ; --------------------------------- "RTN","EDPCTRL",229,0) ; "RTN","EDPCTRL",230,0) ; getCSV "RTN","EDPCTRL",231,0) ; return TAB separated values for report "RTN","EDPCTRL",232,0) I CMD="getCSV" D G OUT "RTN","EDPCTRL",233,0) . N EDPCSV ; CSV mode uses EDPCSV instead of EDPXML "RTN","EDPCTRL",234,0) . D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1) "RTN","EDPCTRL",235,0) . M EDPXML=EDPCSV "RTN","EDPCTRL",236,0) ; "RTN","EDPCTRL",237,0) ; --------------------------------- "RTN","EDPCTRL",238,0) ; else "RTN","EDPCTRL",239,0) D XML^EDPX("") "RTN","EDPCTRL",240,0) ; end switch "RTN","EDPCTRL",241,0) ; "RTN","EDPCTRL",242,0) OUT ; output the XML "RTN","EDPCTRL",243,0) I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML) "RTN","EDPCTRL",244,0) I $L($G(EDPHTTP)) D ; if in CSP mode "RTN","EDPCTRL",245,0) . U EDPHTTP "RTN","EDPCTRL",246,0) . W "",! "RTN","EDPCTRL",247,0) . N I S I=0 F S I=$O(EDPXML(I)) Q:'I W EDPXML(I),! "RTN","EDPCTRL",248,0) . W "",! "RTN","EDPCTRL",249,0) END Q "RTN","EDPCTRL",250,0) ; "RTN","EDPCTRL",251,0) VAL(X) ; return value from request "RTN","EDPCTRL",252,0) Q $G(REQ(X,1)) "RTN","EDPDD") 0^35^B1560959 "RTN","EDPDD",1,0) EDPDD ;SLC/KCM - Test Update ED Log - Update "RTN","EDPDD",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPDD",3,0) ; "RTN","EDPDD",4,0) ISGONE(STS) ; "RTN","EDPDD",5,0) Q STS=$O(^EDPB(233.1,"B","edp.status.gone",0)) "RTN","EDPDD",6,0) ; "RTN","EDPDD",7,0) LFS ; Local form set logic from code field "RTN","EDPDD",8,0) N LST,X0,NM,ABB "RTN","EDPDD",9,0) S LST=$P(^EDPB(233.2,DA(1),0),U) "RTN","EDPDD",10,0) S X0=$G(^EDPB(233.2,DA(1),1,DA,0)) "RTN","EDPDD",11,0) S NM=$P(X0,U,4),ABB=$P(X0,U,5) "RTN","EDPDD",12,0) Q:LST="" Q:X="" "RTN","EDPDD",13,0) S ^EDPB(233.2,"AS",LST,X,DA)=ABB_U_NM "RTN","EDPDD",14,0) Q "RTN","EDPDD",15,0) LFK ; Local form kill logic from code field "RTN","EDPDD",16,0) N LST "RTN","EDPDD",17,0) S LST=$P(^EDPB(233.2,DA(1),0),U) "RTN","EDPDD",18,0) S CODE=$P(^EDPB(233.2,DA(1),1,DA,0),U,2) "RTN","EDPDD",19,0) Q:LST="" Q:X="" "RTN","EDPDD",20,0) K ^EDPB(233.2,"AS",LST,X,DA) "RTN","EDPDD",21,0) Q "RTN","EDPDD",22,0) LFS1 ; Local form set logic from name, abbreviation "RTN","EDPDD",23,0) N X0,LST,CODE,NM,ABB "RTN","EDPDD",24,0) S LST=$P(^EDPB(233.2,DA(1),0),U) "RTN","EDPDD",25,0) S X0=$G(^EDPB(233.2,DA(1),1,DA,0)) "RTN","EDPDD",26,0) S CODE=$P(X0,U,2),NM=$P(X0,U,4),ABB=$P(X0,U,5) "RTN","EDPDD",27,0) Q:LST="" Q:CODE="" "RTN","EDPDD",28,0) S ^EDPB(233.2,"AS",LST,CODE,DA)=ABB_U_NM "RTN","EDPDD",29,0) Q "RTN","EDPDD",30,0) LFK1 ; Local form kill logic name, abbreviation "RTN","EDPDD",31,0) N LST,CODE "RTN","EDPDD",32,0) S LST=$P(^EDPB(233.2,DA(1),0),U) "RTN","EDPDD",33,0) S CODE=$P($G(^EDPB(233.2,DA(1),1,DA,0)),U,2) "RTN","EDPDD",34,0) Q:LST="" Q:CODE="" "RTN","EDPDD",35,0) K ^EDPB(233.2,"AS",LST,CODE,DA) "RTN","EDPDD",36,0) Q "RTN","EDPFAA") 0^1^B5372812 "RTN","EDPFAA",1,0) EDPFAA ;SLC/KCM - RPC Calls to Facility "RTN","EDPFAA",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFAA",3,0) ; "RTN","EDPFAA",4,0) SESS ; set up session "RTN","EDPFAA",5,0) N X "RTN","EDPFAA",6,0) S X("duz")=DUZ "RTN","EDPFAA",7,0) S X("userNm")=$P($G(^VA(200,DUZ,0)),U) "RTN","EDPFAA",8,0) S X("site")=DUZ(2) "RTN","EDPFAA",9,0) S X("siteNm")=$$NAME^XUAF4(X("site")) "RTN","EDPFAA",10,0) S X("station")=$$STA^XUAF4(DUZ(2)) "RTN","EDPFAA",11,0) S X("time")=$$NOW^XLFDT "RTN","EDPFAA",12,0) S X("rptExport")=($D(^XUSEC("EDPR EXPORT",DUZ))>0) "RTN","EDPFAA",13,0) S X("rptProvider")=($D(^XUSEC("EDPR PROVIDER",DUZ))>0) "RTN","EDPFAA",14,0) S X("rptXRef")=($D(^XUSEC("EDPR XREF",DUZ))>0) "RTN","EDPFAA",15,0) S X("progMode")=($D(^XUSEC("XUPROGMODE",DUZ))>0) "RTN","EDPFAA",16,0) S X("version")=$$VERSRV^EDPQAR "RTN","EDPFAA",17,0) ; "RTN","EDPFAA",18,0) ; This code to enable VEHU training. "RTN","EDPFAA",19,0) ;N AREA "RTN","EDPFAA",20,0) ;S AREA=$$GET^XPAR(DUZ_";VA(200,","EDPF USER AREA",1,"Q") "RTN","EDPFAA",21,0) ;I AREA S X("area")=AREA,X("areaNm")=$P($G(^EDPB(231.9,AREA,0)),U) "RTN","EDPFAA",22,0) ; "RTN","EDPFAA",23,0) S X("timeOut")=$$GET^XPAR("USR^DIV^SYS","ORWOR TIMEOUT CHART",1,"I") "RTN","EDPFAA",24,0) S:'X("timeOut") X("timeOut")=$$DTIME^XUP(DUZ) "RTN","EDPFAA",25,0) S:'X("timeOut") X("timeOut")=300 "RTN","EDPFAA",26,0) S X("timeOut")=X("timeOut")*1000 ; milliseconds "RTN","EDPFAA",27,0) S X("countDown")=$$GET^XPAR("USR^SYS^PKG","ORWOR TIMEOUT COUNTDOWN",1,"I") "RTN","EDPFAA",28,0) S:'X("countDown") X("countDown")=10 "RTN","EDPFAA",29,0) S X("countDown")=X("countDown")*1000 ; milliseconds "RTN","EDPFAA",30,0) D XML^EDPX($$XMLA^EDPX("user",.X)) "RTN","EDPFAA",31,0) Q "RTN","EDPFAA",32,0) ; "RTN","EDPFAA",33,0) VIEWS ; Return views allowed for this user "RTN","EDPFAA",34,0) N I,X,ID "RTN","EDPFAA",35,0) F I=1:1 S X=$P($T(OPTIONS+I),";",3,99) Q:X="zzzzz" D "RTN","EDPFAA",36,0) . I $$ACCESS^XQCHK(DUZ,$$LKOPT^XPDMENU($P(X,U)))>0 D "RTN","EDPFAA",37,0) . . D XML^EDPX($$XMLS^EDPX("view",$P(X,U,3),$P(X,U,2))) "RTN","EDPFAA",38,0) Q "RTN","EDPFAA",39,0) OPTIONS ;; options visible in Tracking System "RTN","EDPFAA",40,0) ;;EDPF TRACKING VIEW SIGNIN^Sign In^1 "RTN","EDPFAA",41,0) ;;EDPF TRACKING VIEW TRIAGE^Triage^2 "RTN","EDPFAA",42,0) ;;EDPF TRACKING VIEW UPDATE^Update^3 "RTN","EDPFAA",43,0) ;;EDPF TRACKING VIEW DISPOSITION^Disposition^4 "RTN","EDPFAA",44,0) ;;EDPF TRACKING VIEW EDIT CLOSED^Edit Closed^5 "RTN","EDPFAA",45,0) ;;EDPF TRACKING VIEW BOARD^Display Board^6 "RTN","EDPFAA",46,0) ;;EDPF TRACKING VIEW STAFF^Assign Staff^7 "RTN","EDPFAA",47,0) ;;EDPF TRACKING VIEW REPORTS^Reports^8 "RTN","EDPFAA",48,0) ;;EDPF TRACKING VIEW CONFIGURE^Configure^9 "RTN","EDPFAA",49,0) ;;zzzzz "RTN","EDPFLEX") 0^2^B1745474 "RTN","EDPFLEX",1,0) EDPFLEX ;SLC/KCM - Lexicon Utilities "RTN","EDPFLEX",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFLEX",3,0) ; "RTN","EDPFLEX",4,0) ICD(TEXT) ; Return Lexicon hits for TEXT "RTN","EDPFLEX",5,0) N LEX,X,Y,I,ICD,CPT,NAME,IEN "RTN","EDPFLEX",6,0) ;D CONFIG^LEXSET("GMPL","PL1",DT) "RTN","EDPFLEX",7,0) ;D LOOK^LEXA(TEXT,"GMPL",999,"",DT) "RTN","EDPFLEX",8,0) ; (just do diagnoses until we figure out CPT modifiers) "RTN","EDPFLEX",9,0) D CONFIG^LEXSET("ICD","ICD",DT) "RTN","EDPFLEX",10,0) D LOOK^LEXA(TEXT,"ICD",999,"",DT) "RTN","EDPFLEX",11,0) D XML^EDPX("") "RTN","EDPFLEX",12,0) S I=0 F S I=$O(LEX("LIST",I)) Q:I<1 D "RTN","EDPFLEX",13,0) . N ITEM "RTN","EDPFLEX",14,0) . S IEN=$P(LEX("LIST",I),U),X=$P(LEX("LIST",I),U,2),CPT="" "RTN","EDPFLEX",15,0) . S ICD=$P($P(X,"ICD-9-CM ",2),")") I $L(ICD) S NAME=X ;$P(X," (ICD-9-CM") "RTN","EDPFLEX",16,0) . E S CPT=$P($P(X,"CPT-4 ",2),")"),NAME=X ;$P(X," (CPT-4") "RTN","EDPFLEX",17,0) . I '$L(ICD),'$L(CPT) Q "RTN","EDPFLEX",18,0) . S:$E(NAME,$L(NAME))="*" NAME=$E(NAME,1,$L(NAME)-2) "RTN","EDPFLEX",19,0) . S ITEM("text")=NAME,ITEM("ien")=IEN "RTN","EDPFLEX",20,0) . I $L(ICD) S ITEM("code")=ICD,ITEM("type")="POV",ITEM("icd")=ICD "RTN","EDPFLEX",21,0) . I $L(CPT) S ITEM("code")=CPT,ITEM("type")="CPT",ITEM("cpt")=CPT "RTN","EDPFLEX",22,0) . S Y=$$XMLA^EDPX("item",.ITEM) D XML^EDPX(Y) "RTN","EDPFLEX",23,0) D XML^EDPX("") "RTN","EDPFLEX",24,0) Q "RTN","EDPFMON") 0^3^B27211876 "RTN","EDPFMON",1,0) EDPFMON ;SLC/MKB - ED Monitor at facility "RTN","EDPFMON",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFMON",3,0) ; "RTN","EDPFMON",4,0) EN(MSG) ; -- main entry point for EDP MONITOR where MSG contains HL7 msg "RTN","EDPFMON",5,0) N EDMSG,PKG,MSH,PID,PV1,ORC,DFN,LOG "RTN","EDPFMON",6,0) S EDMSG=$S($L($G(MSG)):MSG,1:"MSG"),MSH=0 ;MSG="NAME" or MSG(#) "RTN","EDPFMON",7,0) F S MSH=$O(@EDMSG@(MSH)) Q:MSH'>0 Q:$E(@EDMSG@(MSH),1,3)="MSH" "RTN","EDPFMON",8,0) Q:'MSH ;no message/header "RTN","EDPFMON",9,0) S PKG=$$PKG($P(@EDMSG@(MSH),"|",3)) Q:'$L(PKG) ;unknown or not tracked "RTN","EDPFMON",10,0) S DFN=$$PID Q:DFN<1 ;missing patient "RTN","EDPFMON",11,0) S LOG=+$O(^EDP(230,"APA",DFN,0)) Q:LOG<1 ;not in ED now "RTN","EDPFMON",12,0) S ORC=0 F S ORC=$O(@EDMSG@(+ORC)) Q:ORC'>0 I $E(@EDMSG@(ORC),1,3)="ORC" D "RTN","EDPFMON",13,0) . N ORDCNTRL,ORIFN,STS,RTN "RTN","EDPFMON",14,0) . S ORC=ORC_U_@EDMSG@(ORC),ORDCNTRL=$TR($P(ORC,"|",2),"@","P") "RTN","EDPFMON",15,0) . Q:'$L(ORDCNTRL) "RTN","EDPFMON",16,0) . S ORIFN=$P($P(ORC,"|",3),U),STS=$P(ORC,"|",6) "RTN","EDPFMON",17,0) . S RTN=$S("NW^OK^XR"[ORDCNTRL:"NEW",1:"UPD") "RTN","EDPFMON",18,0) . D @RTN "RTN","EDPFMON",19,0) Q "RTN","EDPFMON",20,0) ; "RTN","EDPFMON",21,0) ENOR(MSG) ; -- main entry point for EDP OR MONITOR where MSG contains HL7 msg "RTN","EDPFMON",22,0) N EDMSG,PKG,MSH,PID,PV1,ORC,DFN,LOG "RTN","EDPFMON",23,0) S EDMSG=$S($L($G(MSG)):MSG,1:"MSG"),MSH=0 ;MSG="NAME" or MSG(#) "RTN","EDPFMON",24,0) F S MSH=$O(@EDMSG@(MSH)) Q:MSH'>0 Q:$E(@EDMSG@(MSH),1,3)="MSH" "RTN","EDPFMON",25,0) Q:'MSH ;no message/header "RTN","EDPFMON",26,0) S PKG=$$PKG($P(@EDMSG@(MSH),"|",5)) Q:'$L(PKG) ;unknown or not tracked "RTN","EDPFMON",27,0) S DFN=$$PID Q:DFN<1 ;missing patient "RTN","EDPFMON",28,0) S LOG=+$O(^EDP(230,"APA",DFN,0)) Q:LOG<1 ;not in ED now "RTN","EDPFMON",29,0) S ORC=0 F S ORC=$O(@EDMSG@(+ORC)) Q:ORC'>0 I $E(@EDMSG@(ORC),1,3)="ORC" D "RTN","EDPFMON",30,0) . N ORDCNTRL,ORIFN "RTN","EDPFMON",31,0) . S ORC=ORC_U_@EDMSG@(ORC),ORDCNTRL=$TR($P(ORC,"|",2),"@","P") "RTN","EDPFMON",32,0) . Q:ORDCNTRL'="NA" ;new backdoor ack "RTN","EDPFMON",33,0) . S ORIFN=$P($P(ORC,"|",3),U) "RTN","EDPFMON",34,0) . D NEW "RTN","EDPFMON",35,0) Q "RTN","EDPFMON",36,0) ; "RTN","EDPFMON",37,0) PKG(NAME) ; -- Returns package code "RTN","EDPFMON",38,0) I NAME="RADIOLOGY"!(NAME="IMAGING") Q "R" "RTN","EDPFMON",39,0) I NAME="LABORATORY" Q "L" "RTN","EDPFMON",40,0) I NAME="PHARMACY" Q "M" "RTN","EDPFMON",41,0) I NAME="CONSULTS" Q "C" "RTN","EDPFMON",42,0) I NAME="PROCEDURES" Q "C" "RTN","EDPFMON",43,0) I NAME="DIETETICS" Q "A" "RTN","EDPFMON",44,0) I NAME="ORDER ENTRY" Q "A" "RTN","EDPFMON",45,0) Q "" "RTN","EDPFMON",46,0) ; "RTN","EDPFMON",47,0) PID() ; -- Returns patient DFN from PID segment in current msg "RTN","EDPFMON",48,0) N I,Y,SEG S I=MSH,Y="" "RTN","EDPFMON",49,0) F S I=$O(@EDMSG@(I)) Q:I'>0 S SEG=$E(@EDMSG@(I),1,3) Q:SEG="ORC" I SEG="PID" S Y=+$P(@EDMSG@(I),"|",4) Q "RTN","EDPFMON",50,0) Q Y "RTN","EDPFMON",51,0) ; "RTN","EDPFMON",52,0) PV1() ; -- Returns patient location from PV1 segment in current msg "RTN","EDPFMON",53,0) N I,Y,SEG S I=MSH,Y="" "RTN","EDPFMON",54,0) F S I=$O(@EDMSG@(I)) Q:I'>0 S SEG=$E(@EDMSG@(I),1,3) Q:SEG="ORC" I SEG="PV1" S Y=+$P(@EDMSG@(I),"|",4) Q "RTN","EDPFMON",55,0) Q Y "RTN","EDPFMON",56,0) ; "RTN","EDPFMON",57,0) NEW ; -- add new order to patient log "RTN","EDPFMON",58,0) Q:'$G(ORIFN) Q:$$START(ORIFN)>DT ;no future orders "RTN","EDPFMON",59,0) N MSG,URG,ORL "RTN","EDPFMON",60,0) S ORL=+$$GET1^DIQ(100,+ORIFN_",",6,"I") "RTN","EDPFMON",61,0) I ORL,'$$ED(ORL) Q ;not ED location "RTN","EDPFMON",62,0) S URG=$$VALUE^ORCSAVE2(+ORIFN,"URGENCY") S:'URG URG=9 ;routine "RTN","EDPFMON",63,0) S MSG(1)="command=newOrder" "RTN","EDPFMON",64,0) S MSG(2)="id="_LOG "RTN","EDPFMON",65,0) S MSG(3)="orifn="_+ORIFN "RTN","EDPFMON",66,0) S MSG(4)="pkg="_PKG "RTN","EDPFMON",67,0) S MSG(5)="sts="_"N" "RTN","EDPFMON",68,0) S MSG(6)="stat="_(URG<3) ;1=STAT or 2=ASAP "RTN","EDPFMON",69,0) S MSG(7)="release="_$$NOW^XLFDT "RTN","EDPFMON",70,0) D SEND(.MSG) "RTN","EDPFMON",71,0) Q "RTN","EDPFMON",72,0) ; "RTN","EDPFMON",73,0) ED(LOC) ; -- Return 1 or 0 if LOCation is part of ED "RTN","EDPFMON",74,0) N EDLOC,I,Y "RTN","EDPFMON",75,0) D GETLST^XPAR(.EDLOC,"ALL","EDPF LOCATION") "RTN","EDPFMON",76,0) S (I,Y)=0 F S I=$O(EDLOC(I)) Q:I<1 I $P(EDLOC(I),U,2)=LOC S Y=1 Q "RTN","EDPFMON",77,0) Q Y "RTN","EDPFMON",78,0) ; "RTN","EDPFMON",79,0) START(IFN) ; -- return start date (day only) of order "RTN","EDPFMON",80,0) N X,Y,%DT "RTN","EDPFMON",81,0) S Y=+$$GET1^DIQ(100,+$G(IFN)_",",21,"I") I Y<1 D "RTN","EDPFMON",82,0) . S X=$$VALUE^ORCSAVE2(+IFN,"START") "RTN","EDPFMON",83,0) . I '$L(X) S Y=DT Q ;assume NOW "RTN","EDPFMON",84,0) . S %DT="T" D ^%DT S:Y<1 Y="" "RTN","EDPFMON",85,0) S Y=$P(Y,".") "RTN","EDPFMON",86,0) Q Y "RTN","EDPFMON",87,0) ; "RTN","EDPFMON",88,0) UPD ; -- update state of order in log "RTN","EDPFMON",89,0) I ORDCNTRL="RE" D STS("C") Q "RTN","EDPFMON",90,0) I "CA^DC^OC^OD^CR^DR"[ORDCNTRL D DEL Q ;?? "RTN","EDPFMON",91,0) I PKG="L",ORDCNTRL="SC" D STS("A") Q "RTN","EDPFMON",92,0) I PKG="R",ORDCNTRL="SC" D STS("A") Q "RTN","EDPFMON",93,0) I PKG="C","SC^XX"[ORDCNTRL D STS("A") Q "RTN","EDPFMON",94,0) I PKG="M" D Q "RTN","EDPFMON",95,0) . I "RO^XX^ZV"[ORDCNTRL D STS("A") Q "RTN","EDPFMON",96,0) . Q:ORDCNTRL'="SC" Q:'$L(STS) "RTN","EDPFMON",97,0) . I "DC^ZE^RP"[STS D STS("C") Q "RTN","EDPFMON",98,0) . D STS("A") "RTN","EDPFMON",99,0) I PKG="A","SC^XX"[ORDCNTRL D Q "RTN","EDPFMON",100,0) . I "DC^ZE"[STS D STS("C") Q "RTN","EDPFMON",101,0) . D STS("A") "RTN","EDPFMON",102,0) Q "RTN","EDPFMON",103,0) ; "RTN","EDPFMON",104,0) STS(X) ; -- update status "RTN","EDPFMON",105,0) N MSG "RTN","EDPFMON",106,0) S MSG(1)="command=updateOrder" "RTN","EDPFMON",107,0) S MSG(2)="id="_LOG "RTN","EDPFMON",108,0) S MSG(3)="orifn="_+ORIFN "RTN","EDPFMON",109,0) S MSG(4)="sts="_X "RTN","EDPFMON",110,0) D SEND(.MSG) "RTN","EDPFMON",111,0) Q "RTN","EDPFMON",112,0) ; "RTN","EDPFMON",113,0) DEL ; -- remove order "RTN","EDPFMON",114,0) N MSG "RTN","EDPFMON",115,0) S MSG(1)="command=deleteOrder" "RTN","EDPFMON",116,0) S MSG(2)="id="_LOG "RTN","EDPFMON",117,0) S MSG(3)="orifn="_+ORIFN "RTN","EDPFMON",118,0) D SEND(.MSG) "RTN","EDPFMON",119,0) Q "RTN","EDPFMON",120,0) ; "RTN","EDPFMON",121,0) VER(ORIFN) ; -- update status when ORIFN verified "RTN","EDPFMON",122,0) N LOG,MSG S ORIFN=+$G(ORIFN) "RTN","EDPFMON",123,0) S LOG=+$O(^EDP(230,"AO",ORIFN,0)) Q:LOG<1 ;not in ED "RTN","EDPFMON",124,0) S MSG(1)="command=verifyOrder" "RTN","EDPFMON",125,0) S MSG(2)="id="_LOG "RTN","EDPFMON",126,0) S MSG(3)="orifn="_ORIFN "RTN","EDPFMON",127,0) D SEND(.MSG) "RTN","EDPFMON",128,0) Q "RTN","EDPFMON",129,0) ; "RTN","EDPFMON",130,0) COMP(ORIFN) ; -- update status when ORIFN completed "RTN","EDPFMON",131,0) N LOG,MSG S ORIFN=+$G(ORIFN) "RTN","EDPFMON",132,0) S LOG=+$O(^EDP(230,"AO",ORIFN,0)) Q:LOG<1 ;not in ED "RTN","EDPFMON",133,0) S MSG(1)="command=completeOrder" "RTN","EDPFMON",134,0) S MSG(2)="id="_LOG "RTN","EDPFMON",135,0) S MSG(3)="orifn="_ORIFN "RTN","EDPFMON",136,0) D SEND(.MSG) "RTN","EDPFMON",137,0) Q "RTN","EDPFMON",138,0) ; "RTN","EDPFMON",139,0) ; -- Monitor SDAM APPOINTMENT EVENTS for patients checking-in to ED "RTN","EDPFMON",140,0) ; "RTN","EDPFMON",141,0) SDAM ; -- send bulletin on check-in "RTN","EDPFMON",142,0) N EDPEVENT "RTN","EDPFMON",143,0) S EDPEVENT=$$GET^XPAR("ALL","EDPF SCHEDULING TRIGGER",1,"Q") "RTN","EDPFMON",144,0) Q:EDPEVENT="D" ; adding via scheduling disabled "RTN","EDPFMON",145,0) S:'EDPEVENT EDPEVENT=4 "RTN","EDPFMON",146,0) Q:$G(SDAMEVT)'=EDPEVENT "RTN","EDPFMON",147,0) ; "RTN","EDPFMON",148,0) N EDPLST,X,FOUND "RTN","EDPFMON",149,0) D GETLST^XPAR(.EDPLST,"ALL","EDPF LOCATION","I") "RTN","EDPFMON",150,0) S X="",FOUND=0 "RTN","EDPFMON",151,0) F S X=$O(EDPLST(X)) Q:X="" I $P(SDATA,U,4)=EDPLST(X) S FOUND=1 Q "RTN","EDPFMON",152,0) Q:'FOUND "RTN","EDPFMON",153,0) ; "RTN","EDPFMON",154,0) N DFN,DATE,HLOC "RTN","EDPFMON",155,0) S DFN=+$P(SDATA,U,2),DATE=+$P(SDATA,U,3),HLOC=+$P(SDATA,U,4) "RTN","EDPFMON",156,0) ; your code goes here :) "RTN","EDPFMON",157,0) N MSG "RTN","EDPFMON",158,0) S MSG(1)="command=patientCheckIn" "RTN","EDPFMON",159,0) S MSG(2)="dfn="_DFN "RTN","EDPFMON",160,0) S MSG(3)="ptNm="_$P(^DPT(DFN,0),U) "RTN","EDPFMON",161,0) S MSG(4)="ssn="_$P(^DPT(DFN,0),U,9) "RTN","EDPFMON",162,0) S MSG(5)="hloc="_HLOC "RTN","EDPFMON",163,0) S MSG(6)="site="_DUZ(2) "RTN","EDPFMON",164,0) S MSG(7)="time="_DATE ; appt date to match PCE "RTN","EDPFMON",165,0) D SEND(.MSG) "RTN","EDPFMON",166,0) Q "RTN","EDPFMON",167,0) ; "RTN","EDPFMON",168,0) SEND(MSG) ; Transfer control to message handler "RTN","EDPFMON",169,0) D MSG^EDPMAIL(.MSG) "RTN","EDPFMON",170,0) Q "RTN","EDPFMOVE") 0^23^B43728958 "RTN","EDPFMOVE",1,0) EDPFMOVE ;SLC/MKB - Move local ER Visits to EDIS "RTN","EDPFMOVE",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFMOVE",3,0) ; "RTN","EDPFMOVE",4,0) EN ; -- Option EDP CONVERSION to copy local data "RTN","EDPFMOVE",5,0) I '$D(^DIZ(172006,0)) W !!,"You have no ER data to convert." H 1 Q "RTN","EDPFMOVE",6,0) I $G(^XTMP("EDP-CONV","X"))="DONE" W !!,"The data conversion has completed." H 1 Q "RTN","EDPFMOVE",7,0) ; "RTN","EDPFMOVE",8,0) N X,Y,DIR,DTOUT,DUOUT,DIRUT,DIROUT,EDPDIV "RTN","EDPFMOVE",9,0) W !!,"This option will copy ER configuration and visit data at your site" "RTN","EDPFMOVE",10,0) W !,"to the new Emergency Department application. For each division," "RTN","EDPFMOVE",11,0) W !,"your local configuration data will be copied first, followed by all" "RTN","EDPFMOVE",12,0) W !,"currently active patient visits. A task will then be queued to" "RTN","EDPFMOVE",13,0) W !,"populate previous, closed visits in the national application files" "RTN","EDPFMOVE",14,0) W !,"to allow reports to continue to function." "RTN","EDPFMOVE",15,0) S EDPDIV=$$SELDIV Q:'EDPDIV "RTN","EDPFMOVE",16,0) I '$$AREA(EDPDIV) W !!,"Please create a Tracking Area for this division.",! Q "RTN","EDPFMOVE",17,0) D SELCVT Q:EDPDIV="^" "RTN","EDPFMOVE",18,0) W !!,"DO NOT PROCEED UNTIL YOU ARE READY TO USE THE NEW EDIS PACKAGE!!",! "RTN","EDPFMOVE",19,0) S DIR(0)="YA",DIR("A")="Are you ready? ",DIR("B")="NO" "RTN","EDPFMOVE",20,0) D ^DIR Q:'Y "RTN","EDPFMOVE",21,0) ; "RTN","EDPFMOVE",22,0) E1 ; -- start here "RTN","EDPFMOVE",23,0) D CONFIG "RTN","EDPFMOVE",24,0) D ACTIVE "RTN","EDPFMOVE",25,0) ; -- task LOOP "RTN","EDPFMOVE",26,0) N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC,ZTSK "RTN","EDPFMOVE",27,0) S ZTSK=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,4) I ZTSK D Q:$G(ZTSK) "RTN","EDPFMOVE",28,0) . D STAT^%ZTLOAD N STS S STS=+$G(ZTSK(1)) "RTN","EDPFMOVE",29,0) . I STS=1!(STS=2) W !,"Visit conversion is still running." Q "RTN","EDPFMOVE",30,0) . K ZTSK "RTN","EDPFMOVE",31,0) . ; STS=4!(STS=5) K ZTSK Q ;never ran or errored out "RTN","EDPFMOVE",32,0) . ; STS=3!(STS=0) K ZTSK Q ;completed or undefined "RTN","EDPFMOVE",33,0) S ZTRTN="LOOP^EDPFMOVE",ZTIO="",ZTDTH=$H,ZTSAVE("EDPDIV")="" "RTN","EDPFMOVE",34,0) S ZTDESC="Copy old ER data to new EDIS application" "RTN","EDPFMOVE",35,0) D ^%ZTLOAD I $G(ZTSK) D Q "RTN","EDPFMOVE",36,0) . W !,"Task #"_ZTSK_" started to copy closed visits." "RTN","EDPFMOVE",37,0) . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,4)=ZTSK "RTN","EDPFMOVE",38,0) W !,"ERROR -- Task to copy closed visits NOT started!" "RTN","EDPFMOVE",39,0) Q "RTN","EDPFMOVE",40,0) ; "RTN","EDPFMOVE",41,0) CONFIG ; -- convert site configuration "RTN","EDPFMOVE",42,0) N EDPI,MSG,N,I,X0,XMZ K XMMG "RTN","EDPFMOVE",43,0) S EDPI=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U) ; = ien^0^0 in post-init "RTN","EDPFMOVE",44,0) I EDPI="" W !,"Configuration data for "_$$NAME^XUAF4(EDPDIV)_" has already been copied." Q "RTN","EDPFMOVE",45,0) I EDPI=-1 W !,"Configuration data for "_$$NAME^XUAF4(EDPDIV)_" will not be copied." Q "RTN","EDPFMOVE",46,0) W !,"Copying local configuration ... " "RTN","EDPFMOVE",47,0) F S EDPI=$O(^DIZ(172012,EDPI)) Q:EDPI<1 D Q:$D(XMMG) "RTN","EDPFMOVE",48,0) . K MSG S MSG(1)="command=convertConfiguration",N=1 "RTN","EDPFMOVE",49,0) . S X0=$G(^DIZ(172012,EDPI,0)) "RTN","EDPFMOVE",50,0) . S N=N+1,MSG(N)="SITE="_EDPDIV "RTN","EDPFMOVE",51,0) . S N=N+1,MSG(N)="TZ="_$$TZ^XLFDT "RTN","EDPFMOVE",52,0) . F I=2,3,5 S N=N+1,MSG(N)=I_"="_$G(^DIZ(172012,EDPI,I)) "RTN","EDPFMOVE",53,0) . ; include acuities and statuses for default colors "RTN","EDPFMOVE",54,0) . S I=0 F S I=$O(^DIZ(172007,"D",EDPDIV,I)) Q:I<1 D "RTN","EDPFMOVE",55,0) .. S X0=$G(^DIZ(172007,I,0)) Q:'$P(X0,U,6) ;inactive "RTN","EDPFMOVE",56,0) .. S $P(X0,U,3)=$$EXTERNAL^DILFD(172007,2,"",$P(X0,U,3)) "RTN","EDPFMOVE",57,0) .. S $P(X0,U,4)=$$EXTERNAL^DILFD(172007,3,"",$P(X0,U,4)) "RTN","EDPFMOVE",58,0) .. S N=N+1,MSG(N)="ACU"_I_"="_X0 "RTN","EDPFMOVE",59,0) . S I=0 F S I=$O(^DIZ(172009,I)) Q:I<1 S X0=$G(^(I,0)) D "RTN","EDPFMOVE",60,0) .. S $P(X0,U,2)=$$EXTERNAL^DILFD(172009,1,"",$P(X0,U,2)) "RTN","EDPFMOVE",61,0) .. S $P(X0,U,3)=$$EXTERNAL^DILFD(172009,2,"",$P(X0,U,3)) "RTN","EDPFMOVE",62,0) .. S N=N+1,MSG(N)="STS"_I_"="_X0 "RTN","EDPFMOVE",63,0) . D SEND^EDPFMON(.MSG) "RTN","EDPFMOVE",64,0) S $P(^XTMP("EDP-CONV","D",EDPDIV),U)="" ;done "RTN","EDPFMOVE",65,0) Q "RTN","EDPFMOVE",66,0) ; "RTN","EDPFMOVE",67,0) ACTIVE ; -- Loop through ER Locations, convert open visits first "RTN","EDPFMOVE",68,0) N EDPL,VST,XMZ "RTN","EDPFMOVE",69,0) S EDPL=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,2) ; = ien^0^0 in post-init "RTN","EDPFMOVE",70,0) I EDPL="" Q ;W !,"Active visits already copied." Q "RTN","EDPFMOVE",71,0) W !,"Copying currently active visits ... " "RTN","EDPFMOVE",72,0) F S EDPL=$O(^DIZ(172008,"C",EDPDIV,EDPL)) Q:EDPL<1 D "RTN","EDPFMOVE",73,0) . S VST=$P($G(^DIZ(172008,EDPL,0)),U,5) Q:'VST "RTN","EDPFMOVE",74,0) . D EN1(VST,1) S ^XTMP("EDP-CONV",VST)="" "RTN","EDPFMOVE",75,0) . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,2)=EDPL "RTN","EDPFMOVE",76,0) S $P(^XTMP("EDP-CONV","D",EDPDIV),U,2)="" ;done "RTN","EDPFMOVE",77,0) Q "RTN","EDPFMOVE",78,0) ; "RTN","EDPFMOVE",79,0) LOOP ; -- Queued loop to send previous [closed] visits "RTN","EDPFMOVE",80,0) N EDPI "RTN","EDPFMOVE",81,0) S EDPI=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,3) "RTN","EDPFMOVE",82,0) F S EDPI=$O(^DIZ(172006,"E",EDPDIV,EDPI)) Q:EDPI<1 D "RTN","EDPFMOVE",83,0) . I $D(^XTMP("EDP-CONV",EDPI)) S $P(^XTMP("EDP-CONV","D",EDPDIV),U,3)=EDPI Q "RTN","EDPFMOVE",84,0) . D EN1(EDPI) "RTN","EDPFMOVE",85,0) . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,3)=EDPI "RTN","EDPFMOVE",86,0) ;S ^XTMP("EDP-CONV","X")="DONE" "RTN","EDPFMOVE",87,0) Q "RTN","EDPFMOVE",88,0) ; "RTN","EDPFMOVE",89,0) EN1(IEN,OPEN) ; -- convert single ER visit "RTN","EDPFMOVE",90,0) N I,X,Y,X0,DIZ "RTN","EDPFMOVE",91,0) F I=0,1,2,3,4,6,9 S DIZ(I)=$G(^DIZ(172006,IEN,I)) "RTN","EDPFMOVE",92,0) I $O(^DIZ(172006,IEN,8,0)) M DIZ(8)=^DIZ(172006,IEN,8) "RTN","EDPFMOVE",93,0) S X=$P(DIZ(3),U),DIZ("SITE")=X ;Institution file ien "RTN","EDPFMOVE",94,0) S DIZ("TZ")=$$TZ^XLFDT ;Time Zone difference "RTN","EDPFMOVE",95,0) ; S:'$G(OPEN) DIZ("CLOSED")=1 ;Closed visit "RTN","EDPFMOVE",96,0) ; "RTN","EDPFMOVE",97,0) ;include static file nodes used: "RTN","EDPFMOVE",98,0) S X=$P(DIZ(0),U,4) S:X DIZ("STS"_X)=$$STS(X) ;Status "RTN","EDPFMOVE",99,0) I '$G(OPEN),X,$P($G(DIZ("STS"_X)),U,4)="GONE" S DIZ("CLOSED")=1 "RTN","EDPFMOVE",100,0) S X=$P(DIZ(0),U,6) S:X DIZ("ARR"_X)=$$ARR(X) ;Arrival Mode "RTN","EDPFMOVE",101,0) S X=$P(DIZ(3),U,2) S:X DIZ("LOC"_X)=$$LOC(X) ;Location "RTN","EDPFMOVE",102,0) S X=$P(DIZ(4),U,2) S:X $P(DIZ(4),U,2)=$$NUR(X) ;RN->200 "RTN","EDPFMOVE",103,0) S X=$P(DIZ(4),U,3) S:X DIZ("ACU"_X)=$$ACU(X) ;Acuity "RTN","EDPFMOVE",104,0) S X=$P(DIZ(4),U,7) S:X DIZ("DEL"_X)=$$DEL(X) ;Delay Reason "RTN","EDPFMOVE",105,0) S X=$P(DIZ(9),U,3) S:X DIZ("DIS"_X)=$$DIS(X) ;Disposition "RTN","EDPFMOVE",106,0) I 'X S X=$P(DIZ(6),U,3) S:$L(X) DIZ("DIS"_X)=$$EXTERNAL^DILFD(172006,16,,X)_"^1^^^"_X "RTN","EDPFMOVE",107,0) S I=0 F S I=$O(^DIZ(172006,IEN,7,I)) Q:I<1 S X0=$G(^(I,0)) D "RTN","EDPFMOVE",108,0) . S X=$P(X0,U,3) I X,'$D(DIZ("STS"_X)) S DIZ("STS"_X)=$$STS(X) "RTN","EDPFMOVE",109,0) . S X=$P(X0,U,4) I X,'$D(DIZ("ACU"_X)) S DIZ("ACU"_X)=$$ACU(X) "RTN","EDPFMOVE",110,0) . S X=$P(X0,U,5) I X,'$D(DIZ("LOC"_X)) S DIZ("LOC"_X)=$$LOC(X) "RTN","EDPFMOVE",111,0) . S X=$P(X0,U,7) S:X $P(X0,U,7)=$$NUR(X) ;RN->200 "RTN","EDPFMOVE",112,0) . S DIZ("MVT"_I)=X0 "RTN","EDPFMOVE",113,0) ; "RTN","EDPFMOVE",114,0) ;send to nat'l file "RTN","EDPFMOVE",115,0) ;N MSG S MSG(1)="command=convertVisit",I=1 "RTN","EDPFMOVE",116,0) ;S X="" F S X=$O(DIZ(X)) Q:X="" S I=I+1,MSG(I)=X_"="_DIZ(X) "RTN","EDPFMOVE",117,0) ;D SEND^EDPFMON(.MSG) "RTN","EDPFMOVE",118,0) ; "RTN","EDPFMOVE",119,0) D VST^EDPCONV(.DIZ) "RTN","EDPFMOVE",120,0) I $G(DIZ(230)) S ^DIZ(172006,IEN,230)=DIZ(230) "RTN","EDPFMOVE",121,0) Q "RTN","EDPFMOVE",122,0) ; "RTN","EDPFMOVE",123,0) LOC(X) ; -- Return 0-node for Location ien X "RTN","EDPFMOVE",124,0) N NODE,S S NODE=$G(^DIZ(172008,+$G(X),0)) "RTN","EDPFMOVE",125,0) S S=$P(NODE,U,8) I S,'$D(DIZ("STS"_S)) S DIZ("STS"_S)=$$STS(S) "RTN","EDPFMOVE",126,0) Q NODE "RTN","EDPFMOVE",127,0) ; "RTN","EDPFMOVE",128,0) ACU(X) ; -- Return 0-node for Acuity ien X "RTN","EDPFMOVE",129,0) Q $G(^DIZ(172007,+$G(X),0)) "RTN","EDPFMOVE",130,0) ; "RTN","EDPFMOVE",131,0) STS(X) ; -- Return 0-node for Status ien X "RTN","EDPFMOVE",132,0) Q $G(^DIZ(172009,+$G(X),0)) "RTN","EDPFMOVE",133,0) ; "RTN","EDPFMOVE",134,0) DEL(X) ; -- Return 0-node for Delay Reason ien X "RTN","EDPFMOVE",135,0) Q $G(^DIZ(172011,+$G(X),0)) "RTN","EDPFMOVE",136,0) ; "RTN","EDPFMOVE",137,0) ARR(X) ; -- Return 0-node for Arrival Mode ien X "RTN","EDPFMOVE",138,0) Q $G(^DIZ(172014,+$G(X),0)) "RTN","EDPFMOVE",139,0) ; "RTN","EDPFMOVE",140,0) DIS(X) ; -- Return 0-node for Disposition ien X "RTN","EDPFMOVE",141,0) Q $G(^DIZ(172015,+$G(X),0)) "RTN","EDPFMOVE",142,0) ; "RTN","EDPFMOVE",143,0) PER(X) ; -- Return NAME^INITIALS for New Person ien X "RTN","EDPFMOVE",144,0) Q $P($G(^VA(200,+$G(X),0)),U,1,2) "RTN","EDPFMOVE",145,0) ; "RTN","EDPFMOVE",146,0) NUR(X) ; -- Return #200 ptr for Nurse Staff ien X "RTN","EDPFMOVE",147,0) Q $P($G(^NURSF(210,+$G(X),0)),U) "RTN","EDPFMOVE",148,0) ; "RTN","EDPFMOVE",149,0) SELDIV() ; -- Select division ien to convert "RTN","EDPFMOVE",150,0) N I,DIV,CNT,X,Y,DIC,DTOUT,DUOUT "RTN","EDPFMOVE",151,0) S I=0 F S I=$O(^XTMP("EDP-CONV","D",I)) Q:I<1 S X=$G(^(I)) D "RTN","EDPFMOVE",152,0) . I $P(X,U)<1,$O(^DIZ(172006,"E",I,"A"),-1)'>$P(X,U,3) Q "RTN","EDPFMOVE",153,0) . S DIV(I)=$$NS^XUAF4(I),CNT=+$G(CNT)+1 "RTN","EDPFMOVE",154,0) I '$O(DIV(0)) W !!,"There is no data to convert." Q "RTN","EDPFMOVE",155,0) S DIC=4,DIC(0)="AEQMN",DIC("S")="I $D(DIV(Y))" "RTN","EDPFMOVE",156,0) I $G(CNT)=1 S I=$O(DIV(0)),DIC("B")=$P(DIV(I),U,2) "RTN","EDPFMOVE",157,0) S DIC("A")="Select the division you wish to convert: " "RTN","EDPFMOVE",158,0) W !!,"Available divisions: " "RTN","EDPFMOVE",159,0) S I=0 F S I=$O(DIV(I)) Q:I<1 W !,$P(DIV(I),U,2),?10,$P(DIV(I),U) "RTN","EDPFMOVE",160,0) D ^DIC S Y=$S(Y>0:+Y,1:0) "RTN","EDPFMOVE",161,0) Q Y "RTN","EDPFMOVE",162,0) ; "RTN","EDPFMOVE",163,0) AREA(D) ; -- Return Tracking Area #231.9 ien for Division ien "RTN","EDPFMOVE",164,0) Q +$O(^EDPB(231.9,"C",+$G(D),0)) "RTN","EDPFMOVE",165,0) ; "RTN","EDPFMOVE",166,0) SELCVT ; -- Select what to convert: configuration, data, or both "RTN","EDPFMOVE",167,0) Q:$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U)="" "RTN","EDPFMOVE",168,0) N X,Y,DIR,DTOUT,DUOUT "RTN","EDPFMOVE",169,0) S DIR(0)="YA" W ! "RTN","EDPFMOVE",170,0) S DIR("A")="Do you wish to convert the configuration as well as the data? " "RTN","EDPFMOVE",171,0) S DIR("?",1)="Enter YES if you wish to convert this division's configuration as well" "RTN","EDPFMOVE",172,0) S DIR("?")="as the patient data, otherwise enter NO to convert only the data." "RTN","EDPFMOVE",173,0) D ^DIR I Y'=1,Y'=0 S EDPDIV="^" Q "RTN","EDPFMOVE",174,0) S $P(^XTMP("EDP-CONV","D",EDPDIV),U)=$S(Y=0:-1,1:+$O(^DIZ(172012,"B",EDPDIV,0))) "RTN","EDPFMOVE",175,0) Q "RTN","EDPFPER") 0^5^B3427509 "RTN","EDPFPER",1,0) EDPFPER ;SLC/KCM - Lookup Persons at Facility "RTN","EDPFPER",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFPER",3,0) ; "RTN","EDPFPER",4,0) MATCH(MATCH,PTYP) ; Return a matching list of providers "RTN","EDPFPER",5,0) S MATCH=$$UP^XLFSTR(MATCH) "RTN","EDPFPER",6,0) S MATCH=$TR(MATCH,"_"," ") ; underscore replaces space in flex widget "RTN","EDPFPER",7,0) D XML^EDPX(""_PTYP_"") "RTN","EDPFPER",8,0) I PTYP="N" D NURS "RTN","EDPFPER",9,0) I PTYP'="N" D PROV "RTN","EDPFPER",10,0) Q "RTN","EDPFPER",11,0) PROV ; match providers "RTN","EDPFPER",12,0) N NM,PRV "RTN","EDPFPER",13,0) S NM=$O(^VA(200,"AK.PROVIDER",MATCH),-1) "RTN","EDPFPER",14,0) F S NM=$O(^VA(200,"AK.PROVIDER",NM)) Q:$E(NM,1,$L(MATCH))'=MATCH D "RTN","EDPFPER",15,0) . S PRV=0 F S PRV=$O(^VA(200,"AK.PROVIDER",NM,PRV)) Q:'PRV D "RTN","EDPFPER",16,0) .. I $$ALLOW(PRV,"P") D ADD(PRV,NM) "RTN","EDPFPER",17,0) Q "RTN","EDPFPER",18,0) NURS ; match nurses "RTN","EDPFPER",19,0) N NM,NRS,EDPNURS "RTN","EDPFPER",20,0) S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN") "RTN","EDPFPER",21,0) S NM=$O(^VA(200,"B",MATCH),-1) "RTN","EDPFPER",22,0) F S NM=$O(^VA(200,"B",NM)) Q:$E(NM,1,$L(MATCH))'=MATCH D "RTN","EDPFPER",23,0) . S NRS=0 F S NRS=$O(^VA(200,"B",NM,NRS)) Q:'NRS D "RTN","EDPFPER",24,0) .. I $$ALLOW(NRS,"N") D ADD(NRS,NM) "RTN","EDPFPER",25,0) Q "RTN","EDPFPER",26,0) ADD(PER,NM) ; Add the person to the list of staff "RTN","EDPFPER",27,0) N X,X0,TITLE "RTN","EDPFPER",28,0) S X0=^VA(200,PER,0),TITLE=$P(X0,U,9) "RTN","EDPFPER",29,0) S X("nm")=NM "RTN","EDPFPER",30,0) S X("itl")=$P(X0,U,2) "RTN","EDPFPER",31,0) I X("itl")="" S X("itl")=$E($P(NM,",",2))_$E(NM) "RTN","EDPFPER",32,0) S X("duz")=PER "RTN","EDPFPER",33,0) I TITLE S X("title")=$P($G(^DIC(3.1,TITLE,0)),U) "RTN","EDPFPER",34,0) D XML^EDPX($$XMLA^EDPX("staff",.X)) "RTN","EDPFPER",35,0) Q "RTN","EDPFPER",36,0) ALLOW(PER,ROLE) ; Screen when selecting persons "RTN","EDPFPER",37,0) ; PER is IEN for file 200, ROLE is P(rovider),R(esident), or N(urse) "RTN","EDPFPER",38,0) ; Expects EDPNURS to be defined for nurses (EDPF NURSE STAFF FILTER) "RTN","EDPFPER",39,0) I '$$ACTIVE^XUSER(PER) Q 0 "RTN","EDPFPER",40,0) I ("PR"[ROLE),'$$PROVIDER^XUSER(PER) Q 0 "RTN","EDPFPER",41,0) Q:ROLE'="N" 1 "RTN","EDPFPER",42,0) ; "RTN","EDPFPER",43,0) I '$G(EDPNURS),'$D(^NURSF(210,"B",PER)) Q 0 "RTN","EDPFPER",44,0) I ($G(EDPNURS)=1),'$D(^XUSEC("ORELSE",PER)) Q 0 "RTN","EDPFPER",45,0) I ($G(EDPNURS)=2),'$D(^XUSEC("PSJ RNURSE",PER)) Q 0 "RTN","EDPFPER",46,0) Q 1 "RTN","EDPFPTC") 0^36^B14885802 "RTN","EDPFPTC",1,0) EDPFPTC ;SLC/MKB - Patient look-up Utilities at Facility "RTN","EDPFPTC",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFPTC",3,0) ; "RTN","EDPFPTC",4,0) CHK(AREA,DFN,NAME) ; perform patient select checks "RTN","EDPFPTC",5,0) ; "RTN","EDPFPTC",6,0) ; check for active on board "RTN","EDPFPTC",7,0) N IEN,X0,CHK S NAME=$$UP^XLFSTR(NAME) "RTN","EDPFPTC",8,0) S IEN=0 F S IEN=$O(^EDP(230,"AC",EDPSITE,AREA,IEN)) Q:'IEN D Q:$D(CHK("onBoard")) "RTN","EDPFPTC",9,0) . S X0=^EDP(230,IEN,0) "RTN","EDPFPTC",10,0) . I DFN,($P(X0,U,6)=DFN) S CHK("onBoard")=$P(^DPT(DFN,0),U) "RTN","EDPFPTC",11,0) . I 'DFN,($E(NAME,1,10)'="(AMBULANCE"),($$UP^XLFSTR($P(X0,U,4))=NAME) S CHK("onBoard")=NAME "RTN","EDPFPTC",12,0) ; "RTN","EDPFPTC",13,0) ; stop here if no DFN "RTN","EDPFPTC",14,0) I 'DFN D Q "RTN","EDPFPTC",15,0) . S CHK("sensitive")=0,CHK("mayAccess")=1,CHK("logAccess")=0 "RTN","EDPFPTC",16,0) . D XML^EDPX($$XMLA^EDPX("checks",.CHK,"/")) "RTN","EDPFPTC",17,0) ; "RTN","EDPFPTC",18,0) ; check for sensitive record "RTN","EDPFPTC",19,0) N EDPY,WARN,I,X "RTN","EDPFPTC",20,0) D PTSEC^DGSEC4(.EDPY,DFN,1) ;IA #3027 "RTN","EDPFPTC",21,0) S CHK("dfn")=DFN "RTN","EDPFPTC",22,0) S CHK("sensitive")=(EDPY(1)>0) "RTN","EDPFPTC",23,0) S CHK("mayAccess")=(EDPY(1)<3) "RTN","EDPFPTC",24,0) S CHK("logAccess")=(EDPY(1)>1) "RTN","EDPFPTC",25,0) M WARN=EDPY K WARN(1) "RTN","EDPFPTC",26,0) ; "RTN","EDPFPTC",27,0) ; check for deceased patient "RTN","EDPFPTC",28,0) N DIED S DIED=0 "RTN","EDPFPTC",29,0) I +$G(^DPT(DFN,.35)) D "RTN","EDPFPTC",30,0) . S DIED(1)="This patient died on "_$$FMTE^XLFDT(^DPT(DFN,.35),"D")_"." "RTN","EDPFPTC",31,0) . S DIED(2)="Do you wish to continue?" "RTN","EDPFPTC",32,0) ; "RTN","EDPFPTC",33,0) ; check for similar patients "RTN","EDPFPTC",34,0) K EDPY "RTN","EDPFPTC",35,0) N MSG,SIM S MSG=0,SIM=0 "RTN","EDPFPTC",36,0) D GUIBS5A^DPTLK6(.EDPY,DFN) ;IA #3593 "RTN","EDPFPTC",37,0) S CHK("similar")=(EDPY(1)>0) "RTN","EDPFPTC",38,0) S I=1 F S I=$O(EDPY(I)) Q:'I S X=EDPY(I) D "RTN","EDPFPTC",39,0) . I $E(X)=0 S MSG=MSG+1,MSG(MSG)=$P(X,U,2) "RTN","EDPFPTC",40,0) . I $E(X)=1 D "RTN","EDPFPTC",41,0) .. S X("dfn")=$P(X,U,2) "RTN","EDPFPTC",42,0) .. S X("name")=$P(X,U,3) "RTN","EDPFPTC",43,0) .. S X("dob")=$$FMTE^XLFDT($P(X,U,4),"D") "RTN","EDPFPTC",44,0) .. S X("ssn")=$P(X,U,5) "RTN","EDPFPTC",45,0) .. S SIM=SIM+1,SIM(SIM)=$$XMLA^EDPX("similar",.X,"/") "RTN","EDPFPTC",46,0) ; "RTN","EDPFPTC",47,0) ; possibly check means test: GUIMTD^DPTLK6 "RTN","EDPFPTC",48,0) ; possibly check legacy data: I $L($T(HXDATA^A7RDPAGU)... "RTN","EDPFPTC",49,0) ; "RTN","EDPFPTC",50,0) ; put it all together "RTN","EDPFPTC",51,0) D XML^EDPX($$XMLA^EDPX("checks",.CHK,"/")) "RTN","EDPFPTC",52,0) I $D(WARN) D "RTN","EDPFPTC",53,0) . D XML^EDPX("") "RTN","EDPFPTC",54,0) . S I=0 F S I=$O(WARN(I)) Q:'I D XML^EDPX(WARN(I)) "RTN","EDPFPTC",55,0) . I CHK("logAccess"),CHK("mayAccess") D XML^EDPX("Are you sure you wish to continue?") "RTN","EDPFPTC",56,0) . D XML^EDPX("") "RTN","EDPFPTC",57,0) S I=0 F S I=$O(SIM(I)) Q:'I D XML^EDPX(SIM(I)) "RTN","EDPFPTC",58,0) I $D(MSG) D "RTN","EDPFPTC",59,0) . D XML^EDPX("") "RTN","EDPFPTC",60,0) . S I=0 F S I=$O(MSG(I)) Q:'I D XML^EDPX(MSG(I)) "RTN","EDPFPTC",61,0) . D XML^EDPX("") "RTN","EDPFPTC",62,0) I $D(DIED) D "RTN","EDPFPTC",63,0) . D XML^EDPX("") "RTN","EDPFPTC",64,0) . S I=0 F S I=$O(DIED(I)) Q:'I D XML^EDPX(DIED(I)) "RTN","EDPFPTC",65,0) . D XML^EDPX("") "RTN","EDPFPTC",66,0) I CHK("mayAccess") D PRF(DFN) "RTN","EDPFPTC",67,0) Q "RTN","EDPFPTC",68,0) PRF(DFN) ; get Patient Record Flags "RTN","EDPFPTC",69,0) N EDPY,EDI,PRF,N,X "RTN","EDPFPTC",70,0) Q:$$GETACT^DGPFAPI(DFN,"EDPY")'>0 "RTN","EDPFPTC",71,0) D XML^EDPX("") "RTN","EDPFPTC",72,0) S EDI=0 F S EDI=$O(EDPY(EDI)) Q:EDI<1 K PRF D "RTN","EDPFPTC",73,0) . S PRF("assignmentStatus")="Active" "RTN","EDPFPTC",74,0) . S PRF("assignTS")=$P($G(EDPY(EDI,"ASSIGNDT")),U) "RTN","EDPFPTC",75,0) . S PRF("approved")=$P($G(EDPY(EDI,"APPRVBY")),U,2) "RTN","EDPFPTC",76,0) . S PRF("nextReviewDT")=$P($G(EDPY(EDI,"REVIEWDT")),U) "RTN","EDPFPTC",77,0) . S PRF("name")=$P($G(EDPY(EDI,"FLAG")),U,2) "RTN","EDPFPTC",78,0) . S PRF("type")=$P($G(EDPY(EDI,"FLAGTYPE")),U,2) "RTN","EDPFPTC",79,0) . S PRF("category")=$P($G(EDPY(EDI,"CATEGORY")),U,2) "RTN","EDPFPTC",80,0) . S PRF("ownerSite")=$P($G(EDPY(EDI,"OWNER")),U,2) "RTN","EDPFPTC",81,0) . S PRF("originatingSite")=$P($G(EDPY(EDI,"ORIGSITE")),U,2) "RTN","EDPFPTC",82,0) . D XML^EDPX($$XMLA^EDPX("flag",.PRF,"")) "RTN","EDPFPTC",83,0) . S N=1,X=$G(EDPY(EDI,"NARR",1,0)) "RTN","EDPFPTC",84,0) . F S N=$O(EDPY(EDI,"NARR",N)) Q:N<1 S X=X_$C(13,10)_$G(EDPY(EDI,"NARR",N,0)) "RTN","EDPFPTC",85,0) . D XML^EDPX(""_$$ESC^EDPX(X)_"") "RTN","EDPFPTC",86,0) . D XML^EDPX("") "RTN","EDPFPTC",87,0) D XML^EDPX("") "RTN","EDPFPTC",88,0) Q "RTN","EDPFPTC",89,0) ; "RTN","EDPFPTC",90,0) LOG(DFN) ; Make entry in security log for sensitive patient access "RTN","EDPFPTC",91,0) N EDPY,X "RTN","EDPFPTC",92,0) D NOTICE^DGSEC4(.EDPY,DFN) ;IA #3027 "RTN","EDPFPTC",93,0) S X=$S(EDPY:"ok",1:"fail") "RTN","EDPFPTC",94,0) D XML^EDPX("") "RTN","EDPFPTC",95,0) Q "RTN","EDPFPTC",96,0) ; "RTN","EDPFPTC",97,0) TEST ; "RTN","EDPFPTC",98,0) S EDPSITE=$$IEN^XUAF4(442),NAME="doe,john" "RTN","EDPFPTC",99,0) D CHK(1,"",NAME) "RTN","EDPFPTC",100,0) ;N PID S EDPSITE=$$IEN^XUAF4(442) "RTN","EDPFPTC",101,0) ;R "DFN:",PID Q:PID="" W ! "RTN","EDPFPTC",102,0) ;D CHK(1,PID,$P(^DPT(PID,0),U)) "RTN","EDPFPTC",103,0) N I S I=0 F S I=$O(EDPXML(I)) Q:'I W !,EDPXML(I) "RTN","EDPFPTC",104,0) K EDPXML "RTN","EDPFPTC",105,0) Q "RTN","EDPFPTC",106,0) TEST1 ; "RTN","EDPFPTC",107,0) S EDPSITE=$$IEN^XUAF4(442),NAME="doe,john" "RTN","EDPFPTC",108,0) D CHK(1,"",NAME) "RTN","EDPFPTC",109,0) ; "RTN","EDPFPTC",110,0) ;DO LATER? -- linked progress notes "RTN","EDPFPTC",111,0) ;D GETTITLE^TIUPRF2(.EDPT,DFN,EDI),GETNOTES^TIUPRF2(.EDPN,DFN,EDPT,1) "RTN","EDPFPTC",112,0) ;I $O(EDPN(0)) D "RTN","EDPFPTC",113,0) ;. D XML^EDPX("") "RTN","EDPFPTC",114,0) ;. S N=0 F S N=$O(EDPN(N)) Q:N<1 K PN S X=EDPN(N) D "RTN","EDPFPTC",115,0) ;.. S PN("id")=+X,PN("action")=$P(X,U,2),PN("author")=$P(X,U,4) "RTN","EDPFPTC",116,0) ;.. S PN("noteTS")=9999999-N "RTN","EDPFPTC",117,0) ;.. D TGET^TIUSRVR1(.EDPX,+X) "RTN","EDPFPTC",118,0) ;.. S X=$$XMLA^EDPX("note",.PN),X=$TR(X,"/") D XML^EDPX(X) "RTN","EDPFPTC",119,0) ;.. S I=1,X=$G(@EDPX@(1)) "RTN","EDPFPTC",120,0) ;.. F S I=$O(@EDPX@(I)) Q:I<1 S X=X_$C(13,10)_$G(@EDPX@(I)) "RTN","EDPFPTC",121,0) ;.. S X=""_$$ESC^EDPX(X)_"" D XML^EDPX(X) "RTN","EDPFPTC",122,0) ;.. D XML^EDPX("") "RTN","EDPFPTC",123,0) ;. D XML^EDPX("") "RTN","EDPFPTL") 0^6^B4915038 "RTN","EDPFPTL",1,0) EDPFPTL ;SLC/KCM - Select Patient at Facility "RTN","EDPFPTL",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPFPTL",3,0) ; "RTN","EDPFPTL",4,0) MATCH(MATCH) ; return XML of matching patients "RTN","EDPFPTL",5,0) S MATCH=$$UP^XLFSTR(MATCH) "RTN","EDPFPTL",6,0) Q:MATCH="" "RTN","EDPFPTL",7,0) ; "RTN","EDPFPTL",8,0) S:+MATCH MATCH=$TR(MATCH,"-","") "RTN","EDPFPTL",9,0) ; "RTN","EDPFPTL",10,0) N LST S LST=0 "RTN","EDPFPTL",11,0) N LIMIT S LIMIT=100 "RTN","EDPFPTL",12,0) I MATCH?4N D BS(MATCH) "RTN","EDPFPTL",13,0) I MATCH?1U4N D BS5(MATCH) "RTN","EDPFPTL",14,0) I MATCH?9N.1U D SSN(MATCH) "RTN","EDPFPTL",15,0) D LNAM(MATCH) "RTN","EDPFPTL",16,0) I LST=0 D NONE("No matches found.") "RTN","EDPFPTL",17,0) I LST>0 D LIST(.LST) "RTN","EDPFPTL",18,0) I LIMIT<1 D "RTN","EDPFPTL",19,0) . D NONE("Limit of 100 matches reached.") "RTN","EDPFPTL",20,0) . D XML^EDPX("true") "RTN","EDPFPTL",21,0) Q "RTN","EDPFPTL",22,0) ; "RTN","EDPFPTL",23,0) NONE(MSG) ; create a "no match" entry "RTN","EDPFPTL",24,0) N X "RTN","EDPFPTL",25,0) S X("name")=MSG "RTN","EDPFPTL",26,0) S X("ssn")="",X("dob")="",X("dfn")=0 "RTN","EDPFPTL",27,0) D XML^EDPX($$XMLA^EDPX("ptlk",.X)) "RTN","EDPFPTL",28,0) Q "RTN","EDPFPTL",29,0) LIST(LST) ; list names that match "RTN","EDPFPTL",30,0) N I,X,DFN,NAME "RTN","EDPFPTL",31,0) S NAME="" F S NAME=$O(LST(NAME)) Q:NAME="" D "RTN","EDPFPTL",32,0) . S DFN=0 F S DFN=$O(LST(NAME,DFN)) Q:'DFN D "RTN","EDPFPTL",33,0) .. S X("name")=NAME "RTN","EDPFPTL",34,0) .. S X("ssn")=$$SSN^DPTLK1(DFN) ; DG249 "RTN","EDPFPTL",35,0) .. S X("dob")=$$DOB^DPTLK1(DFN) ; DG249 "RTN","EDPFPTL",36,0) .. S X("dfn")=DFN "RTN","EDPFPTL",37,0) .. D XML^EDPX($$XMLA^EDPX("ptlk",.X)) "RTN","EDPFPTL",38,0) Q "RTN","EDPFPTL",39,0) BS(X) ; find matches on 9999 (BS) "RTN","EDPFPTL",40,0) ; expects LST,LIMIT to be defined "RTN","EDPFPTL",41,0) N DFN S DFN=0 "RTN","EDPFPTL",42,0) F S DFN=$O(^DPT("BS",X,DFN)) Q:'DFN D "RTN","EDPFPTL",43,0) . S LIMIT=LIMIT-1 I LIMIT<1 Q "RTN","EDPFPTL",44,0) . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)="" "RTN","EDPFPTL",45,0) Q "RTN","EDPFPTL",46,0) BS5(X) ; find matches on X9999 (BS5) "RTN","EDPFPTL",47,0) ; expects LST,LIMIT to be defined "RTN","EDPFPTL",48,0) N DFN S DFN=0 "RTN","EDPFPTL",49,0) F S DFN=$O(^DPT("BS5",X,DFN)) Q:'DFN D "RTN","EDPFPTL",50,0) . S LIMIT=LIMIT-1 I LIMIT<1 Q "RTN","EDPFPTL",51,0) . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)="" "RTN","EDPFPTL",52,0) Q "RTN","EDPFPTL",53,0) SSN(X) ; find matches on 999999999 (SSN) "RTN","EDPFPTL",54,0) ; expects LST,LIMIT to be defined "RTN","EDPFPTL",55,0) N DFN S DFN=0 "RTN","EDPFPTL",56,0) F S DFN=$O(^DPT("SSN",X,DFN)) Q:'DFN D "RTN","EDPFPTL",57,0) . S LIMIT=LIMIT-1 I LIMIT<1 Q "RTN","EDPFPTL",58,0) . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)="" "RTN","EDPFPTL",59,0) Q "RTN","EDPFPTL",60,0) LNAM(X) ; find matches on name (B) "RTN","EDPFPTL",61,0) ; expects LST,LIMIT to be defined "RTN","EDPFPTL",62,0) N DFN,NAME "RTN","EDPFPTL",63,0) S NAME=$O(^DPT("B",X),-1) "RTN","EDPFPTL",64,0) F S NAME=$O(^DPT("B",NAME)) Q:$E(NAME,1,$L(X))'=X Q:NAME="" Q:LIMIT<1 D "RTN","EDPFPTL",65,0) . S DFN=0 F S DFN=$O(^DPT("B",NAME,DFN)) Q:'DFN D "RTN","EDPFPTL",66,0) .. S LIMIT=LIMIT-1 I LIMIT<1 Q "RTN","EDPFPTL",67,0) .. S LST=LST+1,LST(NAME,DFN)="" "RTN","EDPFPTL",68,0) Q "RTN","EDPLOG") 0^37^B42149061 "RTN","EDPLOG",1,0) EDPLOG ;SLC/KCM - Update ED Log - Update ;1/26/09 14:14 "RTN","EDPLOG",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPLOG",3,0) ; "RTN","EDPLOG",4,0) ;TODO: add transaction processing "RTN","EDPLOG",5,0) ; "RTN","EDPLOG",6,0) UPD(REQ,REMOVE) ; Update a record "RTN","EDPLOG",7,0) N REC D NVPARSE^EDPX(.REC,REQ) "RTN","EDPLOG",8,0) N IEN S IEN=$$VAL("id") "RTN","EDPLOG",9,0) I '$G(IEN) D FAIL("upd",2300007) Q "RTN","EDPLOG",10,0) I '$D(^EDP(230,IEN,0)) D FAIL("upd",2300006) Q "RTN","EDPLOG",11,0) N ERR S ERR=$$VALID^EDPLOG1(.REC) I $L(ERR) D FAIL("upd",ERR) Q "RTN","EDPLOG",12,0) N AMB S AMB="(ambulance en route)" "RTN","EDPLOG",13,0) ; "RTN","EDPLOG",14,0) ; compute the local time & "no value" ien "RTN","EDPLOG",15,0) N TIME S TIME=$$NOW^XLFDT "RTN","EDPLOG",16,0) N EDPNOVAL S EDPNOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0)) "RTN","EDPLOG",17,0) ; before allowing remove, check the required fields "RTN","EDPLOG",18,0) S REMOVE=$G(REMOVE,0)!$P(^EDP(230,IEN,0),U,7) ; removing or closed "RTN","EDPLOG",19,0) I REMOVE D RDY2RMV Q:'REC("closed") "RTN","EDPLOG",20,0) ; "RTN","EDPLOG",21,0) ; get the existing log entry "RTN","EDPLOG",22,0) N X0,X1,X2,X3,AREA,I "RTN","EDPLOG",23,0) S X0=^EDP(230,IEN,0),X1=$G(^(1)),X2=$G(^(2)),X3=$G(^(3)) "RTN","EDPLOG",24,0) S AREA=$P(X0,U,3),^EDPB(231.9,AREA,230)=$H ; last update timestamp "RTN","EDPLOG",25,0) ; "RTN","EDPLOG",26,0) N NAME,DFN,SSN,PCE "RTN","EDPLOG",27,0) S NAME=$$VAL("name"),DFN=$$VAL("dfn"),SSN="" "RTN","EDPLOG",28,0) I DFN S SSN=$P(^DPT(DFN,0),U,9) "RTN","EDPLOG",29,0) I '$P(X0,U,8),((NAME'=AMB)!DFN) S REC("inTS")=TIME "RTN","EDPLOG",30,0) ; Update any fields that have values passed in "RTN","EDPLOG",31,0) N FDA,FDAIEN,DIERR,HIST "RTN","EDPLOG",32,0) D SETFDA(X0,4,"name",.04) "RTN","EDPLOG",33,0) ;D SETFDA(X0,5,"ssn",.05) -- NtoL "RTN","EDPLOG",34,0) D SETFDA(X0,6,"dfn",.06) "RTN","EDPLOG",35,0) D SETFDA(X0,7,"closed",.07) "RTN","EDPLOG",36,0) D SETFDA(X0,8,"inTS",.08) "RTN","EDPLOG",37,0) D SETFDA(X0,9,"outTS",.09) "RTN","EDPLOG",38,0) D SETFDA(X0,10,"arrival",.1) "RTN","EDPLOG",39,0) D SETFDA(X0,14,"clinic",.14) "RTN","EDPLOG",40,0) D SETFDA(X1,1,"complaint",1.1) "RTN","EDPLOG",41,0) D SETFDA(X2,1,"compLong",2) "RTN","EDPLOG",42,0) D SETFDA(X3,2,"status",3.2) "RTN","EDPLOG",43,0) D SETFDA(X3,3,"acuity",3.3) "RTN","EDPLOG",44,0) D SETFDA(X3,4,"bed",3.4) "RTN","EDPLOG",45,0) D SETFDA(X3,5,"provider",3.5) "RTN","EDPLOG",46,0) D SETFDA(X3,6,"nurse",3.6) "RTN","EDPLOG",47,0) D SETFDA(X3,7,"resident",3.7) "RTN","EDPLOG",48,0) D SETFDA(X3,8,"comment",3.8) "RTN","EDPLOG",49,0) D SETFDA(X1,5,"delay",1.5) "RTN","EDPLOG",50,0) D SETFDA(X1,2,"disposition",1.2) "RTN","EDPLOG",51,0) I $G(FDA(230,IEN_",",1.2)) S FDA(230,IEN_",",1.3)=TIME "RTN","EDPLOG",52,0) I $L(NAME)&$L(SSN) S FDA(230,IEN_",",.11)=$E(NAME)_$E(SSN,6,9) "RTN","EDPLOG",53,0) I $$VAL("updDiag") S HIST(230.1,"+1,",9.1)=$G(HIST(230.1,"+1,",9.1))_"4;" "RTN","EDPLOG",54,0) ; "RTN","EDPLOG",55,0) L +^EDP(230,IEN):3 E D FAIL("upd",2300015) Q "RTN","EDPLOG",56,0) ; be sure to unlock before quitting! "RTN","EDPLOG",57,0) I $$COLLIDE^EDPLOGH(IEN,$$VAL("loadTS")) L -^EDP(230,IEN) Q "RTN","EDPLOG",58,0) I $$BEDGONE^EDPLOGH(AREA,$P(X3,U,4),$$VAL("bed")) D FAIL("upd",2300016) L -^EDP(230,IEN) Q "RTN","EDPLOG",59,0) I $D(HIST)>9 D SAVE^EDPLOGH(IEN,TIME,.HIST) "RTN","EDPLOG",60,0) I $D(FDA)>9 D FILE^DIE("","FDA","ERR") "RTN","EDPLOG",61,0) I '$D(DIERR),$$VAL("updDiag") D UPDDIAG "RTN","EDPLOG",62,0) L -^EDP(230,IEN) "RTN","EDPLOG",63,0) I $D(DIERR) D FAIL("upd",2300008) Q "RTN","EDPLOG",64,0) ; "RTN","EDPLOG",65,0) D UPDVISIT^EDPLPCE(IEN,.PCE) "RTN","EDPLOG",66,0) ; "RTN","EDPLOG",67,0) I (DFN&'$P(X0,U,6))!($G(REC("inTS"))&'$P(X0,U,8)) D EVT^EDPLOGA(IEN) "RTN","EDPLOG",68,0) ; "RTN","EDPLOG",69,0) D XML^EDPX("") "RTN","EDPLOG",70,0) Q "RTN","EDPLOG",71,0) UPDDIAG ; process diagnoses "RTN","EDPLOG",72,0) ; called from UPD^EDPLOG "RTN","EDPLOG",73,0) ; expects REC,PCE,IEN,TIME,AREA to be defined "RTN","EDPLOG",74,0) N DIAG,I,FDA,FDAIEN,ERR,CODED,CODE "RTN","EDPLOG",75,0) S DIAG="diagnosis-0",I=0,CODED=$P($G(^EDPB(231.9,AREA,1)),U,2) "RTN","EDPLOG",76,0) F S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-" D "RTN","EDPLOG",77,0) . S I=I+1,REC("diagnosis",I)=REC(DIAG) "RTN","EDPLOG",78,0) . I CODED S PCE($P(REC(DIAG),U),I)=REC(DIAG) "RTN","EDPLOG",79,0) I $D(REC("diagnosis"))<10 Q "RTN","EDPLOG",80,0) ; replace the diagnosis multiple "RTN","EDPLOG",81,0) D DELDIAG(IEN) "RTN","EDPLOG",82,0) S FDA(230,IEN_",",1.4)=TIME "RTN","EDPLOG",83,0) S I=0 F S I=$O(REC("diagnosis",I)) Q:'I D "RTN","EDPLOG",84,0) . Q:$P(REC("diagnosis",I),U,6) ; entry being removed "RTN","EDPLOG",85,0) . S CODE=$P(REC("diagnosis",I),U,2) "RTN","EDPLOG",86,0) . S CODE=$S(+CODE:$$ICDONE^LEXU(CODE,TIME),1:"") "RTN","EDPLOG",87,0) . S:'$L(CODE) CODE=$P($P(REC("diagnosis",I),U,3),"/",1) "RTN","EDPLOG",88,0) . S:$L(CODE) CODE=+$O(^ICD9("BA",CODE_" ",0)) "RTN","EDPLOG",89,0) . S FDA(230.04,"+"_I_","_IEN_",",.01)=$P(REC("diagnosis",I),U,4) "RTN","EDPLOG",90,0) . S FDA(230.04,"+"_I_","_IEN_",",.02)=CODE "RTN","EDPLOG",91,0) . S FDA(230.04,"+"_I_","_IEN_",",.03)=$P(REC("diagnosis",I),U,8) "RTN","EDPLOG",92,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPLOG",93,0) Q "RTN","EDPLOG",94,0) DELDIAG(IEN) ; delete the diagnosis multiple "RTN","EDPLOG",95,0) I '$O(^EDP(230,IEN,4,0)) Q ; no child nodes "RTN","EDPLOG",96,0) N DA,DIK S DA=0,DA(1)=IEN,DIK="^EDP(230,"_DA(1)_",4," "RTN","EDPLOG",97,0) F S DA=$O(^EDP(230,IEN,4,DA)) Q:'DA D ^DIK "RTN","EDPLOG",98,0) Q "RTN","EDPLOG",99,0) HAVEDIAG() ; return true if a diagnosis is present "RTN","EDPLOG",100,0) ; expects REC to be defined "RTN","EDPLOG",101,0) N FOUND S FOUND=0 "RTN","EDPLOG",102,0) N DIAG S DIAG="diagnosis-0" "RTN","EDPLOG",103,0) F S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-" D Q:FOUND "RTN","EDPLOG",104,0) . I '$P(REC(DIAG),U,6) S FOUND=1 ; 6th piece is delete flag "RTN","EDPLOG",105,0) Q FOUND "RTN","EDPLOG",106,0) ; "RTN","EDPLOG",107,0) RDY2RMV ; check required fields & set up so ready to remove "RTN","EDPLOG",108,0) ; called from UPD, expects REC and IEN and TIME "RTN","EDPLOG",109,0) ; "RTN","EDPLOG",110,0) ; check special dispositions first "RTN","EDPLOG",111,0) N DISP,CLOSE "RTN","EDPLOG",112,0) S DISP=+$$VAL("disposition"),CLOSE=0 "RTN","EDPLOG",113,0) I DISP=+$O(^EDPB(233.1,"B","edp.disposition.error",0)) S CLOSE=1 "RTN","EDPLOG",114,0) I DISP=+$O(^EDPB(233.1,"B","edp.disposition.nec",0)) S CLOSE=1 "RTN","EDPLOG",115,0) I DISP=+$O(^EDPB(233.1,"B","edp.disposition.left",0)) S CLOSE=1 "RTN","EDPLOG",116,0) I CLOSE S:'$$VAL("outTS") REC("outTS")=TIME S REC("closed")=1 Q "RTN","EDPLOG",117,0) ; "RTN","EDPLOG",118,0) ; check the generally required fields "RTN","EDPLOG",119,0) N MISSING S MISSING="" "RTN","EDPLOG",120,0) S REC("closed")=0 "RTN","EDPLOG",121,0) I '$L($$VAL("complaint")) S MISSING=MISSING_"Complaint " "RTN","EDPLOG",122,0) I '$$VAL("bed") S MISSING=MISSING_"Room/Area " "RTN","EDPLOG",123,0) I '$$VAL("provider") S MISSING=MISSING_"Provider " "RTN","EDPLOG",124,0) I $$NOVAL("acuity") S MISSING=MISSING_"Acuity " "RTN","EDPLOG",125,0) ; "RTN","EDPLOG",126,0) ; check the other disposition required fields "RTN","EDPLOG",127,0) N X1,AREA,MIN,STS,OUT "RTN","EDPLOG",128,0) S AREA=$P(^EDP(230,IEN,0),U,3),STS=$P($G(^(3)),U,2) "RTN","EDPLOG",129,0) S X1=$G(^EDPB(231.9,AREA,1)) "RTN","EDPLOG",130,0) S MIN=$$VAL("inTS") S:'MIN MIN=$P(^EDP(230,IEN,0),U,8) "RTN","EDPLOG",131,0) S OUT=$$VAL("outTS") S:'OUT OUT=TIME "RTN","EDPLOG",132,0) S MIN=$$FMDIFF^XLFDT(OUT,MIN,2)\60 "RTN","EDPLOG",133,0) I $P(X1,U,1),'$$HAVEDIAG S MISSING=MISSING_"Diagnosis " "RTN","EDPLOG",134,0) I $P(X1,U,3),$$NOVAL("disposition") S MISSING=MISSING_"Disposition " "RTN","EDPLOG",135,0) ; (client parses for string "Delay Reason" to know whether to enable delay reason control) "RTN","EDPLOG",136,0) I $P(X1,U,4),(MIN>$P(X1,U,5)),$$NOVAL("delay"),'$$OBS(STS) S MISSING=MISSING_"Delay Reason " "RTN","EDPLOG",137,0) I $L(MISSING) D FAIL("upd","Fields required for removal are missing: "_MISSING) Q "RTN","EDPLOG",138,0) S:'$$VAL("outTS") REC("outTS")=TIME S REC("closed")=1 "RTN","EDPLOG",139,0) Q "RTN","EDPLOG",140,0) VAL(X) ; Returns parameter value or null "RTN","EDPLOG",141,0) ; HTTP passes HTML-escaped values in an array as REC(param) "RTN","EDPLOG",142,0) Q $G(REC(X)) "RTN","EDPLOG",143,0) ; "RTN","EDPLOG",144,0) NOVAL(X) ; Returns true if value is empty, 0, or edp.reserved.novalue "RTN","EDPLOG",145,0) ; expects EDPNOVAL to be defined "RTN","EDPLOG",146,0) I +$G(REC(X))=0 Q 1 "RTN","EDPLOG",147,0) I +$G(REC(X))=EDPNOVAL Q 1 "RTN","EDPLOG",148,0) Q 0 "RTN","EDPLOG",149,0) ; "RTN","EDPLOG",150,0) OBS(X) ; Returns 1 or 0, if observation status X "RTN","EDPLOG",151,0) Q ($P($G(^EDPB(233.1,+$G(X),0)),U,5)["O") "RTN","EDPLOG",152,0) ; "RTN","EDPLOG",153,0) SETFDA(NODE,P,SUB,FLD) ; Creates value in FDA & HIST arrays as appropriate "RTN","EDPLOG",154,0) ; from UPD, expects REC, FDA, HIST to be defined "RTN","EDPLOG",155,0) Q:'$D(REC(SUB)) ; value not sent in message "RTN","EDPLOG",156,0) Q:$P(NODE,U,P)=REC(SUB) ; value is the same "RTN","EDPLOG",157,0) ; don't save switch from null to 0 or NOVAL to 0 "RTN","EDPLOG",158,0) ; since 0 is always sent as none value for combo box fields "RTN","EDPLOG",159,0) I (REC(SUB)=0),($P(NODE,U,P)=""),("^.1^1.2^1.5^3.2^3.3^3.4^3.5^3.6^3.7^"[(U_FLD_U)) Q "RTN","EDPLOG",160,0) I (REC(SUB)=0),($P(NODE,U,P)=EDPNOVAL),("^.1^1.2^1.5^3.2^3.3^"[(U_FLD_U)) Q "RTN","EDPLOG",161,0) ; "RTN","EDPLOG",162,0) I REC(SUB)="" S REC(SUB)="@" ; we must be deleting field if empty "RTN","EDPLOG",163,0) S FDA(230,IEN_",",FLD)=REC(SUB) "RTN","EDPLOG",164,0) ; save the changed fields in the history "RTN","EDPLOG",165,0) I $L(REC(SUB)) D "RTN","EDPLOG",166,0) . S HIST(230.1,"+1,",9.1)=$G(HIST(230.1,"+1,",9.1))_FLD_";" "RTN","EDPLOG",167,0) . S:FLD=1.1 FLD=.07 ; complaint "RTN","EDPLOG",168,0) . S:FLD=1.2 FLD=.11 ; disposition "RTN","EDPLOG",169,0) . S:FLD=1.5 FLD=.12 ; delay "RTN","EDPLOG",170,0) . S HIST(230.1,"+1,",FLD)=REC(SUB) "RTN","EDPLOG",171,0) . ; check for updated providers "RTN","EDPLOG",172,0) . S:FLD=3.5 PCE("PRV",1)=REC(SUB),PCE("PRI")=REC(SUB) ; primary provider "RTN","EDPLOG",173,0) . S:FLD=3.6 PCE("PRV",2)=REC(SUB) ; nurse "RTN","EDPLOG",174,0) . S:FLD=3.7 PCE("PRV",3)=REC(SUB) ; resident "RTN","EDPLOG",175,0) Q "RTN","EDPLOG",176,0) FAIL(ELEM,MSG) ; creates failure node for returned XML "RTN","EDPLOG",177,0) N X "RTN","EDPLOG",178,0) I +MSG S MSG=$$MSG^EDPX(MSG) "RTN","EDPLOG",179,0) S X="<"_ELEM_" id='"_$$VAL("id")_"' status='fail' msg='"_MSG_"' />" "RTN","EDPLOG",180,0) D XML^EDPX(X) "RTN","EDPLOG",181,0) S EDPFAIL=1 "RTN","EDPLOG",182,0) Q "RTN","EDPLOG1") 0^38^B2583250 "RTN","EDPLOG1",1,0) EDPLOG1 ;SLC/KCM - Update ED Log - Validate "RTN","EDPLOG1",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPLOG1",3,0) ; "RTN","EDPLOG1",4,0) VALID(REC) ; validate the entries passed in REC "RTN","EDPLOG1",5,0) D XLATE("arrival") "RTN","EDPLOG1",6,0) D XLATE("clinic") "RTN","EDPLOG1",7,0) D XLATE("bed") "RTN","EDPLOG1",8,0) D XLATE("acuity") "RTN","EDPLOG1",9,0) D XLATE("status") "RTN","EDPLOG1",10,0) D XLATE("provider") "RTN","EDPLOG1",11,0) D XLATE("nurse") "RTN","EDPLOG1",12,0) D XLATE("resident") "RTN","EDPLOG1",13,0) D XLATE("disposition") "RTN","EDPLOG1",14,0) D XLATE("delay") "RTN","EDPLOG1",15,0) ; "RTN","EDPLOG1",16,0) N ERR S ERR="" "RTN","EDPLOG1",17,0) D ADDTXT(.ERR,$$CHECK("name",230,.04,"Patient Name")) "RTN","EDPLOG1",18,0) D ADDTXT(.ERR,$$CHECK("complaint",230,1.1,"Complaint")) "RTN","EDPLOG1",19,0) D ADDTXT(.ERR,$$CHECK("compLong",230,2,"Long Complaint")) "RTN","EDPLOG1",20,0) D ADDTXT(.ERR,$$CHECK("comment",230,3.8,"Comment")) "RTN","EDPLOG1",21,0) ; "RTN","EDPLOG1",22,0) N DIAG S DIAG="diagnosis-0" "RTN","EDPLOG1",23,0) F S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-" D "RTN","EDPLOG1",24,0) . S REC("edpDiagnosis")=$P(REC(DIAG),U,2) "RTN","EDPLOG1",25,0) . D ADDTXT(ERR,$$CHECK("edpDiagnosis",230.04,.01,"Diagnosis")) "RTN","EDPLOG1",26,0) Q ERR "RTN","EDPLOG1",27,0) ; "RTN","EDPLOG1",28,0) CHECK(NAME,FILE,FIELD,MSG) ; return error msg if field is not valid "RTN","EDPLOG1",29,0) ; called from VALID, assumes REC is defined "RTN","EDPLOG1",30,0) N VAL,EDPRSLT "RTN","EDPLOG1",31,0) S VAL=$G(REC(NAME)) "RTN","EDPLOG1",32,0) I VAL="" Q "" "RTN","EDPLOG1",33,0) D CHK^DIE(FILE,FIELD,"",VAL,.EDPRSLT) "RTN","EDPLOG1",34,0) I EDPRSLT="^" Q MSG_" is not valid." "RTN","EDPLOG1",35,0) Q "" "RTN","EDPLOG1",36,0) ADDTXT(X,NEW) ; add new text comma delimited "RTN","EDPLOG1",37,0) I $L(NEW),$L(X) S X=X_", "_NEW "RTN","EDPLOG1",38,0) I $L(NEW),'$L(X) S X=NEW "RTN","EDPLOG1",39,0) Q "RTN","EDPLOG1",40,0) XLATE(NAME) ; set up pointer fields for FDA array "RTN","EDPLOG1",41,0) Q:'$D(REC(NAME)) "RTN","EDPLOG1",42,0) ;I REC(NAME)=0 S REC(NAME)="" ; store 0 when removing staff "RTN","EDPLOG1",43,0) I REC(NAME)=-1 S REC(NAME)="@" "RTN","EDPLOG1",44,0) Q "RTN","EDPLOGA") 0^39^B10789313 "RTN","EDPLOGA",1,0) EDPLOGA ;SLC/KCM - Add Entry to ED Log "RTN","EDPLOGA",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPLOGA",3,0) ; "RTN","EDPLOGA",4,0) ;TODO: add transaction processing "RTN","EDPLOGA",5,0) ; "RTN","EDPLOGA",6,0) ADD(NEWPT,AREA,TIME,CHOICES) ; Create a new ED Log record for a patient "RTN","EDPLOGA",7,0) ; add the new record to the returned XML "RTN","EDPLOGA",8,0) ; NEWPT = dfn \T name \T dob \T ssn "RTN","EDPLOGA",9,0) N DFN,NAME,SSN,STATUS,BED,ARR,REC,AMB,CLINIC "RTN","EDPLOGA",10,0) S AMB="(ambulance en route)" "RTN","EDPLOGA",11,0) ; "RTN","EDPLOGA",12,0) ; Set up the patient fields that were passed in "RTN","EDPLOGA",13,0) D NVPARSE^EDPX(.REC,NEWPT) "RTN","EDPLOGA",14,0) S DFN=REC("dfn"),NAME=REC("name"),SSN="",CLINIC=$G(REC("clinic")) "RTN","EDPLOGA",15,0) I DFN S REC("name")=$P(^DPT(DFN,0),U),REC("ssn")=$P(^DPT(DFN,0),U,9) "RTN","EDPLOGA",16,0) ;S SSN=REC("ssn") S:SSN="*SENSITIVE*" SSN="" --NtoL "RTN","EDPLOGA",17,0) I 'DFN,(NAME="") D FAIL^EDPLOG("add",2300014) Q "RTN","EDPLOGA",18,0) ; "RTN","EDPLOGA",19,0) ; Add default values to stub entry (should be based on config for area) "RTN","EDPLOGA",20,0) S BED=$P(^EDPB(231.9,AREA,1),U,12) "RTN","EDPLOGA",21,0) I $G(REC("name"))=AMB D "RTN","EDPLOGA",22,0) . S ARR=$O(^EDPB(233.1,"B","edp.arrival.ambulance",0)) "RTN","EDPLOGA",23,0) . S BED=$P(^EDPB(231.9,AREA,1),U,11) "RTN","EDPLOGA",24,0) S STATUS="" I BED S STATUS=$P(^EDPB(231.8,BED,0),U,8) "RTN","EDPLOGA",25,0) ; "RTN","EDPLOGA",26,0) I +DFN,$D(^EDP(230,"AP",EDPSITE,AREA,DFN)) D FAIL^EDPLOG("add",2300002) Q "RTN","EDPLOGA",27,0) I 'DFN,(NAME'=AMB),$D(^EDP(230,"AN",EDPSITE,AREA,NAME)) D FAIL^EDPLOG("add",2300002) Q "RTN","EDPLOGA",28,0) N ERR S ERR=$$VALID^EDPLOG1(.REC) I $L(ERR) D FAIL^EDPLOG("add",ERR) Q "RTN","EDPLOGA",29,0) S ^EDPB(231.9,AREA,230)=$H ; last update timestamp "RTN","EDPLOGA",30,0) ; "RTN","EDPLOGA",31,0) ; Create a current log record "RTN","EDPLOGA",32,0) N FDA,FDAIEN,DIERR,HIST,HISTIEN,LOGIEN "RTN","EDPLOGA",33,0) S FDA(230,"+1,",.01)=TIME "RTN","EDPLOGA",34,0) S FDA(230,"+1,",.02)=EDPSITE "RTN","EDPLOGA",35,0) S FDA(230,"+1,",.03)=AREA "RTN","EDPLOGA",36,0) S FDA(230,"+1,",.04)=NAME "RTN","EDPLOGA",37,0) ;S FDA(230,"+1,",.05)=SSN --NtoL "RTN","EDPLOGA",38,0) S FDA(230,"+1,",.06)=DFN "RTN","EDPLOGA",39,0) S FDA(230,"+1,",3.2)=STATUS "RTN","EDPLOGA",40,0) S FDA(230,"+1,",3.4)=BED "RTN","EDPLOGA",41,0) I $L(SSN) S FDA(230,"+1,",.11)=$E(NAME)_$E(SSN,6,9) "RTN","EDPLOGA",42,0) I NAME=AMB S FDA(230,"+1,",.11)="(amb)" "RTN","EDPLOGA",43,0) I NAME'=AMB S FDA(230,"+1,",.08)=TIME "RTN","EDPLOGA",44,0) I $G(ARR) S FDA(230,"+1,",.1)=ARR "RTN","EDPLOGA",45,0) I CLINIC S FDA(230,"+1,",.14)=CLINIC "RTN","EDPLOGA",46,0) I $G(REC("create")) S FDA(230,"+1,",.13)=REC("create") "RTN","EDPLOGA",47,0) M HIST(230.1)=FDA(230) "RTN","EDPLOGA",48,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPLOGA",49,0) I $D(DIERR) D FAIL^EDPLOG("add",2300004) Q "RTN","EDPLOGA",50,0) S LOGIEN=FDAIEN(1) "RTN","EDPLOGA",51,0) ; "RTN","EDPLOGA",52,0) ; Post new patient event "RTN","EDPLOGA",53,0) I DFN,TIME D EVT(LOGIEN) "RTN","EDPLOGA",54,0) ; "RTN","EDPLOGA",55,0) ; Create the first history entry "RTN","EDPLOGA",56,0) S HIST(230.1,"+1,",.01)=LOGIEN "RTN","EDPLOGA",57,0) S HIST(230.1,"+1,",.02)=TIME "RTN","EDPLOGA",58,0) S HIST(230.1,"+1,",.03)=EDPUSER "RTN","EDPLOGA",59,0) K HIST(230.1,"+1,",.11) ; don't need last4 "RTN","EDPLOGA",60,0) K HIST(230.1,"+1,",.13) ; don't need creation source "RTN","EDPLOGA",61,0) D UPDATE^DIE("","HIST","HISTIEN","ERR") "RTN","EDPLOGA",62,0) I $D(DIERR) D FAIL^EDPLOG("add",2300004) Q "RTN","EDPLOGA",63,0) ; "RTN","EDPLOGA",64,0) D XML^EDPX("") "RTN","EDPLOGA",65,0) D GET^EDPQLE(FDAIEN(1),CHOICES) "RTN","EDPLOGA",66,0) Q "RTN","EDPLOGA",67,0) ; "RTN","EDPLOGA",68,0) DEL(AREA,LOGID) ; Delete Stub Log Entry "RTN","EDPLOGA",69,0) N I,CNT,DIK,DA "RTN","EDPLOGA",70,0) S I=0,CNT=0 F S I=$O(^EDP(230.1,"B",LOGID,I)) Q:'I S CNT=CNT+1 "RTN","EDPLOGA",71,0) I $L($P($G(^EDP(230,LOGID,1)),U))!(CNT>1) D Q "RTN","EDPLOGA",72,0) . D FAIL^EDPLOG("upd","Does not appear to be a stub entry") "RTN","EDPLOGA",73,0) ; "RTN","EDPLOGA",74,0) ; Delete initial history entry "RTN","EDPLOGA",75,0) S DIK="^EDP(230.1,",DA=$O(^EDP(230.1,"B",LOGID,0)) "RTN","EDPLOGA",76,0) I DA D ^DIK "RTN","EDPLOGA",77,0) ; Delete stub log entry "RTN","EDPLOGA",78,0) S DIK="^EDP(230,",DA=LOGID "RTN","EDPLOGA",79,0) D ^DIK "RTN","EDPLOGA",80,0) ; "RTN","EDPLOGA",81,0) D XML^EDPX("") "RTN","EDPLOGA",82,0) Q "RTN","EDPLOGA",83,0) ; "RTN","EDPLOGA",84,0) EVT(LOG) ; -- post new patient event [expects EDPSITE] "RTN","EDPLOGA",85,0) N X0,DFN,SDT,SDCL,SDATA,SDAMEVT,X "RTN","EDPLOGA",86,0) S X0=$G(^EDP(230,+$G(LOG),0)),DFN=+$P(X0,U,6),SDT=+$P(X0,U,8) "RTN","EDPLOGA",87,0) I 'DFN!'SDT Q ;missing data "RTN","EDPLOGA",88,0) S SDCL=$$DFLTLOC^EDPLPCE(DFN) Q:'SDCL "RTN","EDPLOGA",89,0) ; have patient, time, hosp loc -> post event "RTN","EDPLOGA",90,0) S SDATA=U_DFN_U_SDT_U_SDCL,SDAMEVT=1 "RTN","EDPLOGA",91,0) S EDPDATA=LOG_SDATA "RTN","EDPLOGA",92,0) S X=+$O(^ORD(101,"B","EDP NEW PATIENT",0))_";ORD(101," "RTN","EDPLOGA",93,0) D EN^XQOR "RTN","EDPLOGA",94,0) Q "RTN","EDPLOGH") 0^40^B9457380 "RTN","EDPLOGH",1,0) EDPLOGH ;SLC/KCM - Add History Entry for ED Log "RTN","EDPLOGH",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPLOGH",3,0) ; "RTN","EDPLOGH",4,0) ;TODO: add transaction processing "RTN","EDPLOGH",5,0) ; "RTN","EDPLOGH",6,0) SAVE(IEN,TIME,HIST) ; save a new history entry for changed fields "RTN","EDPLOGH",7,0) Q:$D(HIST)<10 "RTN","EDPLOGH",8,0) ; "RTN","EDPLOGH",9,0) N HISTIEN,DIERR "RTN","EDPLOGH",10,0) S HIST(230.1,"+1,",.01)=IEN "RTN","EDPLOGH",11,0) S HIST(230.1,"+1,",.02)=TIME "RTN","EDPLOGH",12,0) S HIST(230.1,"+1,",.03)=EDPUSER "RTN","EDPLOGH",13,0) D UPDATE^DIE("","HIST","HISTIEN","ERR") "RTN","EDPLOGH",14,0) Q "RTN","EDPLOGH",15,0) COLLIDE(LOG,LOADTS) ; return true if new updates since load time "RTN","EDPLOGH",16,0) N I,J,TS,IEN,FLDS,MODS "RTN","EDPLOGH",17,0) S TS=LOADTS-0.000001 "RTN","EDPLOGH",18,0) F S TS=$O(^EDP(230.1,"ADF",LOG,TS)) Q:'TS D "RTN","EDPLOGH",19,0) . S IEN=0 F S IEN=$O(^EDP(230.1,"ADF",LOG,TS,IEN)) Q:'IEN D "RTN","EDPLOGH",20,0) .. S MODS=$P($G(^EDP(230.1,IEN,9)),U) "RTN","EDPLOGH",21,0) .. F J=1:1:$L(MODS,";") I $L($P(MODS,";",J)) S FLDS($P(MODS,";",J))="" "RTN","EDPLOGH",22,0) ; no collisions "RTN","EDPLOGH",23,0) I $D(FLDS)<10 Q 0 "RTN","EDPLOGH",24,0) ; "RTN","EDPLOGH",25,0) ; handle collisions "RTN","EDPLOGH",26,0) D XML^EDPX("") "RTN","EDPLOGH",27,0) D XML^EDPX("Since you loaded this entry, changes have been made by someone else:") "RTN","EDPLOGH",28,0) D XML^EDPX(" ") "RTN","EDPLOGH",29,0) N X,X0,X1,X2,X3,PT "RTN","EDPLOGH",30,0) S X0=^EDP(230,LOG,0),X1=$G(^(1)),X2=$G(^(2)),X3=$G(^(3)),PT=0 "RTN","EDPLOGH",31,0) S I=0 F S I=$O(FLDS(I)) Q:'I D "RTN","EDPLOGH",32,0) . I I=.04 S X=$P(X0,U,4) D MSG(X,"Patient Name") S PT=1 "RTN","EDPLOGH",33,0) . I (I=.06),'PT S X=$P(X0,U,6) D MSG($P($G(^DPT(+X,0)),U),"Patient Name") "RTN","EDPLOGH",34,0) . I I=.1 S X=$P(X0,U,10) D MSG($$CODE(X),"Source") "RTN","EDPLOGH",35,0) . I I=1.1 S X=$P(X1,U,1) D MSG(X,"Complaint") "RTN","EDPLOGH",36,0) . I I=1.2 S X=$P(X1,U,2) D MSG($$CODE(X),"Disposition") "RTN","EDPLOGH",37,0) . I I=1.5 S X=$P(X1,U,5) D MSG($$CODE(X),"Delay Reason") "RTN","EDPLOGH",38,0) . I I=2 S X=$P(X2,U,1) D MSG(X,"Long Complaint") "RTN","EDPLOGH",39,0) . I I=3.2 S X=$P(X3,U,2) D MSG($$CODE(X),"Status") "RTN","EDPLOGH",40,0) . I I=3.3 S X=$P(X3,U,3) D MSG($$CODE(X),"Acuity") "RTN","EDPLOGH",41,0) . I I=3.4 S X=$P(X3,U,4) D MSG($P($G(^EDPB(231.8,+X,0)),U),"Room/Area") "RTN","EDPLOGH",42,0) . I I=3.5 S X=$P(X3,U,5) D MSG($$NP(X),"Provider") "RTN","EDPLOGH",43,0) . I I=3.6 S X=$P(X3,U,6) D MSG($$NP(X),"Nurse") "RTN","EDPLOGH",44,0) . I I=3.7 S X=$P(X3,U,7) D MSG($$NP(X),"Resident") "RTN","EDPLOGH",45,0) . I I=3.8 S X=$P(X3,U,8) D MSG(X,"Comment") "RTN","EDPLOGH",46,0) . I I=4 D MSG($$DIAG(LOG),"Diagnosis") "RTN","EDPLOGH",47,0) D XML^EDPX(" ") "RTN","EDPLOGH",48,0) D XML^EDPX("If you wish to overwrite with your changes,") "RTN","EDPLOGH",49,0) D XML^EDPX("close this window and click SAVE again.") "RTN","EDPLOGH",50,0) D XML^EDPX("If you wish to leave this entry as is,") "RTN","EDPLOGH",51,0) D XML^EDPX("close this window and click CANCEL.") "RTN","EDPLOGH",52,0) D XML^EDPX("") "RTN","EDPLOGH",53,0) Q 1 "RTN","EDPLOGH",54,0) ; "RTN","EDPLOGH",55,0) BEDGONE(AREA,CURBED,BED) ; return true if bed is no longer available "RTN","EDPLOGH",56,0) I 'BED Q 0 "RTN","EDPLOGH",57,0) I BED=CURBED Q 0 "RTN","EDPLOGH",58,0) N MULTI S MULTI=$P(^EDPB(231.8,BED,0),U,9) S:MULTI=3 MULTI=0 "RTN","EDPLOGH",59,0) I MULTI Q 0 "RTN","EDPLOGH",60,0) I '$D(^EDP(230,"AL",EDPSITE,AREA,BED)) Q 0 "RTN","EDPLOGH",61,0) Q 1 "RTN","EDPLOGH",62,0) ; "RTN","EDPLOGH",63,0) MSG(VAL,LBL) ; add to XML message "RTN","EDPLOGH",64,0) D XML^EDPX(LBL_" changed to: "_VAL) "RTN","EDPLOGH",65,0) Q "RTN","EDPLOGH",66,0) CODE(IEN) ; return coded value "RTN","EDPLOGH",67,0) I IEN Q $P(^EDPB(233.1,IEN,0),U,2) "RTN","EDPLOGH",68,0) Q "" "RTN","EDPLOGH",69,0) NP(IEN) ; return New Person name "RTN","EDPLOGH",70,0) I IEN Q $P(^VA(200,IEN,0),U) "RTN","EDPLOGH",71,0) Q "" "RTN","EDPLOGH",72,0) DIAG(LOG) ; return list of diagnoses "RTN","EDPLOGH",73,0) N I,X "RTN","EDPLOGH",74,0) S I=0,X="" "RTN","EDPLOGH",75,0) F S I=$O(^EDP(230,LOG,4,I)) Q:'I S X=X_$S($L(X):",",1:"")_$P($G(^EDP(230,LOG,4,I,0)),U) "RTN","EDPLOGH",76,0) Q X "RTN","EDPLPCE") 0^49^B32802123 "RTN","EDPLPCE",1,0) EDPLPCE ;SLC/KCM - Create a Visit "RTN","EDPLPCE",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPLPCE",3,0) ; "RTN","EDPLPCE",4,0) UPDVISIT(LOG,PCE) ; Get / Create a Visit "RTN","EDPLPCE",5,0) ; PCE is list of potential updates to the visit "RTN","EDPLPCE",6,0) ; PCE(TYP,n)=type^ien^code^label^add^del^upd^prim^qty "RTN","EDPLPCE",7,0) N DFN,TS,LOC,X0 "RTN","EDPLPCE",8,0) S X0=^EDP(230,LOG,0),DFN=$P(X0,U,6),TS=$P(X0,U,8),LOC=$P(X0,U,14) "RTN","EDPLPCE",9,0) I 'LOC S LOC=$$DFLTLOC(DFN) "RTN","EDPLPCE",10,0) I 'DFN!('TS)!('LOC) Q 0 ; not enough info "RTN","EDPLPCE",11,0) ; "RTN","EDPLPCE",12,0) N EDPDATA,EDPVISIT,EDPPCHG "RTN","EDPLPCE",13,0) S EDPVISIT=$P(X0,U,12),EDPPCHG=0 S:'EDPVISIT TS=$$TS4VISIT(DFN,LOC,TS) "RTN","EDPLPCE",14,0) ; "RTN","EDPLPCE",15,0) ; if closed record and no visit, bail "RTN","EDPLPCE",16,0) I $P(X0,U,7),'EDPVISIT Q 0 "RTN","EDPLPCE",17,0) ; "RTN","EDPLPCE",18,0) ; if no visit, but diagnoses exist, xfer the diagnoses "RTN","EDPLPCE",19,0) I 'EDPVISIT D XFERDIAG(LOG,.PCE) "RTN","EDPLPCE",20,0) ; remove current primary provider(s) if there is a new one "RTN","EDPLPCE",21,0) I EDPVISIT,$G(PCE("PRI")) D "RTN","EDPLPCE",22,0) . N IPRV,XPRV,OLDPRI "RTN","EDPLPCE",23,0) . K ^TMP("PXKENC",$J) "RTN","EDPLPCE",24,0) . D ENCEVENT^PXAPI(EDPVISIT) "RTN","EDPLPCE",25,0) . S IPRV=0 F S IPRV=$O(^TMP("PXKENC",$J,EDPVISIT,"PRV",IPRV)) Q:'IPRV D "RTN","EDPLPCE",26,0) .. S XPRV=^TMP("PXKENC",$J,EDPVISIT,"PRV",IPRV,0) "RTN","EDPLPCE",27,0) .. Q:$P(XPRV,U,4)'="P" "RTN","EDPLPCE",28,0) .. I +XPRV'=$G(PCE("PRI")) S EDPDATA("PROVIDER",IPRV,"NAME")=+XPRV,EDPDATA("PROVIDER",IPRV,"PRIMARY")=0 "RTN","EDPLPCE",29,0) ; add any new providers that were entered "RTN","EDPLPCE",30,0) S I=0 F S I=$O(PCE("PRV",I)) Q:'I D "RTN","EDPLPCE",31,0) . S EDPDATA("PROVIDER",I,"NAME")=+PCE("PRV",I) "RTN","EDPLPCE",32,0) . I +PCE("PRV",I)=$G(PCE("PRI")) S EDPDATA("PROVIDER",I,"PRIMARY")=1,EDPPCHG=1 "RTN","EDPLPCE",33,0) ; update diagnoses "RTN","EDPLPCE",34,0) S I=0 F S I=$O(PCE("POV",I)) Q:'I D "RTN","EDPLPCE",35,0) . S X=PCE("POV",I) "RTN","EDPLPCE",36,0) . Q:'($P(X,U,5)!$P(X,U,6)!$P(X,U,7)) ; no updates for this diagnosis "RTN","EDPLPCE",37,0) . I $P(X,U,2) D "RTN","EDPLPCE",38,0) .. N CODE S CODE=$$ICDONE^LEXU($P(X,U,2),TS) "RTN","EDPLPCE",39,0) .. S $P(X,U,3)=CODE "RTN","EDPLPCE",40,0) . Q:'$L($P(X,U,3)) ; not coded "RTN","EDPLPCE",41,0) . S IEN=+$O(^ICD9("BA",$P(X,U,3)_" ",0)) Q:'IEN "RTN","EDPLPCE",42,0) . S EDPDATA("DX/PL",I,"DIAGNOSIS")=IEN "RTN","EDPLPCE",43,0) . S EDPDATA("DX/PL",I,"NARRATIVE")=$P(X,U,4) "RTN","EDPLPCE",44,0) . I $P(X,U,8) S EDPDATA("DX/PL",I,"PRIMARY")=1 "RTN","EDPLPCE",45,0) . I $P(X,U,6) S EDPDATA("DX/PL",I,"DELETE")=1 "RTN","EDPLPCE",46,0) ; update procedures "RTN","EDPLPCE",47,0) S I=0 F S I=$O(PCE("CPT",I)) Q:'I D "RTN","EDPLPCE",48,0) . S X=PCE("CPT",I) "RTN","EDPLPCE",49,0) . Q:'($P(X,U,5)!$P(X,U,6)!$P(X,U,7)) ; no updates for this procedure "RTN","EDPLPCE",50,0) . I $P(X,U,2) D "RTN","EDPLPCE",51,0) .. N CODE S CODE=$$CPTONE^LEXU($P(X,U,2),TS) "RTN","EDPLPCE",52,0) .. S $P(X,U,3)=CODE "RTN","EDPLPCE",53,0) . Q:'$L($P(X,U,3)) ; not coded "RTN","EDPLPCE",54,0) . S IEN=+$O(^ICPT("B",$P(X,U,3),0)) "RTN","EDPLPCE",55,0) . S EDPDATA("PROCEDURE",I,"PROCEDURE")=IEN "RTN","EDPLPCE",56,0) . S EDPDATA("PROCEDURE",I,"QTY")=$S($P(X,U,9):$P(X,U,9),1:1) "RTN","EDPLPCE",57,0) . S EDPDATA("PROCEDURE",I,"NARRATIVE")=$P(X,U,4) "RTN","EDPLPCE",58,0) . I $P(X,U,6) S EDPDATA("PROCEDURE",I,"DELETE")=1 "RTN","EDPLPCE",59,0) ; exit if no updates "RTN","EDPLPCE",60,0) Q:'$D(EDPDATA) 0 "RTN","EDPLPCE",61,0) ; "RTN","EDPLPCE",62,0) N EDPKG,EDPSRC,EDPERR,OK "RTN","EDPLPCE",63,0) S EDPKG=$O(^DIC(9.4,"B","EMERGENCY DEPARTMENT",0)) "RTN","EDPLPCE",64,0) S EDPSRC="EDP TRACKING LOG" "RTN","EDPLPCE",65,0) S EDPDATA("ENCOUNTER",1,"PATIENT")=DFN "RTN","EDPLPCE",66,0) S EDPDATA("ENCOUNTER",1,"HOS LOC")=LOC "RTN","EDPLPCE",67,0) S EDPDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A" "RTN","EDPLPCE",68,0) S EDPDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P" "RTN","EDPLPCE",69,0) I 'EDPVISIT S EDPDATA("ENCOUNTER",1,"ENC D/T")=TS "RTN","EDPLPCE",70,0) S OK=$$DATA2PCE^PXAPI("EDPDATA",EDPKG,EDPSRC,.EDPVISIT,,,,EDPPCHG,.EDPERR) "RTN","EDPLPCE",71,0) I OK<1 D "RTN","EDPLPCE",72,0) . N NOW S NOW=$$NOW^XLFDT "RTN","EDPLPCE",73,0) . S ^XTMP("EDPERR-PCE-"_LOG,0)=$$FMADD^XLFDT(NOW,7)_U_NOW_U_"ED PCE Error" "RTN","EDPLPCE",74,0) . S ^XTMP("EDPERR-PCE-"_LOG,"VISIT")=EDPVISIT_U_OK "RTN","EDPLPCE",75,0) . M ^XTMP("EDPERR-PCE-"_LOG,"DATA")=EDPDATA "RTN","EDPLPCE",76,0) . M ^XTMP("EDPERR-PCE-"_LOG,"ERR")=EDPERR "RTN","EDPLPCE",77,0) ; "RTN","EDPLPCE",78,0) ; update the visit pointer in 230 "RTN","EDPLPCE",79,0) I EDPVISIT,OK,($P(X0,U,12)'=EDPVISIT) D "RTN","EDPLPCE",80,0) . N FDA,DIERR,ERR "RTN","EDPLPCE",81,0) . S FDA(230,LOG_",",.12)=EDPVISIT "RTN","EDPLPCE",82,0) . D FILE^DIE("","FDA","ERR") "RTN","EDPLPCE",83,0) Q "RTN","EDPLPCE",84,0) XFERDIAG(LOG,PCE) ; Setup diagnosis list based on entries in 230 "RTN","EDPLPCE",85,0) N IEN,X0,CODE "RTN","EDPLPCE",86,0) K PCE("POV") ; not worried about adds & subtracts, so start over "RTN","EDPLPCE",87,0) S IEN=0 F S IEN=$O(^EDP(230,LOG,4,IEN)) Q:'IEN D "RTN","EDPLPCE",88,0) . S X0=$G(^EDP(230,LOG,4,IEN,0)) "RTN","EDPLPCE",89,0) . S PCE("POV",IEN)="POV^^^^1" "RTN","EDPLPCE",90,0) . S CODE=$P(X0,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U) "RTN","EDPLPCE",91,0) . S $P(PCE("POV",IEN),U,3)=CODE ; code "RTN","EDPLPCE",92,0) . S $P(PCE("POV",IEN),U,4)=$P(X0,U) ; text "RTN","EDPLPCE",93,0) . S $P(PCE("POV",IEN),U,8)=$P(X0,U,3) ; primary "RTN","EDPLPCE",94,0) Q "RTN","EDPLPCE",95,0) DELVISIT(LOG) ; Delete visit for stub entry "RTN","EDPLPCE",96,0) N EDPVISIT S EDPVISIT=$P(^EDP(230,LOG,0),U,12) "RTN","EDPLPCE",97,0) Q:'EDPVISIT "RTN","EDPLPCE",98,0) ; "RTN","EDPLPCE",99,0) N FDA,DIERR,ERR "RTN","EDPLPCE",100,0) S FDA(230,LOG_",",.12)="@" "RTN","EDPLPCE",101,0) D FILE^DIE("","FDA","ERR") "RTN","EDPLPCE",102,0) ; "RTN","EDPLPCE",103,0) S OK=$$DELVFILE^PXAPI("ALL",EDPVISIT,"EMERGENCY DEPARTMENT","EDP TRACKING LOG") "RTN","EDPLPCE",104,0) Q "RTN","EDPLPCE",105,0) DFLTLOC(DFN) ; Return the default location for the ED "RTN","EDPLPCE",106,0) N EDPLST,I,LST,TM,BEG,END,LOCS "RTN","EDPLPCE",107,0) D GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","Q") "RTN","EDPLPCE",108,0) S TM=$E($P($$NOW^XLFDT,".",2)_"0000",1,4) "RTN","EDPLPCE",109,0) ; put time ranges first, then sequence "RTN","EDPLPCE",110,0) S I=0 F S I=$O(EDPLST(I)) Q:'I D "RTN","EDPLPCE",111,0) . ; put sequence at end of list "RTN","EDPLPCE",112,0) . I EDPLST(I)'["-" S LST(+EDPLST(I)*1000)=EDPLST(I),LOCS(+$P(EDPLST(I),U,2))="" Q "RTN","EDPLPCE",113,0) . ; put time ranges at top of list "RTN","EDPLPCE",114,0) . S BEG=+$P(EDPLST(I),"-"),END=+$P(EDPLST(I),"-",2) "RTN","EDPLPCE",115,0) . I (TMEND) Q ; eliminating times that don't include NOW "RTN","EDPLPCE",116,0) . S LST(I)=EDPLST(I),LOCS(+$P(EDPLST(I),U,2))="" "RTN","EDPLPCE",117,0) ; "RTN","EDPLPCE",118,0) ; look for visits to ED locations within the last hour "RTN","EDPLPCE",119,0) N BACKTO,VTM,VLOC,LOC "RTN","EDPLPCE",120,0) S BACKTO=$$FMADD^XLFDT($$NOW^XLFDT,0,-1),LOC=0 "RTN","EDPLPCE",121,0) I $G(DFN) D "RTN","EDPLPCE",122,0) . S VTM="" F S VTM=$O(^AUPNVSIT("AET",DFN,VTM),-1) Q:VTM") "RTN","EDPQAR",28,0) S ROOT="edp.disposition" D LSTIENS(ROOT) "RTN","EDPQAR",29,0) S ROOT=EDPSTA_".disposition" D LSTIENS(ROOT) "RTN","EDPQAR",30,0) D XML^EDPX("") "RTN","EDPQAR",31,0) Q "RTN","EDPQAR",32,0) LSTIENS(ROOT) ; list IEN's that should bypass remove-from-board checks "RTN","EDPQAR",33,0) N X,IEN,FLAGS "RTN","EDPQAR",34,0) S X=ROOT F S X=$O(^EDPB(233.1,"B",X)) Q:$E(X,1,$L(ROOT))'=ROOT D "RTN","EDPQAR",35,0) . S IEN=0 F S IEN=$O(^EDPB(233.1,"B",X,IEN)) Q:'IEN D "RTN","EDPQAR",36,0) .. S FLAGS=$P(^EDPB(233.1,IEN,0),U,5) Q:FLAGS'["B" "RTN","EDPQAR",37,0) .. D XML^EDPX(""_IEN_"") "RTN","EDPQAR",38,0) Q "RTN","EDPQAR",39,0) DFLTAREA(AREA) ; return the default area for a site "RTN","EDPQAR",40,0) N X,DFLT "RTN","EDPQAR",41,0) I $L($G(AREA)),(+AREA'=AREA) D "RTN","EDPQAR",42,0) . S AREA=$O(^EDPB(231.9,"B",AREA,0)) "RTN","EDPQAR",43,0) . ; need to check for matching site!! "RTN","EDPQAR",44,0) S DFLT=$S($G(AREA):AREA,1:$O(^EDPB(231.9,"C",EDPSITE,0))) "RTN","EDPQAR",45,0) ; "RTN","EDPQAR",46,0) I 'DFLT D ADDAREA S DFLT=$O(^EDPB(231.9,"C",EDPSITE,0)) "RTN","EDPQAR",47,0) S X("area")=DFLT "RTN","EDPQAR",48,0) I X("area") S X("areaNm")=$P(^EDPB(231.9,X("area"),0),U) "RTN","EDPQAR",49,0) S X("version")=$$VERSRV "RTN","EDPQAR",50,0) D XML^EDPX($$XMLA^EDPX("user",.X)) "RTN","EDPQAR",51,0) Q "RTN","EDPQAR",52,0) ADDAREA ; add area if none is defined for this site "RTN","EDPQAR",53,0) N FDA,FDAIEN,DIERR,ERR "RTN","EDPQAR",54,0) S FDA(231.9,"+1,",.01)="Emergency Department" "RTN","EDPQAR",55,0) S FDA(231.9,"+1,",.02)=EDPSITE "RTN","EDPQAR",56,0) D UPDATE^DIE("","FDA","FDAIEN","ERR") "RTN","EDPQAR",57,0) Q:$D(DIERR) "RTN","EDPQAR",58,0) ; "RTN","EDPQAR",59,0) N AREA S AREA=FDAIEN(1) "RTN","EDPQAR",60,0) D RESET^EDPBRS(AREA) "RTN","EDPQAR",61,0) Q "RTN","EDPQAR",62,0) VERSRV() ; Return server version of option name "RTN","EDPQAR",63,0) N EDPLST,VAL "RTN","EDPQAR",64,0) D FIND^DIC(19,"",1,"X","EDPF TRACKING SYSTEM",1,,,,"EDPLST") "RTN","EDPQAR",65,0) S VAL=$G(EDPLST("DILIST","ID",1,1)) "RTN","EDPQAR",66,0) S VAL=$P(VAL,"version ",2) "RTN","EDPQAR",67,0) I 'VAL Q "1.0T?" "RTN","EDPQAR",68,0) Q VAL "RTN","EDPQDB") 0^43^B37231235 "RTN","EDPQDB",1,0) EDPQDB ;SLC/KCM - Display Active Log Entries "RTN","EDPQDB",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPQDB",3,0) ; "RTN","EDPQDB",4,0) GET(AREA,BOARD,LAST) ; Get display board contents "RTN","EDPQDB",5,0) ;I $G(^EDPB(231.9,AREA,230))=TOKEN D XML^EDPX("") Q "RTN","EDPQDB",6,0) ; "RTN","EDPQDB",7,0) N EDPTIME S EDPTIME=$$NOW^XLFDT "RTN","EDPQDB",8,0) N SEQ,BED,LOG,BEDS,DWHEN,DUP,ACU,LSTUPD,RELOAD,ATT "RTN","EDPQDB",9,0) ; "RTN","EDPQDB",10,0) S LSTUPD=$P($G(^EDPB(231.9,AREA,0)),U,3),RELOAD="true",LAST=$G(LAST) "RTN","EDPQDB",11,0) I (LAST="")!(LAST=LSTUPD) S RELOAD="false" "RTN","EDPQDB",12,0) S ATT("status")="new" "RTN","EDPQDB",13,0) S ATT("reloadConfig")=RELOAD "RTN","EDPQDB",14,0) S ATT("configLastUpdated")=LSTUPD "RTN","EDPQDB",15,0) S ATT("version")=$$VERSRV^EDPQAR "RTN","EDPQDB",16,0) D XML^EDPX($$XMLA^EDPX("rows",.ATT,"")) "RTN","EDPQDB",17,0) ; "RTN","EDPQDB",18,0) ; Get a list of all the beds in sequence for this area "RTN","EDPQDB",19,0) S BOARD=$G(BOARD) "RTN","EDPQDB",20,0) S BED=0 F S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPQDB",21,0) . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999 "RTN","EDPQDB",22,0) . Q:$P(^EDPB(231.8,BED,0),U,4) ; inactive bed "RTN","EDPQDB",23,0) . S BEDS(SEQ,BED)="",BEDS("B",BED,SEQ)="" "RTN","EDPQDB",24,0) ; "RTN","EDPQDB",25,0) ; Insert the active log entries into the correct sequence for the beds "RTN","EDPQDB",26,0) S BED=0 F S BED=$O(^EDP(230,"AL",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPQDB",27,0) . S LOG=0 F S LOG=$O(^EDP(230,"AL",EDPSITE,AREA,BED,LOG)) Q:'LOG D "RTN","EDPQDB",28,0) . . I '$D(BEDS("B",BED)) S BEDS(99999,BED)="",BEDS("B",BED,99999)="" "RTN","EDPQDB",29,0) . . S SEQ=$O(BEDS("B",BED,0)) "RTN","EDPQDB",30,0) . . S ACU=$P($G(^EDP(230,LOG,3)),U,3) S:'ACU ACU=99 "RTN","EDPQDB",31,0) . . S BEDS(SEQ,BED,ACU,LOG)="" "RTN","EDPQDB",32,0) ; "RTN","EDPQDB",33,0) ; Loop thru the sequence of beds to create display board rows "RTN","EDPQDB",34,0) D BLDDUP^EDPQLP(.DUP,AREA) "RTN","EDPQDB",35,0) S SEQ=0 F S SEQ=$O(BEDS(SEQ)) Q:'SEQ D "RTN","EDPQDB",36,0) . S BED=0 F S BED=$O(BEDS(SEQ,BED)) Q:'BED D "RTN","EDPQDB",37,0) . . I $L(BOARD),($P(^EDPB(231.8,BED,0),U,11)'=BOARD) Q "RTN","EDPQDB",38,0) . . S DWHEN=$P(^EDPB(231.8,BED,0),U,7) "RTN","EDPQDB",39,0) . . ; never display DWHEN=2 "RTN","EDPQDB",40,0) . . Q:DWHEN=2 "RTN","EDPQDB",41,0) . . ; always display DWHEN=1 "RTN","EDPQDB",42,0) . . I ($D(BEDS(SEQ,BED))<10)&(DWHEN=1) D EMPTY(BED) Q "RTN","EDPQDB",43,0) . . ; display if occupied DWHEN=0 "RTN","EDPQDB",44,0) . . S ACU=0 F S ACU=$O(BEDS(SEQ,BED,ACU)) Q:'ACU D "RTN","EDPQDB",45,0) . . . S LOG=0 F S LOG=$O(BEDS(SEQ,BED,ACU,LOG)) Q:'LOG D OCCUPIED(LOG,.DUP) "RTN","EDPQDB",46,0) ; "RTN","EDPQDB",47,0) D XML^EDPX("") "RTN","EDPQDB",48,0) Q "RTN","EDPQDB",49,0) EMPTY(BED) ; add row if unoccupied be should show "RTN","EDPQDB",50,0) N ROW "RTN","EDPQDB",51,0) S ROW("bed")=BED "RTN","EDPQDB",52,0) S ROW("bedNm")=$P(^EDPB(231.8,BED,0),U,6) "RTN","EDPQDB",53,0) D XML^EDPX($$XMLA^EDPX("row",.ROW)) "RTN","EDPQDB",54,0) Q "RTN","EDPQDB",55,0) OCCUPIED(LOG,DUP) ; add log entry row "RTN","EDPQDB",56,0) N X0,X1,X3,ROW "RTN","EDPQDB",57,0) S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPQDB",58,0) S ROW("id")=LOG "RTN","EDPQDB",59,0) S ROW("bed")=BED "RTN","EDPQDB",60,0) S ROW("bedNm")=$P(^EDPB(231.8,BED,0),U,6) "RTN","EDPQDB",61,0) S ROW("ptNm")=$P($P(X0,U,4),",") "RTN","EDPQDB",62,0) S ROW("last4")=$P(X0,U,11) "RTN","EDPQDB",63,0) S ROW("visit")=($P(X0,U,12)!$P(X0,U,13)) "RTN","EDPQDB",64,0) S ROW("clinic")=$P(X0,U,14) "RTN","EDPQDB",65,0) S ROW("clinicNm")=$$LOCNM($P(X0,U,14)) "RTN","EDPQDB",66,0) S ROW("complaint")=$P(X1,U,1) "RTN","EDPQDB",67,0) S ROW("comment")=$P(X3,U,8) "RTN","EDPQDB",68,0) S ROW("md")=$P(X3,U,5) "RTN","EDPQDB",69,0) S ROW("mdNm")=$$INITIAL($P(X3,U,5)) "RTN","EDPQDB",70,0) S ROW("rn")=$P(X3,U,6) "RTN","EDPQDB",71,0) S ROW("rnNm")=$$INITIAL($P(X3,U,6)) "RTN","EDPQDB",72,0) S ROW("res")=$P(X3,U,7) "RTN","EDPQDB",73,0) S ROW("resNm")=$$INITIAL($P(X3,U,7)) "RTN","EDPQDB",74,0) S ROW("status")=$P(X3,U,2) "RTN","EDPQDB",75,0) S ROW("statusNm")=$$CAB(EDPSTA_".status",$P(X3,U,2)) "RTN","EDPQDB",76,0) S ROW("acuity")=$P(X3,U,3) "RTN","EDPQDB",77,0) S ROW("acuityNm")=$$CAB(EDPSTA_".acuity",$P(X3,U,3)) "RTN","EDPQDB",78,0) S ROW("emins")=$$HHMM($$MIN($P(X0,U,8))) "RTN","EDPQDB",79,0) S ROW("lmins")=$$HHMM($$LMIN(LOG)) "RTN","EDPQDB",80,0) S ROW("similar")=$$SIM^EDPQLP(ROW("ptNm"),ROW("last4"),.DUP) "RTN","EDPQDB",81,0) ; "RTN","EDPQDB",82,0) N STS D ORDSTS(LOG,.STS) "RTN","EDPQDB",83,0) S ROW("lab")=STS("LP")_"/"_STS("LC") ; lab pending / lab complete "RTN","EDPQDB",84,0) S ROW("labUrg")=$S(STS("LS"):2,STS("LP"):1,1:0) ; any STAT labs? "RTN","EDPQDB",85,0) S ROW("rad")=STS("RP")_"/"_STS("RC") ; img pending / img complete "RTN","EDPQDB",86,0) S ROW("radUrg")=$S(STS("RS"):2,STS("RP"):1,1:0) ; any STAT imgs? "RTN","EDPQDB",87,0) S ROW("ordNew")=STS("ON") ; number of new orders "RTN","EDPQDB",88,0) S ROW("minLab")=STS("LO") ; oldest pending/active lab "RTN","EDPQDB",89,0) S ROW("minRad")=STS("RO") ; oldest pending/active img "RTN","EDPQDB",90,0) S ROW("minVer")=STS("OO") ; oldest "new" order "RTN","EDPQDB",91,0) D XML^EDPX($$XMLA^EDPX("row",.ROW)) "RTN","EDPQDB",92,0) Q "RTN","EDPQDB",93,0) INITIAL(LOCID) ; Return initials "RTN","EDPQDB",94,0) Q:'LOCID "" "RTN","EDPQDB",95,0) Q $P(^VA(200,LOCID,0),U,2) "RTN","EDPQDB",96,0) ; "RTN","EDPQDB",97,0) LOCNM(LOC) ; Return clinic name from 44 "RTN","EDPQDB",98,0) Q:'LOC "" "RTN","EDPQDB",99,0) N X S X=$G(^SC(LOC,0)) ; IA#10040 "RTN","EDPQDB",100,0) Q:'$L(X) "" "RTN","EDPQDB",101,0) I $L($P(X,U,2)) Q $P(X,U,2) "RTN","EDPQDB",102,0) Q $P(X,U) "RTN","EDPQDB",103,0) ; "RTN","EDPQDB",104,0) CAB(LST,IEN) ; Return code abbreviation "RTN","EDPQDB",105,0) Q:'IEN "" "RTN","EDPQDB",106,0) N LSTDA,ABB,XSITE,XNATL "RTN","EDPQDB",107,0) S LSTDA=$O(^EDPB(233.2,"AS",LST,IEN,0)) "RTN","EDPQDB",108,0) S ABB="",XSITE="",XNATL="" "RTN","EDPQDB",109,0) I LSTDA S XSITE=^EDPB(233.2,"AS",LST,IEN,LSTDA) "RTN","EDPQDB",110,0) S ABB=$P(XSITE,U,1) Q:$L(ABB) ABB ;site abbreviation "RTN","EDPQDB",111,0) S XNATL=^EDPB(233.1,IEN,0) "RTN","EDPQDB",112,0) S ABB=$P(XNATL,U,3) Q:$L(ABB) ABB ;nat'l abbreviation "RTN","EDPQDB",113,0) S ABB=$P(XSITE,U,2) Q:$L(ABB) ABB ;site name "RTN","EDPQDB",114,0) S ABB=$P(XNATL,U,2) Q:$L(ABB) ABB ;nat'l name "RTN","EDPQDB",115,0) Q "" "RTN","EDPQDB",116,0) ; "RTN","EDPQDB",117,0) MIN(START) ; Return elapse time "RTN","EDPQDB",118,0) I 'START Q "" "RTN","EDPQDB",119,0) Q $$FMDIFF^XLFDT(EDPTIME,START,2)\60 "RTN","EDPQDB",120,0) ; "RTN","EDPQDB",121,0) LMIN(LOG) ; Return time at location "RTN","EDPQDB",122,0) N IEN,TS,TM S TM=0 "RTN","EDPQDB",123,0) S TS="" F S TS=$O(^EDP(230.1,"ADF",LOG,TS),-1) Q:'TS D Q:TM "RTN","EDPQDB",124,0) . S IEN=0 F S IEN=$O(^EDP(230.1,"ADF",LOG,TS,IEN)) Q:'IEN D Q:TM "RTN","EDPQDB",125,0) . . I +$P($G(^EDP(230.1,IEN,3)),U,4) S TM=$P($G(^EDP(230.1,IEN,0)),U,2) "RTN","EDPQDB",126,0) I TM Q $$FMDIFF^XLFDT(EDPTIME,TM,2)\60 "RTN","EDPQDB",127,0) Q 0 "RTN","EDPQDB",128,0) ; "RTN","EDPQDB",129,0) HHMM(MIN) ; Format as hours:minutes "RTN","EDPQDB",130,0) Q MIN ;(the colon messed up the calculations for elapsed time) "RTN","EDPQDB",131,0) ; "RTN","EDPQDB",132,0) N H,M "RTN","EDPQDB",133,0) S H=MIN\60,M=MIN#60 "RTN","EDPQDB",134,0) S:$L(M)=1 M="0"_M "RTN","EDPQDB",135,0) Q H_":"_M "RTN","EDPQDB",136,0) ; "RTN","EDPQDB",137,0) ORDSTS(LOG,STS) ; compute statuses of orders "RTN","EDPQDB",138,0) N IEN,X0 "RTN","EDPQDB",139,0) S STS("OO")=9999999,STS("ON")=0 ; oldest order, new orders "RTN","EDPQDB",140,0) S STS("LP")=0,STS("LO")=9999999,STS("LS")=0,STS("LC")=0 "RTN","EDPQDB",141,0) S STS("RP")=0,STS("RO")=9999999,STS("RS")=0,STS("RC")=0 "RTN","EDPQDB",142,0) S IEN=0 F S IEN=$O(^EDP(230,LOG,8,IEN)) Q:'IEN D "RTN","EDPQDB",143,0) . S X0=^EDP(230,LOG,8,IEN,0) "RTN","EDPQDB",144,0) . I ($P(X0,U,3)="N")!($P(X0,U,3)="A") D "RTN","EDPQDB",145,0) . . I $P(X0,U,5)") "RTN","EDPQDBS",12,0) D CLRBED(AREA) "RTN","EDPQDBS",13,0) D CLRSTAFF(AREA,"md","P") "RTN","EDPQDBS",14,0) D CLRSTAFF(AREA,"res","R") "RTN","EDPQDBS",15,0) D CLRSTAFF(AREA,"rn","N") "RTN","EDPQDBS",16,0) N I S I=0 "RTN","EDPQDBS",17,0) F S I=$O(^EDPB(231.9,AREA,3,I)) Q:'I D XML^EDPX(^EDPB(231.9,AREA,3,I,0)) "RTN","EDPQDBS",18,0) D XML^EDPX("") "RTN","EDPQDBS",19,0) Q "RTN","EDPQDBS",20,0) CLRBED(AREA) ; add bed colors "RTN","EDPQDBS",21,0) D XML^EDPX("") "RTN","EDPQDBS",22,0) N BED "RTN","EDPQDBS",23,0) S BED=0 F S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPQDBS",24,0) . S X0=^EDPB(231.8,BED,0) "RTN","EDPQDBS",25,0) . I $P(X0,U,12)="" Q "RTN","EDPQDBS",26,0) . N X "RTN","EDPQDBS",27,0) . S X("att")="@bed" "RTN","EDPQDBS",28,0) . S X("clr")=$P(X0,U,12) "RTN","EDPQDBS",29,0) . S X("val")=BED "RTN","EDPQDBS",30,0) . D XML^EDPX($$XMLA^EDPX("map",.X)) "RTN","EDPQDBS",31,0) D XML^EDPX("") "RTN","EDPQDBS",32,0) Q "RTN","EDPQDBS",33,0) CLRSTAFF(AREA,ROLEID,ROLE) ; add staff colors "RTN","EDPQDBS",34,0) D XML^EDPX("") "RTN","EDPQDBS",35,0) N IEN "RTN","EDPQDBS",36,0) S IEN="" F S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN D "RTN","EDPQDBS",37,0) . S X0=^EDPB(231.7,IEN,0) Q:'$P(X0,U,8) "RTN","EDPQDBS",38,0) . N X "RTN","EDPQDBS",39,0) . S X("att")=$S(ROLE="P":"@md",ROLE="N":"@rn",ROLE="R":"@res",1:"nop") "RTN","EDPQDBS",40,0) . S X("clr")=$P(X0,U,8) "RTN","EDPQDBS",41,0) . S X("val")=$P(X0,U) "RTN","EDPQDBS",42,0) . D XML^EDPX($$XMLA^EDPX("map",.X)) "RTN","EDPQDBS",43,0) D XML^EDPX("") "RTN","EDPQDBS",44,0) Q "RTN","EDPQLE") 0^45^B40300302 "RTN","EDPQLE",1,0) EDPQLE ;SLC/KCM - Retrieve Log Entry "RTN","EDPQLE",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPQLE",3,0) ; "RTN","EDPQLE",4,0) GET(LOG,CHOICES) ; Get a log entry by request "RTN","EDPQLE",5,0) N CURBED,CURVAL,PERSON,CODED,CHTS,CHLOAD,CLINIC "RTN","EDPQLE",6,0) S AREA=$P(^EDP(230,LOG,0),U,3) "RTN","EDPQLE",7,0) S CHTS=$P($G(^EDPB(231.9,AREA,231)),U),CHLOAD=(CHTS'=CHOICES) "RTN","EDPQLE",8,0) N EDPTIME S EDPTIME=$$NOW^XLFDT "RTN","EDPQLE",9,0) N EDPNOVAL S EDPNOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0)) "RTN","EDPQLE",10,0) D LOG(LOG) "RTN","EDPQLE",11,0) D XML^EDPX("") "RTN","EDPQLE",12,0) D BEDS,PERSONS,CODED,CLINICS "RTN","EDPQLE",13,0) D:CHLOAD CHOICES^EDPQLE1(AREA) "RTN","EDPQLE",14,0) D CLINLST^EDPQLE1($P(^EDP(230,LOG,0),U,14)) ; time-sensitive, get every time "RTN","EDPQLE",15,0) D XML^EDPX("") "RTN","EDPQLE",16,0) Q "RTN","EDPQLE",17,0) LOG(LOG) ; return the log entry as XML "RTN","EDPQLE",18,0) N X,X0,X1,X3 "RTN","EDPQLE",19,0) ; "RTN","EDPQLE",20,0) L +^EDP(230,LOG):3 "RTN","EDPQLE",21,0) S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPQLE",22,0) S X("loadTS")=$$NOW^XLFDT "RTN","EDPQLE",23,0) L -^EDP(230,LOG) "RTN","EDPQLE",24,0) ; "RTN","EDPQLE",25,0) ; Set up encounter info into ^TMP if necessary so we can use it later "RTN","EDPQLE",26,0) ; see if visit present, if diagnosis coded or missing provider "RTN","EDPQLE",27,0) I $P(X0,U,12),($P($G(^EDPB(231.9,AREA,1)),U,2)!('$P(X3,U,5))) D "RTN","EDPQLE",28,0) . K ^TMP("PXKENC",$J) "RTN","EDPQLE",29,0) . D ENCEVENT^PXAPI($P(X0,U,12)) "RTN","EDPQLE",30,0) ; "RTN","EDPQLE",31,0) ; Get Provider from PCE if we don't have one "RTN","EDPQLE",32,0) ; this is commented out for now since we don't have a way to "RTN","EDPQLE",33,0) ; let the user know the provider was pulled in and needed to be saved "RTN","EDPQLE",34,0) ; I '$P(X3,U,5),$P(X0,U,12) S X("md")=$$PRIMPCE($P(X0,U,12)),PERSON("provider")=X("md") "RTN","EDPQLE",35,0) ; "RTN","EDPQLE",36,0) S X("id")=LOG "RTN","EDPQLE",37,0) S X("site")=$P(X0,U,2) "RTN","EDPQLE",38,0) S X("area")=$P(X0,U,3) "RTN","EDPQLE",39,0) S X("name")=$P(X0,U,4) "RTN","EDPQLE",40,0) S X("dfn")=$P(X0,U,6) "RTN","EDPQLE",41,0) S X("ssn")=$S(X("dfn"):$P(^DPT(X("dfn"),0),U,9),1:"") "RTN","EDPQLE",42,0) S X("dob")=$$DOB(X("dfn")) "RTN","EDPQLE",43,0) S X("closed")=$P(X0,U,7) "RTN","EDPQLE",44,0) S X("inTS")=$P(X0,U,8) "RTN","EDPQLE",45,0) S X("outTS")=$P(X0,U,9) "RTN","EDPQLE",46,0) S X("arrival")=$$CODE($P(X0,U,10)),CODED("arrival")=X("arrival") "RTN","EDPQLE",47,0) S X("visit")=$P(X0,U,12) "RTN","EDPQLE",48,0) S X("clinic")=$P(X0,U,14),CLINIC=X("clinic") "RTN","EDPQLE",49,0) S X("complaint")=$P(X1,U,1) "RTN","EDPQLE",50,0) S X("compLong")=$G(^EDP(230,LOG,2)) "RTN","EDPQLE",51,0) S X("status")=$$CODE($P(X3,U,2)),CODED("status")=X("status") "RTN","EDPQLE",52,0) S X("acuity")=$$CODE($P(X3,U,3)) "RTN","EDPQLE",53,0) S X("bed")=+$P(X3,U,4) "RTN","EDPQLE",54,0) S X("md")=+$P(X3,U,5),PERSON("provider")=X("md") "RTN","EDPQLE",55,0) S X("nurse")=+$P(X3,U,6),PERSON("nurse")=X("nurse") "RTN","EDPQLE",56,0) S X("res")=+$P(X3,U,7),PERSON("resident")=X("res") "RTN","EDPQLE",57,0) S X("comment")=$P(X3,U,8) "RTN","EDPQLE",58,0) S X("delay")=$$CODE($P(X1,U,5)),CODED("delay")=X("delay") "RTN","EDPQLE",59,0) S X("disposition")=$$CODE($P(X1,U,2)),CODED("disposition")=X("disposition") "RTN","EDPQLE",60,0) S X("required")=$$REQ(.X) "RTN","EDPQLE",61,0) S CURBED=X("bed") ; for later use by BEDS "RTN","EDPQLE",62,0) ; "RTN","EDPQLE",63,0) D XML^EDPX("") "RTN","EDPQLE",64,0) D XMLE^EDPX(.X) "RTN","EDPQLE",65,0) ; "RTN","EDPQLE",66,0) ; Get diagnosis from PCE if it is coded entry required AND patient has a VISIT "RTN","EDPQLE",67,0) I $P($G(^EDPB(231.9,AREA,1)),U,2),$P(X0,U,12) D "RTN","EDPQLE",68,0) . D DIAGPCE($P(X0,U,12)) "RTN","EDPQLE",69,0) E D "RTN","EDPQLE",70,0) . D DIAGFREE(LOG) "RTN","EDPQLE",71,0) ; "RTN","EDPQLE",72,0) I X("dfn") D PRF^EDPFPTC(X("dfn")) ; patient record flags "RTN","EDPQLE",73,0) ; "RTN","EDPQLE",74,0) D XML^EDPX("") "RTN","EDPQLE",75,0) Q "RTN","EDPQLE",76,0) PRIMPCE(EDPVISIT) ; return primary provider from PCE "RTN","EDPQLE",77,0) ;for provider "RTN","EDPQLE",78,0) ; LST(n)="PRV"^ien^^^name^primary/secondary flag "RTN","EDPQLE",79,0) N I,X,PRIM "RTN","EDPQLE",80,0) S PRIM="" "RTN","EDPQLE",81,0) S I=0 F S I=$O(^TMP("PXKENC",$J,EDPVISIT,"PRV",I)) Q:'I D Q:PRIM "RTN","EDPQLE",82,0) . S X=^TMP("PXKENC",$J,EDPVISIT,"PRV",I,0) "RTN","EDPQLE",83,0) . Q:$P(X,U,4)'="P" "RTN","EDPQLE",84,0) . S PRIM=$P(X,U) "RTN","EDPQLE",85,0) Q:'PRIM "" "RTN","EDPQLE",86,0) Q:'$D(^XUSEC("PROVIDER",PRIM)) "" "RTN","EDPQLE",87,0) Q:'$$ALLOW^EDPFPER(PRIM,"P") "" "RTN","EDPQLE",88,0) Q PRIM "RTN","EDPQLE",89,0) ; "RTN","EDPQLE",90,0) DIAGPCE(EDPVISIT) ; add PCE diagnoses "RTN","EDPQLE",91,0) Q:'EDPVISIT "RTN","EDPQLE",92,0) N I,X,CODE "RTN","EDPQLE",93,0) S I=0 F S I=$O(^TMP("PXKENC",$J,EDPVISIT,"POV",I)) Q:'I D "RTN","EDPQLE",94,0) . K X S X=^TMP("PXKENC",$J,EDPVISIT,"POV",I,0) "RTN","EDPQLE",95,0) . S X("type")="POV" "RTN","EDPQLE",96,0) . S CODE=$P(X,U) S:CODE CODE=$P(^ICD9(CODE,0),U) "RTN","EDPQLE",97,0) . S X("code")=$P(^ICD9($P(X,U),0),U) "RTN","EDPQLE",98,0) . S X("label")=^AUTNPOV($P(X,U,4),0) "RTN","EDPQLE",99,0) . S X("primary")=($P(X,U,12)="P") "RTN","EDPQLE",100,0) . D XML^EDPX($$XMLA^EDPX("diagnosis",.X)) "RTN","EDPQLE",101,0) S I=0 F S I=$O(^TMP("PXKENC",$J,EDPVISIT,"CPT",I)) Q:'I D "RTN","EDPQLE",102,0) . K X S X=^TMP("PXKENC",$J,EDPVISIT,"CPT",I,0) "RTN","EDPQLE",103,0) . S X("type")="CPT" "RTN","EDPQLE",104,0) . S CODE=$O(^ICPT("B",$P(X,U),0)) S:CODE CODE=$P(^ICPT(CODE,0),U) "RTN","EDPQLE",105,0) . S X("code")=CODE "RTN","EDPQLE",106,0) . S X("label")=^AUTNPOV($P(X,U,4),0) "RTN","EDPQLE",107,0) . S X("quantity")=$P(X,U,16) "RTN","EDPQLE",108,0) . D XML^EDPX($$XMLA^EDPX("proc",.X)) "RTN","EDPQLE",109,0) Q "RTN","EDPQLE",110,0) DIAGFREE(LOG) ; add free text diagnoses "RTN","EDPQLE",111,0) N DIAG,CODE,LABEL,X4 "RTN","EDPQLE",112,0) S DIAG=0 F S DIAG=$O(^EDP(230,LOG,4,DIAG)) Q:'DIAG D "RTN","EDPQLE",113,0) . S X4=^EDP(230,LOG,4,DIAG,0) "RTN","EDPQLE",114,0) . S X4("type")="POV" "RTN","EDPQLE",115,0) . S CODE=$P(X4,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U) "RTN","EDPQLE",116,0) . S X4("code")=CODE "RTN","EDPQLE",117,0) . S X4("label")=$P(X4,U,1) "RTN","EDPQLE",118,0) . S X4("primary")=+$P(X4,U,3) "RTN","EDPQLE",119,0) . D XML^EDPX($$XMLA^EDPX("diagnosis",.X4)) "RTN","EDPQLE",120,0) Q "RTN","EDPQLE",121,0) DOB(DFN) ; Return date of birth (external) "RTN","EDPQLE",122,0) I 'DFN Q "" "RTN","EDPQLE",123,0) N VA,VADM,X,Y "RTN","EDPQLE",124,0) D DEM^VADPT "RTN","EDPQLE",125,0) Q $P(VADM(3),U,2)_" Age "_VADM(4) "RTN","EDPQLE",126,0) ; "RTN","EDPQLE",127,0) CODE(IEN) ; set NOVAL code to 0 when returning code "RTN","EDPQLE",128,0) Q:IEN=EDPNOVAL 0 "RTN","EDPQLE",129,0) Q +IEN "RTN","EDPQLE",130,0) ; "RTN","EDPQLE",131,0) BEDS ; add a list of available room/beds for this area "RTN","EDPQLE",132,0) D XML^EDPX("") "RTN","EDPQLE",133,0) D XML^EDPX($$XMLS^EDPX("bed",0,"None")) ;non-selected "RTN","EDPQLE",134,0) N BED,X0,MULTI,SEQ "RTN","EDPQLE",135,0) S BED=0 F S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED D "RTN","EDPQLE",136,0) . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999 "RTN","EDPQLE",137,0) . S SEQ(SEQ,BED)="" "RTN","EDPQLE",138,0) S SEQ=0 F S SEQ=$O(SEQ(SEQ)) Q:'SEQ D "RTN","EDPQLE",139,0) . S BED=0 F S BED=$O(SEQ(SEQ,BED)) Q:'BED D "RTN","EDPQLE",140,0) .. S X0=^EDPB(231.8,BED,0) "RTN","EDPQLE",141,0) .. ; QUIT if inactive bed "RTN","EDPQLE",142,0) .. I $P(X0,U,4) Q "RTN","EDPQLE",143,0) .. ; QUIT if occupied, unless own bed or multi-assign "RTN","EDPQLE",144,0) .. S MULTI=+$P(X0,U,9) S:MULTI=3 MULTI=0 ; single non-ed "RTN","EDPQLE",145,0) .. I $D(^EDP(230,"AL",EDPSITE,AREA,BED)),((BED'=CURBED)&'MULTI) Q "RTN","EDPQLE",146,0) .. ; "RTN","EDPQLE",147,0) .. S X("data")=BED "RTN","EDPQLE",148,0) .. S X("label")=$P(X0,U,6)_" ("_$P(X0,U)_")" "RTN","EDPQLE",149,0) .. S X("ref")=$P(X0,U,8) "RTN","EDPQLE",150,0) .. D XML^EDPX($$XMLA^EDPX("bed",.X)) "RTN","EDPQLE",151,0) D XML^EDPX("") "RTN","EDPQLE",152,0) Q "RTN","EDPQLE",153,0) PERSONS ; add the internal/external values for persons "RTN","EDPQLE",154,0) N ROLE,NAME,LOCID,IEN,X "RTN","EDPQLE",155,0) D XML^EDPX("") "RTN","EDPQLE",156,0) F ROLE="provider","nurse","resident" S LOCID=$G(PERSON(ROLE)) D "RTN","EDPQLE",157,0) . Q:'LOCID "RTN","EDPQLE",158,0) . S NAME=$P(^VA(200,LOCID,0),U) "RTN","EDPQLE",159,0) . S X("data")=LOCID,X("label")=NAME "RTN","EDPQLE",160,0) . D XML^EDPX($$XMLA^EDPX(ROLE,.X)) "RTN","EDPQLE",161,0) D XML^EDPX("") "RTN","EDPQLE",162,0) Q "RTN","EDPQLE",163,0) CODED ; add internal/external values for codes "RTN","EDPQLE",164,0) N NAME,X "RTN","EDPQLE",165,0) D XML^EDPX("") "RTN","EDPQLE",166,0) S X="" F S X=$O(CODED(X)) Q:X="" I CODED(X) D "RTN","EDPQLE",167,0) . S NAME=$P($G(^EDPB(233.1,CODED(X),0)),U,2) Q:NAME="" "RTN","EDPQLE",168,0) . D XML^EDPX($$XMLS^EDPX(X,CODED(X),NAME)) "RTN","EDPQLE",169,0) D XML^EDPX("") "RTN","EDPQLE",170,0) Q "RTN","EDPQLE",171,0) CLINICS ; add internal/external values for clinic "RTN","EDPQLE",172,0) Q:'CLINIC "RTN","EDPQLE",173,0) N NAME,X "RTN","EDPQLE",174,0) D XML^EDPX("") "RTN","EDPQLE",175,0) S NAME=$P($G(^SC(CLINIC,0)),U) "RTN","EDPQLE",176,0) S X("data")=CLINIC,X("label")=NAME "RTN","EDPQLE",177,0) D XML^EDPX($$XMLA^EDPX("clinic",.X)) "RTN","EDPQLE",178,0) D XML^EDPX("") "RTN","EDPQLE",179,0) Q "RTN","EDPQLE",180,0) REQ(VAL) ; return the fields required to close this entry "RTN","EDPQLE",181,0) ; called from LOG, AREA is assumed to be defined "RTN","EDPQLE",182,0) N NEED,PARAM "RTN","EDPQLE",183,0) S PARAM=$G(^EDPB(231.9,AREA,1)),NEED="" "RTN","EDPQLE",184,0) I $P(PARAM,U,1) S $P(NEED,",",1)="diag" "RTN","EDPQLE",185,0) I $P(PARAM,U,3) S $P(NEED,",",2)="disp" "RTN","EDPQLE",186,0) I $$DLYREQ,$$NOTOBS,$$EXCEED S $P(NEED,",",3)="delay" "RTN","EDPQLE",187,0) Q NEED "RTN","EDPQLE",188,0) ; "RTN","EDPQLE",189,0) DLYREQ() ; return true if delay params set to required "RTN","EDPQLE",190,0) ; called from REQ, PARAM is assumed to be defined "RTN","EDPQLE",191,0) Q $P(PARAM,U,4)&$P(PARAM,U,5) "RTN","EDPQLE",192,0) ; "RTN","EDPQLE",193,0) NOTOBS() ; return true if not in observation status "RTN","EDPQLE",194,0) ; called from REQ, VAL is assumed to be defined "RTN","EDPQLE",195,0) N STS S STS=+$G(VAL("status")) "RTN","EDPQLE",196,0) Q:'STS 1 "RTN","EDPQLE",197,0) Q:$P(^EDPB(233.1,STS,0),U,5)["O" 0 "RTN","EDPQLE",198,0) Q 1 "RTN","EDPQLE",199,0) ; "RTN","EDPQLE",200,0) EXCEED() ; return true if delay time exceeded "RTN","EDPQLE",201,0) ; called from REQ, VAL and PARAM are assumed to be defined "RTN","EDPQLE",202,0) N IN S IN=$G(VAL("inTS")) "RTN","EDPQLE",203,0) N OUT S OUT=$G(VAL("outTS")) S:'OUT OUT=EDPTIME "RTN","EDPQLE",204,0) N MAX S MAX=$P(PARAM,U,5) "RTN","EDPQLE",205,0) Q ($$FMDIFF^XLFDT(OUT,IN,2)\60)>MAX "RTN","EDPQLE1") 0^46^B9736825 "RTN","EDPQLE1",1,0) EDPQLE1 ;SLC/KCM - Retrive Log Entry - Supporting Info "RTN","EDPQLE1",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPQLE1",3,0) ; "RTN","EDPQLE1",4,0) CHOICES(AREA) ; Add choice lists for editing log entry to XML "RTN","EDPQLE1",5,0) ; called from EDPQLE "RTN","EDPQLE1",6,0) ; "RTN","EDPQLE1",7,0) D STAFF("md","P") "RTN","EDPQLE1",8,0) D STAFF("res","R") "RTN","EDPQLE1",9,0) D STAFF("nurse","N") "RTN","EDPQLE1",10,0) ; "RTN","EDPQLE1",11,0) D CODES("arrival","arrival") "RTN","EDPQLE1",12,0) D CODES("acuity","acuity") "RTN","EDPQLE1",13,0) D CODES("status","status") "RTN","EDPQLE1",14,0) D CODES("disposition","disposition") "RTN","EDPQLE1",15,0) D CODES("delay","delay") "RTN","EDPQLE1",16,0) Q "RTN","EDPQLE1",17,0) STAFF(LABEL,ROLE) ; add staff for this area to XML "RTN","EDPQLE1",18,0) N IEN,X0,NM,PER,ALPHA,EDPNURS "RTN","EDPQLE1",19,0) I ROLE="N" S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN") "RTN","EDPQLE1",20,0) D XML^EDPX("<"_LABEL_"List>") "RTN","EDPQLE1",21,0) D XML^EDPX($$XMLS^EDPX(LABEL,0,"None")) ;non-selected (-1 will delete) "RTN","EDPQLE1",22,0) S IEN=0 F S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN D "RTN","EDPQLE1",23,0) . S X0=^EDPB(231.7,IEN,0),PER=$P(X0,U) "RTN","EDPQLE1",24,0) . I '$$ALLOW^EDPFPER(PER,ROLE) Q "RTN","EDPQLE1",25,0) . S ALPHA($P(^VA(200,PER,0),U),PER)="" "RTN","EDPQLE1",26,0) S NM="" F S NM=$O(ALPHA(NM)) Q:NM="" D "RTN","EDPQLE1",27,0) . S PER=0 F S PER=$O(ALPHA(NM,PER)) Q:'PER D "RTN","EDPQLE1",28,0) . . D XML^EDPX($$XMLS^EDPX(LABEL,PER,NM)) "RTN","EDPQLE1",29,0) D XML^EDPX("") "RTN","EDPQLE1",30,0) Q "RTN","EDPQLE1",31,0) CODES(LABEL,SETNM) ; build nodes for set of codes "RTN","EDPQLE1",32,0) D XML^EDPX("<"_LABEL_"List>") "RTN","EDPQLE1",33,0) I "^arrival^acuity^status^disposition^delay^"[(U_LABEL_U) D "RTN","EDPQLE1",34,0) . ;N NOVAL S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0)) "RTN","EDPQLE1",35,0) . ;D XML^EDPX($$XMLS^EDPX(LABEL,NOVAL,"None")) ; non-selected value "RTN","EDPQLE1",36,0) . D XML^EDPX($$XMLS^EDPX(LABEL,0,"None")) ; non-selected value ; "RTN","EDPQLE1",37,0) I $D(^EDPB(233.2,"B",EDPSTA_"."_SETNM)) S SETNM=EDPSTA_"."_SETNM I 1 "RTN","EDPQLE1",38,0) E S SETNM="edp."_SETNM "RTN","EDPQLE1",39,0) ; "RTN","EDPQLE1",40,0) N SET,SEQ,I,X0,IEN,SHOW "RTN","EDPQLE1",41,0) S SET=$O(^EDPB(233.2,"B",SETNM,0)) "RTN","EDPQLE1",42,0) S SEQ=0 F S SEQ=$O(^EDPB(233.2,SET,1,"B",SEQ)) Q:'SEQ D "RTN","EDPQLE1",43,0) . S I=0 F S I=$O(^EDPB(233.2,SET,1,"B",SEQ,I)) Q:'I D "RTN","EDPQLE1",44,0) . . S X0=^EDPB(233.2,SET,1,I,0) "RTN","EDPQLE1",45,0) . . Q:$P(X0,U,3) ; inactive "RTN","EDPQLE1",46,0) . . S IEN=$P(X0,U,2) "RTN","EDPQLE1",47,0) . . S SHOW=$P(X0,U,4) "RTN","EDPQLE1",48,0) . . I SHOW="" S SHOW=$P(^EDPB(233.1,IEN,0),U,2) "RTN","EDPQLE1",49,0) . . D XML^EDPX($$XMLS^EDPX(LABEL,IEN,SHOW)) "RTN","EDPQLE1",50,0) ; "RTN","EDPQLE1",51,0) D XML^EDPX("") "RTN","EDPQLE1",52,0) Q "RTN","EDPQLE1",53,0) CLINLST(USEALL) ; build nodes for selectable clinics "RTN","EDPQLE1",54,0) N EDPLST,INSTANCE,IEN,NAME,LST,CURTM "RTN","EDPQLE1",55,0) D GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","N") "RTN","EDPQLE1",56,0) S CURTM=$E($P($$NOW^XLFDT,".",2)_"0000",1,4) "RTN","EDPQLE1",57,0) S INSTANCE="" F S INSTANCE=$O(EDPLST(INSTANCE)) Q:INSTANCE="" D "RTN","EDPQLE1",58,0) . S IEN=+EDPLST(INSTANCE),NAME=$P(EDPLST(INSTANCE),U,2) "RTN","EDPQLE1",59,0) . I 'USEALL,$$OUTSIDE(CURTM,INSTANCE) Q ; outside time range, get next "RTN","EDPQLE1",60,0) . S LST(NAME)=IEN "RTN","EDPQLE1",61,0) ; "RTN","EDPQLE1",62,0) D XML^EDPX("") "RTN","EDPQLE1",63,0) D XML^EDPX($$XMLS^EDPX("clinic",0,"None")) ;non-selected (-1 will delete) "RTN","EDPQLE1",64,0) S NAME="" F S NAME=$O(LST(NAME)) Q:NAME="" D "RTN","EDPQLE1",65,0) . D XML^EDPX($$XMLS^EDPX("clinic",LST(NAME),NAME)) "RTN","EDPQLE1",66,0) D XML^EDPX("") "RTN","EDPQLE1",67,0) Q "RTN","EDPQLE1",68,0) OUTSIDE(TM,RNG) ; return true if the time is OUTSIDE of the range "RTN","EDPQLE1",69,0) I RNG'["-" Q 0 "RTN","EDPQLE1",70,0) ; "RTN","EDPQLE1",71,0) S BEG=+$P(RNG,"-"),END=+$P(RNG,"-",2) "RTN","EDPQLE1",72,0) I (TMEND) Q 1 "RTN","EDPQLE1",73,0) Q 0 "RTN","EDPQLP") 0^47^B12368052 "RTN","EDPQLP",1,0) EDPQLP ;SLC/KCM - Log Entry Patients "RTN","EDPQLP",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPQLP",3,0) ; "RTN","EDPQLP",4,0) GET(AREA,TOKEN) ; Return lists for edit context "RTN","EDPQLP",5,0) ; "RTN","EDPQLP",6,0) ; don't rebuild the list if it is unchanged "RTN","EDPQLP",7,0) ;I $G(^EDPB(231.9,AREA,230))=TOKEN D Q "RTN","EDPQLP",8,0) ;. D XML^EDPX("") "RTN","EDPQLP",9,0) ; "RTN","EDPQLP",10,0) ; build sequence based on bed sequence "RTN","EDPQLP",11,0) N IEN,X0,NAME,SSN,LAST4,BED,SEQ,DUP,LST,DFN "RTN","EDPQLP",12,0) D BLDDUP(.DUP,AREA) "RTN","EDPQLP",13,0) S IEN=0 F S IEN=$O(^EDP(230,"AC",EDPSITE,AREA,IEN)) Q:'IEN D "RTN","EDPQLP",14,0) . S X0=^EDP(230,IEN,0) "RTN","EDPQLP",15,0) . S NAME=$P(X0,U,4),LAST4=$P(X0,U,11),DFN=$P(X0,U,6) "RTN","EDPQLP",16,0) . S SSN="" I DFN S SSN=$P(^DPT(DFN,0),U,9) "RTN","EDPQLP",17,0) . S BED=$P($G(^EDP(230,IEN,3)),U,4) "RTN","EDPQLP",18,0) . S SEQ=0 "RTN","EDPQLP",19,0) . I BED S SEQ=$P($G(^EDPB(231.8,BED,0)),U,5) "RTN","EDPQLP",20,0) . I 'SEQ S SEQ=999999 "RTN","EDPQLP",21,0) . I BED S BED=$P(^EDPB(231.8,BED,0),U,6) "RTN","EDPQLP",22,0) . S LST(SEQ,IEN)=NAME_U_SSN_U_LAST4_U_BED_U_$$SIM(NAME,LAST4,.DUP) "RTN","EDPQLP",23,0) ; "RTN","EDPQLP",24,0) D XML^EDPX("") "RTN","EDPQLP",25,0) S SEQ=0 F S SEQ=$O(LST(SEQ)) Q:'SEQ D "RTN","EDPQLP",26,0) . S IEN=0 F S IEN=$O(LST(SEQ,IEN)) Q:'IEN D "RTN","EDPQLP",27,0) . . S X("id")=IEN "RTN","EDPQLP",28,0) . . S X("seq")=SEQ "RTN","EDPQLP",29,0) . . S X("name")=$P(LST(SEQ,IEN),U) "RTN","EDPQLP",30,0) . . S X("ssn")=$P(LST(SEQ,IEN),U,2) "RTN","EDPQLP",31,0) . . S X("last4")=$P(LST(SEQ,IEN),U,3) "RTN","EDPQLP",32,0) . . S X("bed")=$P(LST(SEQ,IEN),U,4) "RTN","EDPQLP",33,0) . . S X("same")=$P(LST(SEQ,IEN),U,5) "RTN","EDPQLP",34,0) . . D XML^EDPX($$XMLA^EDPX("log",.X)) "RTN","EDPQLP",35,0) D XML^EDPX("") "RTN","EDPQLP",36,0) Q "RTN","EDPQLP",37,0) BLDDUP(DUP,AREA) ; Build duplicate name/last4 counters "RTN","EDPQLP",38,0) ; called from GET^EDPQLP, GET^EDPQDB -- expect EDPSITE "RTN","EDPQLP",39,0) N X,IEN,CNT "RTN","EDPQLP",40,0) S X="" F S X=$O(^EDP(230,"ADUP",EDPSITE,AREA,X)) Q:X="" D "RTN","EDPQLP",41,0) . S IEN=0,CNT=0 "RTN","EDPQLP",42,0) . F S IEN=$O(^EDP(230,"ADUP",EDPSITE,AREA,X,IEN)) Q:'IEN S CNT=CNT+1 "RTN","EDPQLP",43,0) . S DUP(X)=CNT "RTN","EDPQLP",44,0) Q "RTN","EDPQLP",45,0) SIM(NAME,LAST4,DUP) ; Return true if similar patient name/last4 "RTN","EDPQLP",46,0) I $L(LAST4),$G(DUP(LAST4))>1 Q 1 "RTN","EDPQLP",47,0) I $L(NAME),$G(DUP($P(NAME,",")))>1 Q 1 "RTN","EDPQLP",48,0) Q 0 "RTN","EDPQLP",49,0) ; "RTN","EDPQLP",50,0) CLOSED(AREA,PARTIAL) ; find matches on name "RTN","EDPQLP",51,0) S PARTIAL=$$UP^XLFSTR(PARTIAL) "RTN","EDPQLP",52,0) Q:PARTIAL="" "RTN","EDPQLP",53,0) ; "RTN","EDPQLP",54,0) I PARTIAL?1U4N D BS5(PARTIAL) G XCLOSED "RTN","EDPQLP",55,0) I PARTIAL?9N.1U D SSN(PARTIAL) G XCLOSED "RTN","EDPQLP",56,0) I PARTIAL?1.2N1"/"1.2N1"/"2.4N D DAY(PARTIAL) G XCLOSED "RTN","EDPQLP",57,0) I PARTIAL?1"T"1"-"1.4N D DAY(PARTIAL) G XCLOSED "RTN","EDPQLP",58,0) I (PARTIAL="TODAY") D DAY(PARTIAL) ; fall thru LNAM in case TODAY is a name "RTN","EDPQLP",59,0) D LNAM(PARTIAL) "RTN","EDPQLP",60,0) ; "RTN","EDPQLP",61,0) XCLOSED ; exit case statement "RTN","EDPQLP",62,0) Q "RTN","EDPQLP",63,0) ; "RTN","EDPQLP",64,0) BS5(X) ; find matches by last inital, last 4 "RTN","EDPQLP",65,0) N DFN,IEN "RTN","EDPQLP",66,0) S DFN=0 F S DFN=$O(^DPT("BS5",X,DFN)) Q:'DFN D "RTN","EDPQLP",67,0) . S IEN=0 F S IEN=$O(^EDP(230,"PDFN",EDPSITE,AREA,DFN,IEN)) Q:'IEN D ADDVST(IEN) "RTN","EDPQLP",68,0) Q "RTN","EDPQLP",69,0) SSN(X) ; find matches by SSN "RTN","EDPQLP",70,0) N DFN,IEN "RTN","EDPQLP",71,0) S DFN=0 F S DFN=$O(^DPT("SSN",X,DFN)) Q:'DFN D "RTN","EDPQLP",72,0) . S IEN=0 F S IEN=$O(^EDP(230,"PDFN",EDPSITE,AREA,DFN,IEN)) Q:'IEN D ADDVST(IEN) "RTN","EDPQLP",73,0) Q "RTN","EDPQLP",74,0) DAY(X) ; find matches by DATE "RTN","EDPQLP",75,0) N %DT,Y,DTOUT,END,INTS "RTN","EDPQLP",76,0) D ^%DT "RTN","EDPQLP",77,0) S INTS=$P(Y,"."),END=INTS_".999999" "RTN","EDPQLP",78,0) Q:INTS'>0 "RTN","EDPQLP",79,0) F S INTS=$O(^EDP(230,"ATI",EDPSITE,INTS)) Q:'INTS Q:INTS>END D "RTN","EDPQLP",80,0) . S IEN=0 F S IEN=$O(^EDP(230,"ATI",EDPSITE,INTS,IEN)) Q:'IEN D "RTN","EDPQLP",81,0) . . Q:$P(^EDP(230,IEN,0),U,3)'=AREA "RTN","EDPQLP",82,0) . . D ADDVST(IEN) "RTN","EDPQLP",83,0) Q "RTN","EDPQLP",84,0) LNAM(PARTIAL) ; find matches by name "RTN","EDPQLP",85,0) N IEN,NAME,X,X0 "RTN","EDPQLP",86,0) S NAME=$O(^EDP(230,"PN",EDPSITE,AREA,PARTIAL),-1) "RTN","EDPQLP",87,0) F S NAME=$O(^EDP(230,"PN",EDPSITE,AREA,NAME)) Q:$E(NAME,1,$L(PARTIAL))'=PARTIAL Q:NAME="" D "RTN","EDPQLP",88,0) . S IEN=0 F S IEN=$O(^EDP(230,"PN",EDPSITE,AREA,NAME,IEN)) Q:'IEN D ADDVST(IEN) "RTN","EDPQLP",89,0) Q "RTN","EDPQLP",90,0) ADDVST(IEN) ; add node for visit "RTN","EDPQLP",91,0) N X0,X,NAME "RTN","EDPQLP",92,0) S X0=^EDP(230,IEN,0),NAME=$P(X0,U,4) "RTN","EDPQLP",93,0) I '$P(X0,U,7) Q ; not closed "RTN","EDPQLP",94,0) S X("id")=IEN,X("name")=NAME,X("inTS")=$P(X0,U,8) "RTN","EDPQLP",95,0) D XML^EDPX($$XMLA^EDPX("visit",.X)) "RTN","EDPQLP",96,0) Q "RTN","EDPQPCE") 0^54^B2442064 "RTN","EDPQPCE",1,0) EDPQPCE ;SLC/KCM - Retrieve PCE information for ED Visits "RTN","EDPQPCE",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPQPCE",3,0) ; "RTN","EDPQPCE",4,0) DXPRI(AREA,LOG) ; return primary diagnosis "RTN","EDPQPCE",5,0) N DXLST "RTN","EDPQPCE",6,0) D DXALL(AREA,LOG,.DXLST) "RTN","EDPQPCE",7,0) Q $G(DXLST(1)) ;$P( ,U,2) "RTN","EDPQPCE",8,0) ; "RTN","EDPQPCE",9,0) DXALL(AREA,LOG,DXLST) ; build list of diagnoses for a visit "RTN","EDPQPCE",10,0) N EDPVISIT S EDPVISIT=$P(^EDP(230,LOG,0),U,12) "RTN","EDPQPCE",11,0) I EDPVISIT,$P($G(^EDPB(231.9,AREA,1)),U,2) D DXPCE(EDPVISIT,.DXLST) I 1 "RTN","EDPQPCE",12,0) E D DXFREE(LOG,.DXLST) "RTN","EDPQPCE",13,0) Q "RTN","EDPQPCE",14,0) DXPCE(EDPVISIT,DXLST) ; return a list of diagnoses from PCE "RTN","EDPQPCE",15,0) N I,X,CODE,NAME,DX "RTN","EDPQPCE",16,0) K ^TMP("PXKENC",$J) "RTN","EDPQPCE",17,0) D ENCEVENT^PXAPI(EDPVISIT) "RTN","EDPQPCE",18,0) S I=0,DX=0 F S I=$O(^TMP("PXKENC",$J,EDPVISIT,"POV",I)) Q:'I D "RTN","EDPQPCE",19,0) . S X=^TMP("PXKENC",$J,EDPVISIT,"POV",I,0) "RTN","EDPQPCE",20,0) . S CODE=$P(^ICD9($P(X,U),0),U) "RTN","EDPQPCE",21,0) . S NAME=^AUTNPOV($P(X,U,4),0) "RTN","EDPQPCE",22,0) . S DX=DX+1,DX($S($P(X,U,12)="P":DX,1:DX*10000))=CODE_U_NAME "RTN","EDPQPCE",23,0) S X="",DXLST=DX F I=1:1 S X=$O(DX(X)) Q:X="" S DXLST(I)=DX(X) "RTN","EDPQPCE",24,0) Q "RTN","EDPQPCE",25,0) DXFREE(LOG,DXLST) ; return free text diagnoses from ED LOG file "RTN","EDPQPCE",26,0) N I,CODE,NAME,X4,DX "RTN","EDPQPCE",27,0) S I=0,DX=0 F S I=$O(^EDP(230,LOG,4,I)) Q:'I D "RTN","EDPQPCE",28,0) . S X4=^EDP(230,LOG,4,I,0) "RTN","EDPQPCE",29,0) . S CODE=$P(X4,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U) "RTN","EDPQPCE",30,0) . S NAME=$P(X4,U,1) "RTN","EDPQPCE",31,0) . S DX=DX+1,DX($S(+$P(X4,U,3):DX,1:DX*10000))=CODE_U_NAME "RTN","EDPQPCE",32,0) S X="",DXLST=DX F I=1:1 S X=$O(DX(X)) Q:X="" S DXLST(I)=DX(X) "RTN","EDPQPCE",33,0) Q "RTN","EDPRPT") 0^10^B17619722 "RTN","EDPRPT",1,0) EDPRPT ;SLC/MKB - Reports "RTN","EDPRPT",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT",3,0) ; "RTN","EDPRPT",4,0) EN(BEG,END,RPT,ID,CSV) ; Get RPT data for EDPSITE by date range "RTN","EDPRPT",5,0) N NOW S NOW=$$NOW "RTN","EDPRPT",6,0) I BEG,END D ;check "RTN","EDPRPT",7,0) . N X I END") "RTN","EDPRPT",35,0) Q "RTN","EDPRPT",36,0) ; "RTN","EDPRPT",37,0) NOW() ; -- Return local value of NOW, based on EDPSITE "RTN","EDPRPT",38,0) Q $$NOW^XLFDT "RTN","EDPRPT",39,0) ; "RTN","EDPRPT",40,0) PROV(MD) ; add list of assigned providers to XML "RTN","EDPRPT",41,0) N I,X0,X "RTN","EDPRPT",42,0) D XML^EDPX("") "RTN","EDPRPT",43,0) S I=0 F S I=$O(MD(I)) Q:I<1 D "RTN","EDPRPT",44,0) . S X0=$G(^VA(200,I,0)),X="" "RTN","EDPRPT",45,0) . D XML^EDPX(X) "RTN","EDPRPT",46,0) D XML^EDPX("") "RTN","EDPRPT",47,0) Q "RTN","EDPRPT",48,0) ; "RTN","EDPRPT",49,0) ECODE(IEN) ; Return external value for a Code "RTN","EDPRPT",50,0) ;Q:$G(IEN) $P($G(^EDPB(233.1,+IEN,0)),U,3) ;code "RTN","EDPRPT",51,0) N X0,LIST,DA,Y S IEN=+$G(IEN) "RTN","EDPRPT",52,0) S X0=$G(^EDPB(233.1,IEN,0)),LIST=EDPSTA_"."_$P($P(X0,U),".",2) "RTN","EDPRPT",53,0) S DA=+$O(^EDPB(233.2,"AS",LIST,IEN,0)),Y="" "RTN","EDPRPT",54,0) I DA S Y=$P($G(^EDPB(233.2,"AS",LIST,IEN,DA)),U) "RTN","EDPRPT",55,0) I Y="" S Y=$P(X0,U,3) ;use nat'l value if no local "RTN","EDPRPT",56,0) Q Y "RTN","EDPRPT",57,0) ; "RTN","EDPRPT",58,0) ENAME(IEN) ; Return external value for a code Name "RTN","EDPRPT",59,0) N X0,LIST,DA,Y S IEN=+$G(IEN) "RTN","EDPRPT",60,0) S X0=$G(^EDPB(233.1,IEN,0)),LIST=EDPSTA_"."_$P($P(X0,U),".",2) "RTN","EDPRPT",61,0) S DA=$O(^EDPB(233.2,"AS",LIST,IEN,0)),Y="" "RTN","EDPRPT",62,0) I DA S Y=$P($G(^EDPB(233.2,"AS",LIST,IEN,DA)),U,2) "RTN","EDPRPT",63,0) I Y="" S Y=$P(X0,U,2) ;use nat'l value if no local "RTN","EDPRPT",64,0) Q Y "RTN","EDPRPT",65,0) ; "RTN","EDPRPT",66,0) EPERS(IEN) ; Return external value for a Person (file 200) "RTN","EDPRPT",67,0) Q:$G(IEN) $P($G(^VA(200,+IEN,0)),U) "RTN","EDPRPT",68,0) Q "" "RTN","EDPRPT",69,0) ; "RTN","EDPRPT",70,0) EDATE(FMDT) ; Return external value for a Date/Time "RTN","EDPRPT",71,0) Q:$G(FMDT) $TR($$FMTE^XLFDT(FMDT,"2M"),"@"," ") ;MM/DD/YY HH:MM "RTN","EDPRPT",72,0) Q "" "RTN","EDPRPT",73,0) ; "RTN","EDPRPT",74,0) ETIME(MINS) ; Return #minutes as HH:MM "RTN","EDPRPT",75,0) N H,M,Y S MINS=+$G(MINS) "RTN","EDPRPT",76,0) S H=MINS\60,M=MINS#60 "RTN","EDPRPT",77,0) S Y=H_":"_$S($L(M)=1:"0"_M,1:M) "RTN","EDPRPT",78,0) Q Y "RTN","EDPRPT",79,0) ; "RTN","EDPRPT",80,0) MD(LOG) ; Return time physician was first assigned "RTN","EDPRPT",81,0) N IDX,ROOT,D,X,Y S Y="",LOG=+$G(LOG) "RTN","EDPRPT",82,0) S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")") "RTN","EDPRPT",83,0) F S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT D Q:Y "RTN","EDPRPT",84,0) . S D=+$P(IDX,",",4),X=$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,5) "RTN","EDPRPT",85,0) . I X'="" S Y=D "RTN","EDPRPT",86,0) Q Y "RTN","EDPRPT",87,0) ; "RTN","EDPRPT",88,0) ACUITY(LOG) ; Return time acuity was first assigned "RTN","EDPRPT",89,0) N IDX,ROOT,D,X,Y S Y="",LOG=+$G(LOG) "RTN","EDPRPT",90,0) S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")") "RTN","EDPRPT",91,0) F S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT D Q:Y "RTN","EDPRPT",92,0) . S D=+$P(IDX,",",4),X=$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,3) "RTN","EDPRPT",93,0) . S:X Y=D "RTN","EDPRPT",94,0) Q Y "RTN","EDPRPT",95,0) ; "RTN","EDPRPT",96,0) LVWAITRM(LOG) ; Return time patient left waiting room "RTN","EDPRPT",97,0) N IDX,ROOT,D,D1,X,ROOM S Y="",LOG=+$G(LOG) "RTN","EDPRPT",98,0) ; get list of room changes in ROOM(time)= 231.8 ien "RTN","EDPRPT",99,0) S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")") "RTN","EDPRPT",100,0) F S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT D "RTN","EDPRPT",101,0) . S D=+$P(IDX,",",4),X=+$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,4) "RTN","EDPRPT",102,0) . I X,D S ROOM(D)=X "RTN","EDPRPT",103,0) ; look for movement in and out of waiting room "RTN","EDPRPT",104,0) S D=0 F S D=$O(ROOM(D)) Q:D<1 S D1=$O(ROOM(D)) D Q:Y "RTN","EDPRPT",105,0) . N RM,NXT S RM=ROOM(D),NXT=$S(D1:ROOM(D1),1:0) "RTN","EDPRPT",106,0) . I NXT,NXT'=RM,$$WAIT(RM),'$$WAIT(NXT) S Y=D1 ;$S(D1:D1,1:OUT) "RTN","EDPRPT",107,0) Q Y "RTN","EDPRPT",108,0) ; "RTN","EDPRPT",109,0) WAIT(X) ; Return 1 or 0, if X is a waiting room "RTN","EDPRPT",110,0) Q $P($G(^EDPB(231.8,+$G(X),0)),U,9)=2 "RTN","EDPRPT",111,0) ; "RTN","EDPRPT",112,0) ADMIT(LOG) ; Return 1st time admitting disposition was assigned "RTN","EDPRPT",113,0) N D,I,X0,X,Y,OUT S Y="",LOG=+$G(LOG) "RTN","EDPRPT",114,0) S D=0 F S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1 S I=+$O(^(D,0)) D Q:Y "RTN","EDPRPT",115,0) . S X0=$G(^EDP(230.1,I,0)) "RTN","EDPRPT",116,0) . I $P(X0,U,11),$P($G(^EDPB(233.1,+$P(X0,U,11),0)),U,5)["A" S Y=D "RTN","EDPRPT",117,0) I Y="" D ;ck old format "RTN","EDPRPT",118,0) . N X1 S X1=$G(^EDP(230,LOG,1)) "RTN","EDPRPT",119,0) . I $P(X1,U,2),$P($G(^EDPB(233.1,+$P(X1,U,2),0)),U,5)["A" S Y=$P(X1,U,3) "RTN","EDPRPT",120,0) I Y S OUT=$P($G(^EDP(230,LOG,0)),U,9) S:OUT&(OUT") I $G(CSV) D ;headers "RTN","EDPRPT1",9,0) . N TAB S TAB=$C(9) "RTN","EDPRPT1",10,0) . S X="ED"_TAB_"Time In"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Wait"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Arrival"_TAB_"Diagnosis"_TAB_"ICD9" "RTN","EDPRPT1",11,0) . D ADD^EDPCSV(X) "RTN","EDPRPT1",12,0) S IN=BEG-.000001 "RTN","EDPRPT1",13,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT1",14,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPRPT1",15,0) . S OUT=$P(X0,U,9),DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG) "RTN","EDPRPT1",16,0) . K ROW S ROW("id")=LOG,ALL=ALL+1 "RTN","EDPRPT1",17,0) . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN) "RTN","EDPRPT1",18,0) . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT) "RTN","EDPRPT1",19,0) . S ROW("complaint")=$P(X1,U) "RTN","EDPRPT1",20,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),ROW("disposition")=DISP "RTN","EDPRPT1",21,0) . S ROW("arrival")=$$ENAME^EDPRPT($P(X1,U,10)) "RTN","EDPRPT1",22,0) . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3)) "RTN","EDPRPT1",23,0) . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5)) "RTN","EDPRPT1",24,0) . S:$P(X3,U,5) PROV(+$P(X3,U,5))="" "RTN","EDPRPT1",25,0) . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2) "RTN","EDPRPT1",26,0) . S:'$L(DISP) DISP="none" S DISP(DISP)=DISP(DISP)+1 "RTN","EDPRPT1",27,0) . ; "RTN","EDPRPT1",28,0) A1 . ; calculate times "RTN","EDPRPT1",29,0) . ; S:OUT="" OUT=NOW ;for calculations "RTN","EDPRPT1",30,0) . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) "RTN","EDPRPT1",31,0) . S ROW("elapsed")=ELAPSE_$S(ELAPSE>359:" *",1:"") "RTN","EDPRPT1",32,0) . S ALL("elapsed")=ALL("elapsed")+ELAPSE "RTN","EDPRPT1",33,0) . S DISP(DISP,"elapsed")=DISP(DISP,"elapsed")+ELAPSE "RTN","EDPRPT1",34,0) . ; "RTN","EDPRPT1",35,0) . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT "RTN","EDPRPT1",36,0) . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPT1",37,0) . S ROW("triage")=TRIAGE,ALL("triage")=ALL("triage")+TRIAGE "RTN","EDPRPT1",38,0) . S DISP(DISP,"triage")=DISP(DISP,"triage")+TRIAGE "RTN","EDPRPT1",39,0) . ; "RTN","EDPRPT1",40,0) . S X=$$LVWAITRM^EDPRPT(LOG),WAIT=0 "RTN","EDPRPT1",41,0) . S:X WAIT=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPT1",42,0) . S ROW("wait")=WAIT,ALL("wait")=ALL("wait")+WAIT "RTN","EDPRPT1",43,0) . S DISP(DISP,"wait")=DISP(DISP,"wait")+WAIT "RTN","EDPRPT1",44,0) . ; "RTN","EDPRPT1",45,0) . S X=$$ADMIT^EDPRPT(LOG) I X<1 D "RTN","EDPRPT1",46,0) .. S NOT=NOT+1,NOT("elapsed")=NOT("elapsed")+ELAPSE "RTN","EDPRPT1",47,0) .. S NOT("triage")=NOT("triage")+TRIAGE "RTN","EDPRPT1",48,0) .. S NOT("wait")=NOT("wait")+WAIT "RTN","EDPRPT1",49,0) . E D ;decision to admit "RTN","EDPRPT1",50,0) .. S ADMDEC=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPT1",51,0) .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPT1",52,0) .. S ROW("admDec")=ADMDEC,ROW("admDel")=ADMDEL "RTN","EDPRPT1",53,0) .. S ADM=ADM+1,ADM("elapsed")=ADM("elapsed")+ELAPSE "RTN","EDPRPT1",54,0) .. S ADM("triage")=ADM("triage")+TRIAGE "RTN","EDPRPT1",55,0) .. S ADM("wait")=ADM("wait")+WAIT "RTN","EDPRPT1",56,0) .. S ADM("admDec")=ADM("admDec")+ADMDEC "RTN","EDPRPT1",57,0) .. S ADM("admDel")=ADM("admDel")+ADMDEL "RTN","EDPRPT1",58,0) .. S DISP(DISP,"admDec")=DISP(DISP,"admDec")+ADMDEC "RTN","EDPRPT1",59,0) .. S DISP(DISP,"admDel")=DISP(DISP,"admDel")+ADMDEL "RTN","EDPRPT1",60,0) . ; "RTN","EDPRPT1",61,0) . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q "RTN","EDPRPT1",62,0) . S X=ROW("id") "RTN","EDPRPT1",63,0) . F I="inTS","outTS","complaint","md","acuity","elapsed","triage","wait","disposition","admDec","admDel","arrival","dx","icd" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPT1",64,0) . D ADD^EDPCSV(X) "RTN","EDPRPT1",65,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPT1",66,0) ; "RTN","EDPRPT1",67,0) A2 ; calculate & include averages "RTN","EDPRPT1",68,0) Q:ALL<1 ;no visits found "RTN","EDPRPT1",69,0) S ALL("type")="All Patients",NOT("type")="Not Admitted",ADM("type")="Admitted" "RTN","EDPRPT1",70,0) F I="elapsed","triage","wait" S ALL(I)=$$ETIME^EDPRPT(ALL(I)\ALL) "RTN","EDPRPT1",71,0) F I="elapsed","triage","wait" S NOT(I)=$S(NOT:$$ETIME^EDPRPT(NOT(I)\NOT),1:"00:00") "RTN","EDPRPT1",72,0) F I="elapsed","triage","wait","admDec","admDel" S ADM(I)=$S(ADM:$$ETIME^EDPRPT(ADM(I)\ADM),1:"00:00") "RTN","EDPRPT1",73,0) F I="admDec","admDel" S ALL(I)=ADM(I) "RTN","EDPRPT1",74,0) S ALL("total")=ALL,NOT("total")=NOT,ADM("total")=ADM "RTN","EDPRPT1",75,0) S X="" F S X=$O(DISP(X)) Q:X="" I DISP(X) D "RTN","EDPRPT1",76,0) . S DISP(X,"total")=DISP(X),DISP(X,"type")=X "RTN","EDPRPT1",77,0) . F I="elapsed","triage","wait","admDec","admDel" S DISP(X,I)=$$ETIME^EDPRPT(DISP(X,I)\DISP(X)) "RTN","EDPRPT1",78,0) ; "RTN","EDPRPT1",79,0) A3 I $G(CSV) D Q ;CSV format "RTN","EDPRPT1",80,0) . N TAB,D S TAB=$C(9) "RTN","EDPRPT1",81,0) . D BLANK^EDPCSV "RTN","EDPRPT1",82,0) . S X=TAB_"Total Patients"_TAB_ALL_TAB_TAB_TAB_TAB_ALL("elapsed")_TAB_ALL("triage")_TAB_ALL("wait")_TAB_TAB_ALL("admDec")_TAB_ALL("admDel") "RTN","EDPRPT1",83,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT1",84,0) . S X=TAB_TAB_TAB_TAB_"Total"_TAB_"Visit"_TAB_"Triage"_TAB_"Wait"_TAB_"Adm Dec"_TAB_"Adm Del" "RTN","EDPRPT1",85,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT1",86,0) . S X=TAB_TAB_TAB_"Patients Not Admitted"_TAB_NOT_TAB_NOT("elapsed")_TAB_NOT("triage")_TAB_NOT("wait") "RTN","EDPRPT1",87,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT1",88,0) . S X=TAB_TAB_TAB_"Patients Admitted"_TAB_ADM_TAB_ADM("elapsed")_TAB_ADM("triage")_TAB_ADM("wait")_TAB_ADM("admDec")_TAB_ADM("admDel") "RTN","EDPRPT1",89,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT1",90,0) . S X=TAB_TAB_TAB_"Disposition" D ADD^EDPCSV(X) "RTN","EDPRPT1",91,0) . S D="" F S D=$O(DISP(D)) Q:D="" I DISP(D) D "RTN","EDPRPT1",92,0) .. S X=D_TAB_DISP(D)_TAB_DISP(D,"elapsed")_TAB_DISP(D,"triage")_TAB_DISP(D,"wait")_TAB_DISP(D,"admDec")_TAB_DISP(D,"admDel") "RTN","EDPRPT1",93,0) .. D ADD^EDPCSV(X) "RTN","EDPRPT1",94,0) D XML^EDPX("") "RTN","EDPRPT1",95,0) S X=$$XMLA^EDPX("average",.ALL) D XML^EDPX(X) "RTN","EDPRPT1",96,0) S X=$$XMLA^EDPX("average",.NOT) D XML^EDPX(X) "RTN","EDPRPT1",97,0) S X=$$XMLA^EDPX("average",.ADM) D XML^EDPX(X) "RTN","EDPRPT1",98,0) S I="" F S I=$O(DISP(I)) Q:I="" I DISP(I) K ROW M ROW=DISP(I) S X=$$XMLA^EDPX("average",.ROW) D XML^EDPX(X) "RTN","EDPRPT1",99,0) D XML^EDPX("") "RTN","EDPRPT1",100,0) ; include list of providers assigned "RTN","EDPRPT1",101,0) I $O(PROV(0)) D PROV^EDPRPT(.PROV) "RTN","EDPRPT1",102,0) Q "RTN","EDPRPT1",103,0) ; "RTN","EDPRPT1",104,0) INIT ; Initialize counters and sums "RTN","EDPRPT1",105,0) N I,DA,X,Y S (ALL,ADM,NOT)=0 "RTN","EDPRPT1",106,0) F I="elapsed","triage","wait" S (ALL(I),NOT(I),ADM(I))=0 "RTN","EDPRPT1",107,0) F I="admDec","admDel" S ADM(I)=0 "RTN","EDPRPT1",108,0) S X="" F S X=$O(^EDPB(233.1,"AB","disposition",X)) Q:X="" D "RTN","EDPRPT1",109,0) . S DA=0 F S DA=$O(^EDPB(233.1,"AB","disposition",X,DA)) Q:DA<1 D "RTN","EDPRPT1",110,0) .. S Y=$$ECODE^EDPRPT(DA) Q:'$L(Y) S DISP(Y)=0 "RTN","EDPRPT1",111,0) .. F I="elapsed","triage","wait","admDec","admDel" S DISP(Y,I)=0 "RTN","EDPRPT1",112,0) S DISP("none")=0 F I="elapsed","triage","wait","admDec","admDel" S DISP("none",I)=0 "RTN","EDPRPT1",113,0) Q "RTN","EDPRPT10") 0^12^B19172294 "RTN","EDPRPT10",1,0) EDPRPT10 ;SLC/MKB - Admissions Report "RTN","EDPRPT10",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT10",3,0) ; "RTN","EDPRPT10",4,0) ADM(BEG,END) ; Get Admissions Report for EDPSITE by date range "RTN","EDPRPT10",5,0) N IN,OUT,LOG,X,X0,X1,X3,DX,DISP,ROW,TAB "RTN","EDPRPT10",6,0) N ELAPSE,TRIAGE,WAIT,ADMDEC,ADMDEL "RTN","EDPRPT10",7,0) D INIT ;set counters, sums to 0 "RTN","EDPRPT10",8,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPT10",9,0) . S TAB=$C(9) "RTN","EDPRPT10",10,0) . S X="ED"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Diagnosis"_TAB_"ICD9" ;_TAB_"ER Spec Visit" "RTN","EDPRPT10",11,0) . D ADD^EDPCSV(X) "RTN","EDPRPT10",12,0) S IN=BEG-.000001 "RTN","EDPRPT10",13,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT10",14,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPRPT10",15,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),OUT=$P(X0,U,9) "RTN","EDPRPT10",16,0) . Q:DISP="" Q:'$D(CNT($$UP^XLFSTR(DISP))) ;visits w/admit disp "RTN","EDPRPT10",17,0) . S DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG) "RTN","EDPRPT10",18,0) . K ROW S ROW("id")=LOG "RTN","EDPRPT10",19,0) . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT) "RTN","EDPRPT10",20,0) . S ROW("complaint")=$P(X1,U) "RTN","EDPRPT10",21,0) . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5)) "RTN","EDPRPT10",22,0) . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3)) "RTN","EDPRPT10",23,0) . S ROW("disposition")=DISP,DISP=$$UP^XLFSTR(DISP) "RTN","EDPRPT10",24,0) . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2) "RTN","EDPRPT10",25,0) . ; ER Special Visit ?? -- ck ^DPT dispositions "RTN","EDPRPT10",26,0) . S CNT("ALL")=CNT("ALL")+1,CNT(DISP)=CNT(DISP)+1 "RTN","EDPRPT10",27,0) . ; "RTN","EDPRPT10",28,0) A1 . ; calculate times "RTN","EDPRPT10",29,0) . ; S:OUT="" OUT=NOW "RTN","EDPRPT10",30,0) . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) "RTN","EDPRPT10",31,0) . F I="ALL",DISP S MIN(I,"elapsed")=MIN(I,"elapsed")+ELAPSE "RTN","EDPRPT10",32,0) . ; "RTN","EDPRPT10",33,0) . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT "RTN","EDPRPT10",34,0) . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPT10",35,0) . F I="ALL",DISP S MIN(I,"triage")=MIN(I,"triage")+TRIAGE "RTN","EDPRPT10",36,0) . ; "RTN","EDPRPT10",37,0) . S X=$$LVWAITRM^EDPRPT(LOG),WAIT=0 ;leave waiting room "RTN","EDPRPT10",38,0) . S:X WAIT=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPT10",39,0) . F I="ALL",DISP S MIN(I,"wait")=MIN(I,"wait")+WAIT "RTN","EDPRPT10",40,0) . ; "RTN","EDPRPT10",41,0) . S X=$$ADMIT^EDPRPT(LOG) ;decision to admit "RTN","EDPRPT10",42,0) . S ADMDEC=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0) "RTN","EDPRPT10",43,0) . F I="ALL",DISP S MIN(I,"admDec")=MIN(I,"admDec")+ADMDEC "RTN","EDPRPT10",44,0) . S ROW("admDec")=ADMDEC "RTN","EDPRPT10",45,0) . ; "RTN","EDPRPT10",46,0) . S ADMDEL=$S(X:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPT10",47,0) . F I="ALL",DISP S MIN(I,"admDel")=MIN(I,"admDel")+ADMDEL "RTN","EDPRPT10",48,0) . S ROW("admDel")=ADMDEL "RTN","EDPRPT10",49,0) . ; "RTN","EDPRPT10",50,0) . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q "RTN","EDPRPT10",51,0) . S X=ROW("id") "RTN","EDPRPT10",52,0) . F I="outTS","complaint","md","acuity","disposition","admDec","admDel","dx","icd" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPT10",53,0) . D ADD^EDPCSV(X) "RTN","EDPRPT10",54,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPT10",55,0) ; "RTN","EDPRPT10",56,0) A2 ; calculate & include averages "RTN","EDPRPT10",57,0) Q:CNT("ALL")<1 ;no visits found "RTN","EDPRPT10",58,0) I $G(CSV) D Q ;return as CSV "RTN","EDPRPT10",59,0) . S X=TAB_TAB_TAB_" Activity Summary"_TAB_"Total"_TAB_"Visit"_TAB_"Triage"_TAB_"Wait"_TAB_"Adm Dec"_TAB_"Adm Delay" "RTN","EDPRPT10",60,0) . D BLANK^EDPCSV,ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT10",61,0) . S X=TAB_TAB_TAB_"Total Patients VA Admitted"_TAB_CNT("ALL") "RTN","EDPRPT10",62,0) . F I="elapsed","triage","wait","admDec","admDel" D "RTN","EDPRPT10",63,0) .. S Y=MIN("ALL",I)\CNT("ALL"),X=X_TAB_$S(Y:$$ETIME^EDPRPT(Y),1:"0:00") "RTN","EDPRPT10",64,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT10",65,0) . S X=TAB_TAB_TAB_" Disposition" D ADD^EDPCSV(X) "RTN","EDPRPT10",66,0) . S DISP="" F S DISP=$O(CNT(DISP)) Q:DISP="" I DISP'="ALL",CNT(DISP) D "RTN","EDPRPT10",67,0) .. S X=TAB_TAB_TAB_DISP_TAB_CNT(DISP) "RTN","EDPRPT10",68,0) .. F I="elapsed","triage","wait","admDec","admDel" D "RTN","EDPRPT10",69,0) ... S Y=MIN(DISP,I)\CNT(DISP),X=X_TAB_$S(Y:$$ETIME^EDPRPT(Y),1:"0:00") "RTN","EDPRPT10",70,0) .. D ADD^EDPCSV(X) "RTN","EDPRPT10",71,0) ; or as XML "RTN","EDPRPT10",72,0) D XML^EDPX("") "RTN","EDPRPT10",73,0) S DISP="" F S DISP=$O(CNT(DISP)) Q:DISP="" I CNT(DISP) D "RTN","EDPRPT10",74,0) . S MIN(DISP,"type")=$S(DISP="ALL":"Total Patients VA Admitted",1:DISP) "RTN","EDPRPT10",75,0) . S MIN(DISP,"total")=CNT(DISP) "RTN","EDPRPT10",76,0) . F I="elapsed","triage","wait","admDec","admDel" D "RTN","EDPRPT10",77,0) .. S X=MIN(DISP,I)\CNT(DISP) "RTN","EDPRPT10",78,0) .. S MIN(DISP,I)=$S(X:$$ETIME^EDPRPT(X),1:"0:00") "RTN","EDPRPT10",79,0) . K ROW M ROW=MIN(DISP) "RTN","EDPRPT10",80,0) . S X=$$XMLA^EDPX("average",.ROW) D XML^EDPX(X) "RTN","EDPRPT10",81,0) D XML^EDPX("") "RTN","EDPRPT10",82,0) Q "RTN","EDPRPT10",83,0) ; "RTN","EDPRPT10",84,0) INIT ; Initialize counters and sums "RTN","EDPRPT10",85,0) N I,DISP "RTN","EDPRPT10",86,0) ;F D="VA","T","ICU","OBS","ALL" D "RTN","EDPRPT10",87,0) S DISP="" F S DISP=$O(^EDPB(233.1,"AB","disposition",DISP)) Q:DISP="" D "RTN","EDPRPT10",88,0) . Q:'$$VADMIT^EDPRPT2(DISP) "RTN","EDPRPT10",89,0) . S CNT(DISP)=0 "RTN","EDPRPT10",90,0) . F I="elapsed","triage","wait","admDec","admDel" S MIN(DISP,I)=0 "RTN","EDPRPT10",91,0) S CNT("ALL")=0 "RTN","EDPRPT10",92,0) F I="elapsed","triage","wait","admDec","admDel" S MIN("ALL",I)=0 "RTN","EDPRPT10",93,0) Q "RTN","EDPRPT10",94,0) ; "RTN","EDPRPT10",95,0) ECODE(IEN) ; Return external value for a Code "RTN","EDPRPT10",96,0) Q:IEN $P($G(^EDPB(233.1,IEN,0)),U,2) ;name "RTN","EDPRPT10",97,0) Q "" "RTN","EDPRPT11") 0^13^B8054102 "RTN","EDPRPT11",1,0) EDPRPT11 ;SLC/MKB - Patient Intake Report "RTN","EDPRPT11",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT11",3,0) ; "RTN","EDPRPT11",4,0) CNT(BEG,END) ; Get Patient Intake Report for EDPSITE by date range "RTN","EDPRPT11",5,0) ; CNT = counters "RTN","EDPRPT11",6,0) N IN,LOG,LAST,X,CNT,HR,DAY,%H,%T,%Y,H,D,ROW,AVG,NM,TAB,DAYS "RTN","EDPRPT11",7,0) D INIT S LAST="" ;set counters to 0 "RTN","EDPRPT11",8,0) S IN=BEG-.000001,TAB=$C(9) "RTN","EDPRPT11",9,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT11",10,0) . S X=$P($G(^EDP(230,LOG,0)),U,8) Q:X<1 "RTN","EDPRPT11",11,0) . D H^%DTC S H=%T\3600,D=%Y "RTN","EDPRPT11",12,0) . S CNT=CNT+1,HR(H)=HR(H)+1,CNT(H,D)=CNT(H,D)+1 "RTN","EDPRPT11",13,0) . S DAY(D)=DAY(D)+1 "RTN","EDPRPT11",14,0) . I LAST=""!($P(LAST,".")'=$P(IN,".")) S DAYS(D)=DAYS(D)+1,LAST=IN "RTN","EDPRPT11",15,0) C1 ; return counts and averages "RTN","EDPRPT11",16,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPT11",17,0) . S X="Time/Day"_TAB_"Sunday"_TAB_"Monday"_TAB_"Tuesday"_TAB_"Wednesday"_TAB_"Thursday"_TAB_"Friday"_TAB_"Saturday"_TAB_"Totals"_TAB_"Avg/Day" "RTN","EDPRPT11",18,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT11",19,0) F H=0:1:23 D "RTN","EDPRPT11",20,0) . K ROW S ROW("time")=$$TIME(H)_"-"_$$TIME(H+1) "RTN","EDPRPT11",21,0) . S ROW=ROW("time") ;CSV "RTN","EDPRPT11",22,0) . F D=0:1:6 S NM=$$NAME(D) D "RTN","EDPRPT11",23,0) .. S ROW(NM)=CNT(H,D) "RTN","EDPRPT11",24,0) .. S ROW=ROW_TAB_ROW(NM) ;CSV "RTN","EDPRPT11",25,0) . S ROW("total")=HR(H),ROW("average")=$$ROUND(HR(H)/DAYS) "RTN","EDPRPT11",26,0) . I '$G(CSV) S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) Q "RTN","EDPRPT11",27,0) . S ROW=ROW_TAB_ROW("total")_TAB_ROW("average") D ADD^EDPCSV(ROW) "RTN","EDPRPT11",28,0) ; total & average rows "RTN","EDPRPT11",29,0) K ROW S ROW("time")="Totals",ROW=ROW("time") "RTN","EDPRPT11",30,0) S AVG("time")="Avg/Hour",AVG=AVG("time") "RTN","EDPRPT11",31,0) F D=0:1:6 S NM=$$NAME(D) D "RTN","EDPRPT11",32,0) . S ROW(NM)=DAY(D),X=0 "RTN","EDPRPT11",33,0) . S:DAYS(D) X=DAY(D)/(24*DAYS(D)) "RTN","EDPRPT11",34,0) . S AVG(NM)=$$ROUND(X) "RTN","EDPRPT11",35,0) . S ROW=ROW_TAB_ROW(NM) ;CSV "RTN","EDPRPT11",36,0) . S AVG=AVG_TAB_AVG(NM) ;CSV "RTN","EDPRPT11",37,0) S ROW("total")=CNT,ROW("average")=$$ROUND(CNT/DAYS) "RTN","EDPRPT11",38,0) S ROW=ROW_TAB_ROW("total")_TAB_ROW("average") "RTN","EDPRPT11",39,0) I $G(CSV) D BLANK^EDPCSV,ADD^EDPCSV(ROW),ADD^EDPCSV(AVG) Q "RTN","EDPRPT11",40,0) S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) "RTN","EDPRPT11",41,0) S X=$$XMLA^EDPX("row",.AVG) D XML^EDPX(X) "RTN","EDPRPT11",42,0) D XML^EDPX("") "RTN","EDPRPT11",43,0) Q "RTN","EDPRPT11",44,0) ; "RTN","EDPRPT11",45,0) INIT ; Initialize counters and sums "RTN","EDPRPT11",46,0) N H,D S CNT=0 "RTN","EDPRPT11",47,0) F H=0:1:23 S HR(H)=0 F D=0:1:6 S CNT(H,D)=0 "RTN","EDPRPT11",48,0) F D=0:1:6 S DAY(D)=0,DAYS(D)=0 "RTN","EDPRPT11",49,0) S DAYS=$$FMDIFF^XLFDT(END,BEG)+1 "RTN","EDPRPT11",50,0) Q "RTN","EDPRPT11",51,0) ; "RTN","EDPRPT11",52,0) ROUND(X) ; Round X to one decimal place "RTN","EDPRPT11",53,0) N Y1,Y2,Y S X=+$G(X) "RTN","EDPRPT11",54,0) S Y1=+$P(X,"."),Y2=$E($P(X,".",2)_"00",1,2) "RTN","EDPRPT11",55,0) S:$E(Y2,2)'>4 Y2=+$E(Y2) I $E(Y2,2)>4 D "RTN","EDPRPT11",56,0) . I $E(Y2)=9 S Y1=Y1+1,Y2=0 Q "RTN","EDPRPT11",57,0) . S Y2=$E(Y2)+1 "RTN","EDPRPT11",58,0) S Y=Y1_"."_Y2 "RTN","EDPRPT11",59,0) Q Y "RTN","EDPRPT11",60,0) ; "RTN","EDPRPT11",61,0) ZROUND(X) ; Round X to nearest integer "RTN","EDPRPT11",62,0) N Y S Y=+$E($P(X,".",2)),X=X\1 "RTN","EDPRPT11",63,0) S:Y>4 X=X+1 "RTN","EDPRPT11",64,0) Q X "RTN","EDPRPT11",65,0) ; "RTN","EDPRPT11",66,0) TIME(X) ; Return 0000 form of hour# X "RTN","EDPRPT11",67,0) N Y S Y=$S($L(X)=1:"0"_X,1:X)_"00" "RTN","EDPRPT11",68,0) Q Y "RTN","EDPRPT11",69,0) ; "RTN","EDPRPT11",70,0) NAME(X) ; Return name of day# X "RTN","EDPRPT11",71,0) I X=1 Q "Monday" "RTN","EDPRPT11",72,0) I X=2 Q "Tuesday" "RTN","EDPRPT11",73,0) I X=3 Q "Wednesday" "RTN","EDPRPT11",74,0) I X=4 Q "Thursday" "RTN","EDPRPT11",75,0) I X=5 Q "Friday" "RTN","EDPRPT11",76,0) I X=6 Q "Saturday" "RTN","EDPRPT11",77,0) Q "Sunday" "RTN","EDPRPT12") 0^50^B7797789 "RTN","EDPRPT12",1,0) EDPRPT12 ;SLC/MKB - Orders by Acuity Report "RTN","EDPRPT12",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT12",3,0) ; "RTN","EDPRPT12",4,0) ORD(BEG,END) ; Get Acuity Report for EDPSITE by date range "RTN","EDPRPT12",5,0) ; CNT = counters by acuity "RTN","EDPRPT12",6,0) N IN,OUT,X,X0,I,SERV,ACU,CNT,ROW,EDLOC "RTN","EDPRPT12",7,0) D INIT ;set counters, sums to 0 "RTN","EDPRPT12",8,0) S IN=BEG-.000001 "RTN","EDPRPT12",9,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT12",10,0) . S X=$P($G(^EDP(230,LOG,3)),U,3),ACU=$$ECODE(X) "RTN","EDPRPT12",11,0) . I '$D(^EDP(230,LOG,8)) D FIND(LOG,ACU) Q ;old/converted visit "RTN","EDPRPT12",12,0) . S I=0 F S I=$O(^EDP(230,LOG,8,I)) Q:I<1 S X0=$G(^(I,0)) D "RTN","EDPRPT12",13,0) .. S SERV=$$ENAME($P(X0,U,2)) "RTN","EDPRPT12",14,0) .. S CNT(ACU,SERV)=CNT(ACU,SERV)+1 "RTN","EDPRPT12",15,0) ; "RTN","EDPRPT12",16,0) OR1 ; return counts "RTN","EDPRPT12",17,0) I $G(CSV) D Q ;as CSV "RTN","EDPRPT12",18,0) . N TAB S TAB=$C(9) "RTN","EDPRPT12",19,0) . S X="Acuity"_TAB_"Labs"_TAB_"Images"_TAB_"Consults"_TAB_"Meds"_TAB_"Other" "RTN","EDPRPT12",20,0) . D ADD^EDPCSV(X) "RTN","EDPRPT12",21,0) . F ACU=0,1,2,3,4,5 D "RTN","EDPRPT12",22,0) .. K ROW S ROW("acuity")=ACU M ROW=CNT(ACU) "RTN","EDPRPT12",23,0) .. D ROW(ACU,.ROW) "RTN","EDPRPT12",24,0) ; or as XML "RTN","EDPRPT12",25,0) D XML^EDPX("") "RTN","EDPRPT12",26,0) F ACU=0,1,2,3,4,5 D "RTN","EDPRPT12",27,0) . K ROW S ROW("acuity")=ACU M ROW=CNT(ACU) "RTN","EDPRPT12",28,0) . S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) "RTN","EDPRPT12",29,0) D XML^EDPX("") "RTN","EDPRPT12",30,0) Q "RTN","EDPRPT12",31,0) ; "RTN","EDPRPT12",32,0) ROW(NAME,LIST) ; add line "RTN","EDPRPT12",33,0) N I S X=NAME "RTN","EDPRPT12",34,0) F I="labs","images","consults","meds","other" S X=X_TAB_LIST(I) "RTN","EDPRPT12",35,0) D ADD^EDPCSV(X) "RTN","EDPRPT12",36,0) Q "RTN","EDPRPT12",37,0) ; "RTN","EDPRPT12",38,0) INIT ; Initialize acuity/service counters "RTN","EDPRPT12",39,0) N A,S "RTN","EDPRPT12",40,0) F A=0,1,2,3,4,5 D "RTN","EDPRPT12",41,0) . F S="meds","labs","images","consults","other" S CNT(A,S)=0 "RTN","EDPRPT12",42,0) Q "RTN","EDPRPT12",43,0) ; "RTN","EDPRPT12",44,0) ECODE(IEN) ; Return external value for an Acuity code "RTN","EDPRPT12",45,0) N X0,X,Y S X0=$G(^EDPB(233.1,+IEN,0)) "RTN","EDPRPT12",46,0) S X=$P(X0,U,3) S:X<1 X=$P(X0,U,4) ;code or nat'l code "RTN","EDPRPT12",47,0) ;S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"none") "RTN","EDPRPT12",48,0) S Y=+X I (Y<1)!(Y>5) S Y=0 "RTN","EDPRPT12",49,0) Q Y "RTN","EDPRPT12",50,0) ; "RTN","EDPRPT12",51,0) ENAME(X) ; Return external name for a Service code "RTN","EDPRPT12",52,0) I X="L"!($E(X,1,2)="LR") Q "labs" "RTN","EDPRPT12",53,0) I X="R"!($E(X,1,2)="RA") Q "images" "RTN","EDPRPT12",54,0) I X="C"!(X="GMRC") Q "consults" "RTN","EDPRPT12",55,0) I X="M"!($E(X,1,2)="PS") Q "meds" "RTN","EDPRPT12",56,0) I X="A" Q "other" "RTN","EDPRPT12",57,0) Q "other" "RTN","EDPRPT12",58,0) ; "RTN","EDPRPT12",59,0) FIND(LOG,ACU) ; find/count orders placed during visit LOG "RTN","EDPRPT12",60,0) ; (for converted data) "RTN","EDPRPT12",61,0) N ORLIST,X0,DFN,IN,OUT,ORI,ORIFN,ORL,PKG,SERV "RTN","EDPRPT12",62,0) S X0=$G(^EDP(230,LOG,0)),DFN=+$P(X0,U,6) Q:DFN<1 "RTN","EDPRPT12",63,0) S IN=$P(X0,U,8),OUT=$P(X0,U,9) "RTN","EDPRPT12",64,0) D:'$D(EDLOC) GETLST^XPAR(.EDLOC,"ALL","EDPF LOCATION") "RTN","EDPRPT12",65,0) K ^TMP("ORR",$J) D EN^ORQ1(DFN_";DPT(",,1,,IN,OUT) S ORI=0 "RTN","EDPRPT12",66,0) F S ORI=$O(^TMP("ORR",$J,ORLIST,ORI)) Q:ORI<1 S ORIFN=+$G(^(ORI)) D "RTN","EDPRPT12",67,0) . S ORL=$$GET1^DIQ(100,ORIFN_",",6,"I") Q:'$$ED(+ORL) "RTN","EDPRPT12",68,0) . S PKG=$$GET1^DIQ(100,ORIFN_",","12:1") "RTN","EDPRPT12",69,0) . S SERV=$$ENAME(PKG) "RTN","EDPRPT12",70,0) . S CNT(ACU,SERV)=CNT(ACU,SERV)+1 "RTN","EDPRPT12",71,0) Q "RTN","EDPRPT12",72,0) ; "RTN","EDPRPT12",73,0) ED(LOC) ; -- Return 1 or 0, if LOCation is part of ED "RTN","EDPRPT12",74,0) ; Expects EDLOC(n) = seq ^ #44 ien "RTN","EDPRPT12",75,0) N I,Y S (I,Y)=0 "RTN","EDPRPT12",76,0) F S I=$O(EDLOC(I)) Q:I<1 I $P(EDLOC(I),U,2)=LOC S Y=1 Q "RTN","EDPRPT12",77,0) Q Y "RTN","EDPRPT2") 0^14^B15843773 "RTN","EDPRPT2",1,0) EDPRPT2 ;SLC/MKB - Delay Report "RTN","EDPRPT2",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT2",3,0) ; "RTN","EDPRPT2",4,0) DEL(BEG,END) ; Get Delay Report for EDPSITE by date range "RTN","EDPRPT2",5,0) ; CNT = counters "RTN","EDPRPT2",6,0) ; MIN = accumulate #minutes "RTN","EDPRPT2",7,0) N IN,OUT,LOG,X,X0,X1,X3,DX,ELAPSE,ADMDEC,ADMDEL,DISP,VADISP,CNT,MIN,DEL,ACU "RTN","EDPRPT2",8,0) D INIT ;set counters, sums to 0 "RTN","EDPRPT2",9,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPT2",10,0) . N TAB S TAB=$C(9) "RTN","EDPRPT2",11,0) . S X="ED IEN"_TAB_"Time In"_TAB_"Elapsed"_TAB_"Dispo"_TAB_"Delay Reason"_TAB_"MD"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Acuity"_TAB_"Diagnosis" "RTN","EDPRPT2",12,0) . D ADD^EDPCSV(X) "RTN","EDPRPT2",13,0) S IN=BEG-.000001 "RTN","EDPRPT2",14,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT2",15,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPRPT2",16,0) . S ACU=$$ECODE^EDPRPT($P(X3,U,3)),DEL=+$P(X1,U,5),CNT=CNT+1 "RTN","EDPRPT2",17,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),VADISP=$$VADMIT(DISP) "RTN","EDPRPT2",18,0) . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPT2",19,0) . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0),MIN=MIN+ELAPSE "RTN","EDPRPT2",20,0) D1 . ; all admissions "RTN","EDPRPT2",21,0) . S (ADMDEC,ADMDEL)=0 "RTN","EDPRPT2",22,0) . S X=$$ADMIT^EDPRPT(LOG) I X D "RTN","EDPRPT2",23,0) .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60 "RTN","EDPRPT2",24,0) .. S:ADMDEC CNT("DEC")=CNT("DEC")+1,MIN("DEC")=MIN("DEC")+ADMDEC "RTN","EDPRPT2",25,0) .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPT2",26,0) D2 . ; VA admissions only "RTN","EDPRPT2",27,0) . I VADISP D "RTN","EDPRPT2",28,0) .. S CNT("VA")=CNT("VA")+1 "RTN","EDPRPT2",29,0) .. S MIN("VA")=MIN("VA")+ELAPSE "RTN","EDPRPT2",30,0) .. S MIN("VADEC")=MIN("VADEC")+ADMDEC "RTN","EDPRPT2",31,0) .. S MIN("VADEL")=MIN("VADEL")+ADMDEL "RTN","EDPRPT2",32,0) .. S:ADMDEL>359 CNT("VADEL6")=CNT("VADEL6")+1 "RTN","EDPRPT2",33,0) D3 . ; elapsed visit time >=6 hrs "RTN","EDPRPT2",34,0) . S:ELAPSE>1380 CNT("23+")=CNT("23+")+1 "RTN","EDPRPT2",35,0) . I ELAPSE>359 D "RTN","EDPRPT2",36,0) .. S CNT("6+")=CNT("6+")+1 "RTN","EDPRPT2",37,0) .. S:VADISP CNT("VA6")=CNT("VA6")+1 "RTN","EDPRPT2",38,0) .. S DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG) "RTN","EDPRPT2",39,0) .. N ROW S ROW("id")=LOG "RTN","EDPRPT2",40,0) .. S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN) "RTN","EDPRPT2",41,0) .. S ROW("elapsed")=$$ETIME^EDPRPT(ELAPSE)_" *" "RTN","EDPRPT2",42,0) .. S ROW("disposition")=DISP "RTN","EDPRPT2",43,0) .. S ROW("acuity")=ACU "RTN","EDPRPT2",44,0) .. S ROW("delayReason")=$$ENAME^EDPRPT(DEL) "RTN","EDPRPT2",45,0) .. S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5)) "RTN","EDPRPT2",46,0) .. S ROW("dx")=$P(DX,U,2) "RTN","EDPRPT2",47,0) .. S ROW("admDec")=ADMDEC "RTN","EDPRPT2",48,0) .. S ROW("admDel")=ADMDEL "RTN","EDPRPT2",49,0) .. I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q "RTN","EDPRPT2",50,0) .. S X=ROW("id") "RTN","EDPRPT2",51,0) .. F I="inTS","elapsed","disposition","delayReason","md","admDec","admDel","acuity","dx" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPT2",52,0) .. D ADD^EDPCSV(X) "RTN","EDPRPT2",53,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPT2",54,0) Q "RTN","EDPRPT2",55,0) ; "RTN","EDPRPT2",56,0) D4 ; return counts and averages "RTN","EDPRPT2",57,0) D XML^EDPX("") "RTN","EDPRPT2",58,0) S X="" "RTN","EDPRPT2",59,0) D XML^EDPX(X) "RTN","EDPRPT2",60,0) S X="" "RTN","EDPRPT2",61,0) D XML^EDPX(X) "RTN","EDPRPT2",62,0) S X="" "RTN","EDPRPT2",64,0) D XML^EDPX(X) "RTN","EDPRPT2",65,0) D XML^EDPX("") "RTN","EDPRPT2",66,0) Q "RTN","EDPRPT2",67,0) ; "RTN","EDPRPT2",68,0) INIT ; Initialize counters and sums "RTN","EDPRPT2",69,0) N I S (CNT,MIN)=0 "RTN","EDPRPT2",70,0) F I="DEC","VA","VA6","VADEL6","6+","23+" S CNT(I)=0 "RTN","EDPRPT2",71,0) F I="DEC","VA","VADEC","VADEL" S MIN(I)=0 "RTN","EDPRPT2",72,0) Q "RTN","EDPRPT2",73,0) ; "RTN","EDPRPT2",74,0) VADMIT(X) ; -- Return 1 or 0, if disposition indicates a VA admission "RTN","EDPRPT2",75,0) I $G(X)="" Q 0 "RTN","EDPRPT2",76,0) N I,Y S X=$$UP^XLFSTR(X) "RTN","EDPRPT2",77,0) S I=+$O(^EDPB(233.1,"AB","disposition",X,0)) "RTN","EDPRPT2",78,0) S Y=$S($P($G(^EDPB(233.1,I,0)),U,5)["V":1,1:0) "RTN","EDPRPT2",79,0) Q Y "RTN","EDPRPT3") 0^15^B8721424 "RTN","EDPRPT3",1,0) EDPRPT3 ;SLC/MKB - Missed Opportunity Report "RTN","EDPRPT3",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT3",3,0) ; "RTN","EDPRPT3",4,0) MO(BEG,END) ; Get Missed Opp Report for EDPSITE by date range "RTN","EDPRPT3",5,0) ; CNT = counters "RTN","EDPRPT3",6,0) N IN,OUT,LOG,DISP,X,X0,X1,X3,X4,I,CNT,ROW "RTN","EDPRPT3",7,0) D INIT ;set counters to 0 "RTN","EDPRPT3",8,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPT3",9,0) . N TAB S TAB=$C(9) "RTN","EDPRPT3",10,0) . S X="ED"_TAB_"Time In"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Wait"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Del"_TAB_"Delay" "RTN","EDPRPT3",11,0) . D ADD^EDPCSV(X) "RTN","EDPRPT3",12,0) S IN=BEG-.000001 "RTN","EDPRPT3",13,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT3",14,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0)) "RTN","EDPRPT3",15,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)) Q:'$$MISSEDOP(DISP) "RTN","EDPRPT3",16,0) . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPT3",17,0) . K ROW S ROW("id")=LOG "RTN","EDPRPT3",18,0) . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN) "RTN","EDPRPT3",19,0) . S ROW("complaint")=$P(X1,U) "RTN","EDPRPT3",20,0) . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3)) "RTN","EDPRPT3",21,0) . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5)) "RTN","EDPRPT3",22,0) . S ROW("disposition")=DISP "RTN","EDPRPT3",23,0) . S DISP=$$UP^XLFSTR(DISP),CNT(DISP)=CNT(DISP)+1 "RTN","EDPRPT3",24,0) . ; "RTN","EDPRPT3",25,0) . ; calculate times "RTN","EDPRPT3",26,0) . S ROW("elapsed")=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) "RTN","EDPRPT3",27,0) . S X=$$ACUITY^EDPRPT(LOG) ;S:X<1 X=OUT "RTN","EDPRPT3",28,0) . S ROW("triage")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0) "RTN","EDPRPT3",29,0) . S X=$$LVWAITRM^EDPRPT(LOG) ;S:X<1 X=IN "RTN","EDPRPT3",30,0) . S ROW("wait")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0) "RTN","EDPRPT3",31,0) . S X=$$ADMIT^EDPRPT(LOG) "RTN","EDPRPT3",32,0) . S ROW("admDec")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0) "RTN","EDPRPT3",33,0) . S ROW("admDel")=$S(X&OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPT3",34,0) . S ROW("delayReason")=$$ENAME^EDPRPT(+$P(X1,U,5)) "RTN","EDPRPT3",35,0) . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q "RTN","EDPRPT3",36,0) . S X=ROW("id") "RTN","EDPRPT3",37,0) . F I="inTS","complaint","md","acuity","elapsed","triage","wait","disposition","admDec","admDel","delayReason" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPT3",38,0) . D ADD^EDPCSV(X) "RTN","EDPRPT3",39,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPT3",40,0) ; "RTN","EDPRPT3",41,0) ; return totals, as XML or CSV "RTN","EDPRPT3",42,0) I '$G(CSV) S X=$$XMLA^EDPX("totals",.CNT) D XML^EDPX(X) Q "RTN","EDPRPT3",43,0) N TAB S TAB=$C(9) "RTN","EDPRPT3",44,0) S I="" F S I=$O(CNT(I)) Q:I="" D "RTN","EDPRPT3",45,0) . D BLANK^EDPCSV "RTN","EDPRPT3",46,0) . S X=TAB_TAB_TAB_TAB_"Total "_CNT(I,0)_": "_CNT(I) "RTN","EDPRPT3",47,0) . D ADD^EDPCSV(X) "RTN","EDPRPT3",48,0) Q "RTN","EDPRPT3",49,0) ; "RTN","EDPRPT3",50,0) INIT ; -- initialize counters "RTN","EDPRPT3",51,0) N I,X,X2 S CNT=0 "RTN","EDPRPT3",52,0) S X="" F S X=$O(^EDPB(233.1,"AB","disposition",X)) Q:X="" S I=+$O(^(X,0)) D "RTN","EDPRPT3",53,0) . S X2=$P($G(^EDPB(233.1,I,0)),U,2) "RTN","EDPRPT3",54,0) . I $$MISSEDOP(X) S CNT(X)=0,CNT(X,0)=X2 "RTN","EDPRPT3",55,0) Q "RTN","EDPRPT3",56,0) ; "RTN","EDPRPT3",57,0) MISSEDOP(X) ; -- Return 1 or 0, if disposition indicates a missed opportunity "RTN","EDPRPT3",58,0) I $G(X)="" Q 0 "RTN","EDPRPT3",59,0) N I,Y S X=$$UP^XLFSTR(X) "RTN","EDPRPT3",60,0) S I=+$O(^EDPB(233.1,"AB","disposition",X,0)) "RTN","EDPRPT3",61,0) S Y=$S($P($G(^EDPB(233.1,I,0)),U,5)["M":1,1:0) "RTN","EDPRPT3",62,0) Q Y "RTN","EDPRPT4") 0^16^B24084771 "RTN","EDPRPT4",1,0) EDPRPT4 ;SLC/MKB - Delay Summary Report "RTN","EDPRPT4",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT4",3,0) ; "RTN","EDPRPT4",4,0) SUM(BEG,END) ; Get Delay Report for EDPSITE by date range "RTN","EDPRPT4",5,0) ; CNT = counters "RTN","EDPRPT4",6,0) ; MIN = accumulate #minutes "RTN","EDPRPT4",7,0) N IN,OUT,LOG,X,X0,X1,X3,X4,ELAPSE,ADMDEC,ADMDEL,DISP,STS,VADM,CNT,MIN,PROV,DEL,ACU,Y "RTN","EDPRPT4",8,0) D INIT ;set counters, sums to 0 "RTN","EDPRPT4",9,0) S IN=BEG-.000001 "RTN","EDPRPT4",10,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT4",11,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0)) "RTN","EDPRPT4",12,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),VADM=$$VADMIT^EDPRPT2(DISP) "RTN","EDPRPT4",13,0) . S ACU=$$ECODE($P(X3,U,3)),STS=$P(X3,U,2) "RTN","EDPRPT4",14,0) . S DEL=+$P(X1,U,5),CNT=CNT+1 "RTN","EDPRPT4",15,0) . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPT4",16,0) . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0),MIN=MIN+ELAPSE "RTN","EDPRPT4",17,0) D1 . ; all admissions "RTN","EDPRPT4",18,0) . S (ADMDEC,ADMDEL)=0 "RTN","EDPRPT4",19,0) . S X=$$ADMIT^EDPRPT(LOG) I X D "RTN","EDPRPT4",20,0) .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60 "RTN","EDPRPT4",21,0) .. S:ADMDEC CNT("DEC")=CNT("DEC")+1,MIN("DEC")=MIN("DEC")+ADMDEC "RTN","EDPRPT4",22,0) .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPT4",23,0) . S:$$OBS(STS) CNT("OBS")=CNT("OBS")+1 "RTN","EDPRPT4",24,0) D2 . ; VA admissions only "RTN","EDPRPT4",25,0) . I VADM D "RTN","EDPRPT4",26,0) .. S CNT("VA")=CNT("VA")+1 "RTN","EDPRPT4",27,0) .. S MIN("VA")=MIN("VA")+ELAPSE "RTN","EDPRPT4",28,0) .. S MIN("VADEC")=MIN("VADEC")+ADMDEC "RTN","EDPRPT4",29,0) .. S MIN("VADEL")=MIN("VADEL")+ADMDEL "RTN","EDPRPT4",30,0) .. S:ADMDEL>359 CNT("VADEL6")=CNT("VADEL6")+1 "RTN","EDPRPT4",31,0) D3 . ; elapsed visit time >=6 hrs "RTN","EDPRPT4",32,0) . S:ELAPSE>1380 CNT("23+")=CNT("23+")+1 "RTN","EDPRPT4",33,0) . I ELAPSE>359 D "RTN","EDPRPT4",34,0) .. S CNT("6+")=CNT("6+")+1 "RTN","EDPRPT4",35,0) .. S:VADM CNT("VA6")=CNT("VA6")+1 "RTN","EDPRPT4",36,0) . S:DEL CNT(DEL,ACU)=+$G(CNT(DEL,ACU))+1,CNT(DEL)=+$G(CNT(DEL))+1 "RTN","EDPRPT4",37,0) ; "RTN","EDPRPT4",38,0) D4 ; return counts and averages as CSV "RTN","EDPRPT4",39,0) I $G(CSV) D Q "RTN","EDPRPT4",40,0) . N TAB S TAB=$C(9) "RTN","EDPRPT4",41,0) . S X=TAB_TAB_"Delay Reason"_TAB_"0"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total" "RTN","EDPRPT4",42,0) . D ADD^EDPCSV(X),BLANK^EDPCSV ;headers "RTN","EDPRPT4",43,0) . S X="Total ED Visits: "_CNT_TAB "RTN","EDPRPT4",44,0) . S X=X_"Average ED Visit Time: "_$S(CNT:$$ETIME^EDPRPT(MIN\CNT),1:0) "RTN","EDPRPT4",45,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",46,0) . S X="Total Visits over Six Hours: "_CNT("6+")_TAB "RTN","EDPRPT4",47,0) . S X=X_"Total Visits over 23 Hours: "_CNT("23+") "RTN","EDPRPT4",48,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",49,0) . S X="Total Admitted to Observation: "_CNT("OBS") "RTN","EDPRPT4",50,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",51,0) . S Y=CNT-CNT("VA"),X="Total Visits Not VA Admitted: "_Y_TAB "RTN","EDPRPT4",52,0) . S X=X_"Average Visit Time for Not VA Admitted: "_$S(Y:$$ETIME^EDPRPT((MIN-MIN("VA")\Y)),1:0) "RTN","EDPRPT4",53,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",54,0) . S Y=CNT("VA"),X="Total VA Admits: "_Y_TAB "RTN","EDPRPT4",55,0) . S X=X_"Total VA Admit Delay over Six Hours: "_CNT("VADEL6") "RTN","EDPRPT4",56,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",57,0) . S X="Average VA Admit Decision Time: "_$S(Y:$$ETIME^EDPRPT(MIN("VADEC")\Y),1:0)_TAB "RTN","EDPRPT4",58,0) . S X=X_"Average VA Admit Delay Time: "_$S(Y:$$ETIME^EDPRPT(MIN("VADEL")\Y),1:0) "RTN","EDPRPT4",59,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",60,0) . S Y=CNT("DEC"),X="Average All Admit Decision Time: "_$S(Y:$$ETIME^EDPRPT(MIN("DEC")\Y),1:0) "RTN","EDPRPT4",61,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",62,0) . S X=TAB_TAB_"Delay Chart" D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",63,0) . S X=TAB_TAB_"Acuity"_TAB_"None"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total" "RTN","EDPRPT4",64,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPT4",65,0) . S DEL=0 F S DEL=$O(CNT(DEL)) Q:+DEL'=DEL D "RTN","EDPRPT4",66,0) .. S X=$$ENAME^EDPRPT(DEL) Q:X="" Q:X?1." " S X=TAB_TAB_X ;novalue "RTN","EDPRPT4",67,0) .. F I="none","one","two","three","four","five" S X=X_TAB_+$G(CNT(DEL,I)) "RTN","EDPRPT4",68,0) .. S X=X_TAB_CNT(DEL) D ADD^EDPCSV(X) "RTN","EDPRPT4",69,0) D5 ; or return counts and averages as XML "RTN","EDPRPT4",70,0) D XML^EDPX("") "RTN","EDPRPT4",71,0) S X="" "RTN","EDPRPT4",76,0) D XML^EDPX(X) "RTN","EDPRPT4",77,0) S Y=CNT-CNT("VA") "RTN","EDPRPT4",78,0) S X="" "RTN","EDPRPT4",79,0) D XML^EDPX(X) "RTN","EDPRPT4",80,0) S Y=CNT("VA"),X="" "RTN","EDPRPT4",84,0) D XML^EDPX(X) "RTN","EDPRPT4",85,0) D XML^EDPX("") "RTN","EDPRPT4",86,0) D XML^EDPX("") "RTN","EDPRPT4",87,0) S DEL=0 F S DEL=$O(CNT(DEL)) Q:+DEL'=DEL D "RTN","EDPRPT4",88,0) . S X=$$ENAME^EDPRPT(DEL) Q:X="" Q:X?1." " ;novalue "RTN","EDPRPT4",89,0) . S CNT(DEL,"reason")=X,CNT(DEL,"total")=CNT(DEL) "RTN","EDPRPT4",90,0) . F I="none","one","two","three","four","five" S CNT(DEL,I)=+$G(CNT(DEL,I)) "RTN","EDPRPT4",91,0) . K ROW M ROW=CNT(DEL) "RTN","EDPRPT4",92,0) . S X=$$XMLA^EDPX("delay",.ROW) D XML^EDPX(X) "RTN","EDPRPT4",93,0) D XML^EDPX("") "RTN","EDPRPT4",94,0) Q "RTN","EDPRPT4",95,0) ; "RTN","EDPRPT4",96,0) INIT ; Initialize counters and sums "RTN","EDPRPT4",97,0) N I S (CNT,MIN)=0 "RTN","EDPRPT4",98,0) F I="DEC","VA","VA6","VADEL6","6+","23+","OBS" S CNT(I)=0 "RTN","EDPRPT4",99,0) F I="DEC","VA","VADEC","VADEL" S MIN(I)=0 "RTN","EDPRPT4",100,0) Q "RTN","EDPRPT4",101,0) ; "RTN","EDPRPT4",102,0) ECODE(IEN) ; Return external value for an Acuity code "RTN","EDPRPT4",103,0) N X,Y S X=$P($G(^EDPB(233.1,+IEN,0)),U,3) ;code "RTN","EDPRPT4",104,0) S Y=$S(X="":"none",X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"X") "RTN","EDPRPT4",105,0) Q Y "RTN","EDPRPT4",106,0) ; "RTN","EDPRPT4",107,0) OBS(IEN) ; Return 1 or 0, if status IEN indicates Observation "RTN","EDPRPT4",108,0) I $G(IEN),$P($G(^EDPB(233.1,+IEN,0)),U,5)["O" Q 1 "RTN","EDPRPT4",109,0) Q 0 "RTN","EDPRPT5") 0^17^B35383693 "RTN","EDPRPT5",1,0) EDPRPT5 ;SLC/MKB - Shift Report "RTN","EDPRPT5",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT5",3,0) ; "RTN","EDPRPT5",4,0) SFT(DAY) ; Get Shift Report for EDPSITE on DAY "RTN","EDPRPT5",5,0) N BEG,END,IN,OUT,LOG,X,X0,X1,X3,X4,S,SOUT,SHIFT "RTN","EDPRPT5",6,0) N CNT,VA,DX,OTH,HR6,TRG,OCB,MO,DIE,UNK,PREV,NEXT,SUB "RTN","EDPRPT5",7,0) N ELAPSE,ADMDEC,STS,DISP,COL "RTN","EDPRPT5",8,0) D INIT ;set counters to 0, SHIFT(#) = start time in seconds "RTN","EDPRPT5",9,0) I 'SHIFT D ERR^EDPRPT(2300013) Q "RTN","EDPRPT5",10,0) S BEG=$S(SHIFT(1)>0:$$FMADD^XLFDT(DAY,-1,,,SHIFT(SHIFT)),1:DAY) "RTN","EDPRPT5",11,0) S END=$S(SHIFT(1)>0:$$FMADD^XLFDT(DAY,,,,SHIFT(SHIFT)),1:DAY_".2359") "RTN","EDPRPT5",12,0) S IN=BEG-.000001 F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END D "RTN","EDPRPT5",13,0) . S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT5",14,0) .. S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0)) "RTN","EDPRPT5",15,0) .. S STS=$$ECODE^EDPRPT($P(X3,U,2)) "RTN","EDPRPT5",16,0) .. S DISP=$$ECODE^EDPRPT($P(X1,U,2)),DISP=$$UP^XLFSTR(DISP) "RTN","EDPRPT5",17,0) .. S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPT5",18,0) .. S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) ;#min "RTN","EDPRPT5",19,0) .. S ADMDEC=$$ADMIT^EDPRPT(LOG) "RTN","EDPRPT5",20,0) D1 .. ; all visits "RTN","EDPRPT5",21,0) .. S S=$$SHIFT(IN,1),SOUT=$$SHIFT(OUT,1) "RTN","EDPRPT5",22,0) .. S CNT(S)=CNT(S)+1 "RTN","EDPRPT5",23,0) .. S:'$P(X3,U,3) TRG(S)=TRG(S)+1 "RTN","EDPRPT5",24,0) .. S:ELAPSE>359 HR6(S)=HR6(S)+1 "RTN","EDPRPT5",25,0) .. S:DISP="O"!(DISP="NVA") OTH(S)=OTH(S)+1 "RTN","EDPRPT5",26,0) .. S:DISP="D" DIE(S)=DIE(S)+1 "RTN","EDPRPT5",27,0) .. S:$$MISSEDOP^EDPRPT3(DISP) MO(S)=MO(S)+1 "RTN","EDPRPT5",28,0) .. S:DISP="" UNK(S)=UNK(S)+1 "RTN","EDPRPT5",29,0) .. I $L(STS),$$UP^XLFSTR(STS)'="GONE",S'=SOUT S OCB(S)=OCB(S)+1 "RTN","EDPRPT5",30,0) D2 S OUT=BEG-.000001 F S OUT=$O(^EDP(230,"ATO",EDPSITE,OUT)) Q:'OUT Q:OUT>END D "RTN","EDPRPT5",31,0) . S LOG=0 F S LOG=+$O(^EDP(230,"ATO",EDPSITE,OUT,LOG)) Q:LOG<1 D "RTN","EDPRPT5",32,0) .. S X0=^EDP(230,LOG,0),X1=$G(^(1)) "RTN","EDPRPT5",33,0) .. S SOUT=$$SHIFT(OUT,1),DX(SOUT)=DX(SOUT)+1 "RTN","EDPRPT5",34,0) .. S IN=$P(X0,U,8) S:INBEG,$$VADMIT^EDPRPT2(DISP) S S=$$SHIFT(ADMDEC,1),VA(S)=VA(S)+1 "RTN","EDPRPT5",38,0) D3 ; calculate #carried over "RTN","EDPRPT5",39,0) S S=SUB(SHIFT),NEXT(S)=PREV+CNT(S)-DX(S) "RTN","EDPRPT5",40,0) S PREV("one")=NEXT(S),PREV(S)=PREV "RTN","EDPRPT5",41,0) F I=1:1:(SHIFT-1) S S=SUB(I),X=SUB($S(I>1:I-1,1:SHIFT)),NEXT(S)=NEXT(X)+CNT(S)-DX(S) "RTN","EDPRPT5",42,0) F I=2:1:(SHIFT-1) S PREV(SUB(I))=NEXT(SUB(I-1)) "RTN","EDPRPT5",43,0) ;S NEXT("three")=PREV+CNT("three")-DX("three") "RTN","EDPRPT5",44,0) ;S NEXT("one")=NEXT("three")+CNT("one")-DX("one") "RTN","EDPRPT5",45,0) ;S NEXT("two")=NEXT("one")+CNT("two")-DX("two") "RTN","EDPRPT5",46,0) ;S PREV("one")=NEXT("three"),PREV("two")=NEXT("one"),PREV("three")=PREV "RTN","EDPRPT5",47,0) D4 ; return column info "RTN","EDPRPT5",48,0) F I=1:1:SHIFT D ;convert #seconds to HH[:MM] "RTN","EDPRPT5",49,0) . N X,Y S X=SHIFT(I),Y=X\60 "RTN","EDPRPT5",50,0) . ;S Y=X\3600 S:Y=0 Y=12 S:Y>12 Y=Y-12 "RTN","EDPRPT5",51,0) . S SHIFT(I)=$$ETIME^EDPRPT(Y) ;Y_$S(X#3600:":"_(X#3600)\60,1:"") "RTN","EDPRPT5",52,0) F I=1:1:SHIFT D ;build column captions "RTN","EDPRPT5",53,0) . S COL(I,"name")=SHIFT(I)_" to "_SHIFT($S(I+1>SHIFT:1,1:I+1)) "RTN","EDPRPT5",54,0) . S COL(I,"shiftId")=SUB(I) "RTN","EDPRPT5",55,0) ;S COL(1,"name")="7 to 3",COL(1,"shiftId")="one" "RTN","EDPRPT5",56,0) ;S COL(2,"name")="3 to 11",COL(2,"shiftId")="two" "RTN","EDPRPT5",57,0) ;S COL(3,"name")="11 to 7",COL(3,"shiftId")="three" "RTN","EDPRPT5",58,0) I $G(CSV) D CSV Q "RTN","EDPRPT5",59,0) D XML^EDPX("") "RTN","EDPRPT5",60,0) F S=1:1:SHIFT K X M X=COL(S) S X=$$XMLA^EDPX("column",.X) D XML^EDPX(X) "RTN","EDPRPT5",61,0) D XML^EDPX("") "RTN","EDPRPT5",62,0) D5 ; return counts and averages as XML "RTN","EDPRPT5",63,0) D XML^EDPX("") "RTN","EDPRPT5",64,0) S X=$$XMLA^EDPX("category",.PREV) D XML^EDPX(X) "RTN","EDPRPT5",65,0) S X=$$XMLA^EDPX("category",.CNT) D XML^EDPX(X) "RTN","EDPRPT5",66,0) S X=$$XMLA^EDPX("category",.DX) D XML^EDPX(X) "RTN","EDPRPT5",67,0) S X=$$XMLA^EDPX("category",.VA) D XML^EDPX(X) "RTN","EDPRPT5",68,0) S X=$$XMLA^EDPX("category",.OTH) D XML^EDPX(X) "RTN","EDPRPT5",69,0) S X=$$XMLA^EDPX("category",.HR6) D XML^EDPX(X) "RTN","EDPRPT5",70,0) S X=$$XMLA^EDPX("category",.TRG) D XML^EDPX(X) "RTN","EDPRPT5",71,0) S X=$$XMLA^EDPX("category",.OCB) D XML^EDPX(X) "RTN","EDPRPT5",72,0) S X=$$XMLA^EDPX("category",.MO) D XML^EDPX(X) "RTN","EDPRPT5",73,0) S X=$$XMLA^EDPX("category",.DIE) D XML^EDPX(X) "RTN","EDPRPT5",74,0) S X=$$XMLA^EDPX("category",.UNK) D XML^EDPX(X) "RTN","EDPRPT5",75,0) S X=$$XMLA^EDPX("category",.NEXT) D XML^EDPX(X) "RTN","EDPRPT5",76,0) D XML^EDPX("") "RTN","EDPRPT5",77,0) Q "RTN","EDPRPT5",78,0) ; "RTN","EDPRPT5",79,0) CSV ; Return headers, counts and averages as CSV "RTN","EDPRPT5",80,0) N X,TAB S TAB=$C(9) "RTN","EDPRPT5",81,0) S X="Category"_TAB_COL(SHIFT,"name") "RTN","EDPRPT5",82,0) F I=1:1:(SHIFT-1) S X=X_TAB_COL(I,"name") "RTN","EDPRPT5",83,0) D ADD^EDPCSV(X) ;headers "RTN","EDPRPT5",84,0) D ROW("Carried over at Report Start",.PREV) "RTN","EDPRPT5",85,0) D ROW("Number of New Patients",.CNT) "RTN","EDPRPT5",86,0) D ROW("Number of Patients Discharged",.DX) "RTN","EDPRPT5",87,0) D ROW("Number Dec to Admit to VA",.VA) "RTN","EDPRPT5",88,0) D ROW("Number Dec to Admit to Other",.OTH) "RTN","EDPRPT5",89,0) D ROW("Number over Six Hours",.HR6) "RTN","EDPRPT5",90,0) D ROW("Number Waiting for Triage",.TRG) "RTN","EDPRPT5",91,0) D ROW("Number of Occupied Beds",.OCB) "RTN","EDPRPT5",92,0) D ROW("Number of Missed Opportunities",.MO) "RTN","EDPRPT5",93,0) D ROW("Number Deceased",.DIE) "RTN","EDPRPT5",94,0) D ROW("Number With No Disposition",.UNK) "RTN","EDPRPT5",95,0) D ROW("Carry over to Next Shift",.NEXT) "RTN","EDPRPT5",96,0) Q "RTN","EDPRPT5",97,0) ; "RTN","EDPRPT5",98,0) ROW(NAME,LIST) ; add row "RTN","EDPRPT5",99,0) N S,I "RTN","EDPRPT5",100,0) S S=SUB(SHIFT),X=NAME_TAB_LIST(S) "RTN","EDPRPT5",101,0) F I=1:1:(SHIFT-1) S S=SUB(I),X=X_TAB_LIST(S) "RTN","EDPRPT5",102,0) D ADD^EDPCSV(X) "RTN","EDPRPT5",103,0) Q "RTN","EDPRPT5",104,0) ; "RTN","EDPRPT5",105,0) INIT ; Initialize counters and sums "RTN","EDPRPT5",106,0) N I,S "RTN","EDPRPT5",107,0) S PREV=0,DAY=$P(DAY,".") "RTN","EDPRPT5",108,0) D SETUP F I=1:1:SHIFT D "RTN","EDPRPT5",109,0) . S S=$$WORD(I),SUB(I)=S "RTN","EDPRPT5",110,0) . S CNT(S)=0,CNT("category")="Number of New Patients" "RTN","EDPRPT5",111,0) . S DX(S)=0,DX("category")="Number of Patients Discharged" "RTN","EDPRPT5",112,0) . S VA(S)=0,VA("category")="Number Dec to Admit to VA" "RTN","EDPRPT5",113,0) . S OTH(S)=0,OTH("category")="Number Dec to Admit to Other" "RTN","EDPRPT5",114,0) . S HR6(S)=0,HR6("category")="Number over Six Hours" "RTN","EDPRPT5",115,0) . S TRG(S)=0,TRG("category")="Number Waiting for Triage" ;no acuity "RTN","EDPRPT5",116,0) . S OCB(S)=0,OCB("category")="Number of Occupied Beds" "RTN","EDPRPT5",117,0) . S MO(S)=0,MO("category")="Number of Missed Opportunities" "RTN","EDPRPT5",118,0) . S DIE(S)=0,DIE("category")="Number Deceased" "RTN","EDPRPT5",119,0) . S UNK(S)=0,UNK("category")="Number With No Disposition" "RTN","EDPRPT5",120,0) . S PREV(S)=0,PREV("category")="Carried over at Report Start" "RTN","EDPRPT5",121,0) . S NEXT(S)=0,NEXT("category")="Carry over to Next Shift" "RTN","EDPRPT5",122,0) Q "RTN","EDPRPT5",123,0) ; "RTN","EDPRPT5",124,0) WORD(X) ; Return name of number X "RTN","EDPRPT5",125,0) N Y S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",X=6:"six",X=7:"seven",X=8:"eight",X=9:"nine",X=10:"ten",X=11:"eleven",X=12:"twelve",1:"none") "RTN","EDPRPT5",126,0) Q Y "RTN","EDPRPT5",127,0) ; "RTN","EDPRPT5",128,0) SETUP ; Create SHIFT(#) list of shift times "RTN","EDPRPT5",129,0) N TA,X1,X,DUR "RTN","EDPRPT5",130,0) S TA=+$O(^EDPB(231.9,"C",EDPSITE,0)),X1=$G(^EDPB(231.9,TA,1)) "RTN","EDPRPT5",131,0) S X=$P(X1,U,6),DUR=$P(X1,U,7)*60 I DUR'>0 S SHIFT=0 Q "RTN","EDPRPT5",132,0) S SHIFT=1,SHIFT(1)=X*60 ;seconds "RTN","EDPRPT5",133,0) F S X=SHIFT(SHIFT)+DUR Q:X>86340 S SHIFT=SHIFT+1,SHIFT(SHIFT)=X "RTN","EDPRPT5",134,0) Q "RTN","EDPRPT5",135,0) ; "RTN","EDPRPT5",136,0) SHIFT(X,TXT) ; Return shift # for time X using SHIFT(#) "RTN","EDPRPT5",137,0) I $G(X)="" Q 0 "RTN","EDPRPT5",138,0) N TM,Y "RTN","EDPRPT5",139,0) S TM=$P($$FMTH^XLFDT(X),",",2) ;#seconds since midnight "RTN","EDPRPT5",140,0) I TM=SHIFT(SHIFT)) S Y=SHIFT "RTN","EDPRPT5",141,0) E F I=2:1:SHIFT I TMEND S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT6",10,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0)) "RTN","EDPRPT6",11,0) . S MD=$P(X3,U,5) Q:MD<1 ;no provider "RTN","EDPRPT6",12,0) . S DISP=$P(X1,U,3),ACU=$$ACUITY($P(X3,U,3)) "RTN","EDPRPT6",13,0) . S MDTIME=$$MD^EDPRPT(LOG) "RTN","EDPRPT6",14,0) . D:'$D(CNT(MD)) INIT(MD) ;set counters,sums to 0 per provider "RTN","EDPRPT6",15,0) D1 . ; all visits "RTN","EDPRPT6",16,0) . S S=$$SHIFT^EDPRPT5(MDTIME) "RTN","EDPRPT6",17,0) . S CNT(MD)=CNT(MD)+1,CNT(MD,S,ACU)=CNT(MD,S,ACU)+1 "RTN","EDPRPT6",18,0) . S IN2MD=$$FMDIFF^XLFDT(MDTIME,IN,2)\60 "RTN","EDPRPT6",19,0) . S IN2MD(MD)=IN2MD(MD)+IN2MD,IN2MD(MD,S,ACU)=IN2MD(MD,S,ACU)+IN2MD "RTN","EDPRPT6",20,0) . S MD2DS=$S(DISP:$$FMDIFF^XLFDT(DISP,MDTIME,2)\60,1:0) "RTN","EDPRPT6",21,0) . S MD2DS(MD)=MD2DS(MD)+MD2DS,MD2DS(MD,S,ACU)=MD2DS(MD,S,ACU)+MD2DS "RTN","EDPRPT6",22,0) D2 ; calculate & return averages as CSV "RTN","EDPRPT6",23,0) I $G(CSV) D Q "RTN","EDPRPT6",24,0) . N TAB,NM,SFT S TAB=$C(9) "RTN","EDPRPT6",25,0) . S X="MD Name"_TAB_"Shift"_TAB_"Acuity"_TAB_"# Patients"_TAB_"Time In to MD Assigned"_TAB_"MD Assign to Dispo" "RTN","EDPRPT6",26,0) . D ADD^EDPCSV(X) "RTN","EDPRPT6",27,0) . S MD=0 F S MD=$O(CNT(MD)) Q:MD<1 I CNT(MD) D "RTN","EDPRPT6",28,0) .. S NM=$$EPERS^EDPRPT(MD) F S=1:1:SHIFT D "RTN","EDPRPT6",29,0) ... S SFT=S F ACU=0:1:5 I CNT(MD,S,ACU) D "RTN","EDPRPT6",30,0) .... S X=NM_TAB_SFT_TAB_ACU_TAB_CNT(MD,S,ACU) "RTN","EDPRPT6",31,0) .... S X=X_TAB_$$ETIME^EDPRPT(IN2MD(MD,S,ACU)\CNT(MD,S,ACU)) "RTN","EDPRPT6",32,0) .... S X=X_TAB_$$ETIME^EDPRPT(MD2DS(MD,S,ACU)\CNT(MD,S,ACU)) "RTN","EDPRPT6",33,0) .... D ADD^EDPCSV(X) S (NM,SFT)="" "RTN","EDPRPT6",34,0) .. S X=" MD TOTALS"_TAB_TAB_TAB_CNT(MD) "RTN","EDPRPT6",35,0) .. S X=X_TAB_$$ETIME^EDPRPT(IN2MD(MD)\CNT(MD)) "RTN","EDPRPT6",36,0) .. S X=X_TAB_$$ETIME^EDPRPT(MD2DS(MD)\CNT(MD)) "RTN","EDPRPT6",37,0) .. D ADD^EDPCSV(X) "RTN","EDPRPT6",38,0) D3 ; or as XML "RTN","EDPRPT6",39,0) D XML^EDPX("") "RTN","EDPRPT6",40,0) S MD=0 F S MD=$O(CNT(MD)) Q:MD<1 I CNT(MD) D "RTN","EDPRPT6",41,0) . K ROW S ROW("name")=$$EPERS^EDPRPT(MD),ROW("total")=CNT(MD) "RTN","EDPRPT6",42,0) . S ROW("timeMD")=$$ETIME^EDPRPT(IN2MD(MD)\CNT(MD)) "RTN","EDPRPT6",43,0) . S ROW("timeDisp")=$$ETIME^EDPRPT(MD2DS(MD)\CNT(MD)) "RTN","EDPRPT6",44,0) . S X=$$XMLA^EDPX("md",.ROW),X=$TR(X,"/") D XML^EDPX(X) "RTN","EDPRPT6",45,0) . D XML^EDPX("") "RTN","EDPRPT6",46,0) . F S=1:1:SHIFT D "RTN","EDPRPT6",47,0) .. F ACU=0:1:5 I CNT(MD,S,ACU) D "RTN","EDPRPT6",48,0) ... K ROW S ROW("total")=CNT(MD,S,ACU) "RTN","EDPRPT6",49,0) ... S ROW("number")=S,ROW("acuity")=ACU "RTN","EDPRPT6",50,0) ... S ROW("timeMD")=$$ETIME^EDPRPT(IN2MD(MD,S,ACU)\CNT(MD,S,ACU)) "RTN","EDPRPT6",51,0) ... S ROW("timeDisp")=$$ETIME^EDPRPT(MD2DS(MD,S,ACU)\CNT(MD,S,ACU)) "RTN","EDPRPT6",52,0) ... S X=$$XMLA^EDPX("shift",.ROW) D XML^EDPX(X) "RTN","EDPRPT6",53,0) . D XML^EDPX(""),XML^EDPX("") "RTN","EDPRPT6",54,0) D XML^EDPX("") "RTN","EDPRPT6",55,0) Q "RTN","EDPRPT6",56,0) ; "RTN","EDPRPT6",57,0) INIT(DR) ; Initialize counters and sums "RTN","EDPRPT6",58,0) N S,A "RTN","EDPRPT6",59,0) S (CNT(DR),IN2MD(DR),MD2DS(DR))=0 "RTN","EDPRPT6",60,0) F S=1:1:SHIFT D "RTN","EDPRPT6",61,0) . F A=0:1:5 S (CNT(DR,S,A),IN2MD(DR,S,A),MD2DS(DR,S,A))=0 "RTN","EDPRPT6",62,0) Q "RTN","EDPRPT6",63,0) ; "RTN","EDPRPT6",64,0) ACUITY(IEN) ; Return external value [0-5] for an Acuity code "RTN","EDPRPT6",65,0) N X0,Y S X0=$G(^EDPB(233.1,+IEN,0)) "RTN","EDPRPT6",66,0) S Y=$P(X0,U,3) S:Y<1 Y=+$P(X0,U,4) ;code or nat'l code "RTN","EDPRPT6",67,0) Q Y "RTN","EDPRPT7") 0^19^B19582712 "RTN","EDPRPT7",1,0) EDPRPT7 ;SLC/MKB - Exposure Report "RTN","EDPRPT7",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT7",3,0) ; "RTN","EDPRPT7",4,0) EXP(IEN) ; Get Exposure Report for IEN at EDPSITE "RTN","EDPRPT7",5,0) S IEN=+$G(IEN) Q:IEN<1 Q:'$D(^EDP(230,IEN,0)) "RTN","EDPRPT7",6,0) I $G(CSV) D EXP^EDPRPT7C(IEN) Q ;CSV format instead "RTN","EDPRPT7",7,0) N BEG,END,LIST,LOG,IN,OUT,X,X0,Y,RLIST,TREAT,OTHER,MD,RN,RES,I,J,RIN,ROUT "RTN","EDPRPT7",8,0) N SHIFT D SETUP^EDPRPT5 ;build SHIFT(#) "RTN","EDPRPT7",9,0) I 'SHIFT D ERR^EDPRPT(2300013) Q "RTN","EDPRPT7",10,0) S X0=^EDP(230,IEN,0),BEG=$P(X0,U,8),END=$P(X0,U,9) "RTN","EDPRPT7",11,0) S:'BEG BEG=$P(X0,U) S:'END END=$$NOW^EDPRPT "RTN","EDPRPT7",12,0) D ROOMS(IEN,END) "RTN","EDPRPT7",13,0) ; put IEN info into XML "RTN","EDPRPT7",14,0) D XML^EDPX("") "RTN","EDPRPT7",15,0) D ADD(IEN),STAFF(IEN) "RTN","EDPRPT7",16,0) D XML^EDPX("") "RTN","EDPRPT7",17,0) E1 ; look for patients also in ED between BEG and END "RTN","EDPRPT7",18,0) D FIND(BEG,END) ;create LIST(#) list of ien's to check "RTN","EDPRPT7",19,0) S LOG=0 F S LOG=+$O(LIST(LOG)) Q:'LOG I LOG'=IEN D "RTN","EDPRPT7",20,0) . S X0=$G(^EDP(230,LOG,0)),IN=$P(X0,U,8),OUT=$P(X0,U,9) "RTN","EDPRPT7",21,0) . D ROOMS(LOG,OUT) "RTN","EDPRPT7",22,0) . ; compare treatment rooms "RTN","EDPRPT7",23,0) . S I=0 F S I=$O(RLIST(IEN,I)) Q:I<1 D "RTN","EDPRPT7",24,0) .. S RIN=$P(RLIST(IEN,I),U,2),ROUT=$P(RLIST(IEN,I),U,3) "RTN","EDPRPT7",25,0) .. S J=0 F S J=$O(RLIST(LOG,J)) Q:J<1 I +RLIST(IEN,I)=+RLIST(LOG,J) D "RTN","EDPRPT7",26,0) ... S X=$P(RLIST(LOG,J),U,2) Q:X>ROUT ;in to room after IEN left "RTN","EDPRPT7",27,0) ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q "RTN","EDPRPT7",28,0) ... S X=$P(RLIST(LOG,J),U,3) Q:X&(X") "RTN","EDPRPT7",35,0) . S LOG=0 F S LOG=$O(TREAT(LOG)) Q:LOG<1 D ADD(LOG),STAFF(LOG) "RTN","EDPRPT7",36,0) . D XML^EDPX("") "RTN","EDPRPT7",37,0) ; return other ED patients "RTN","EDPRPT7",38,0) I $O(OTHER(0)) D "RTN","EDPRPT7",39,0) . D XML^EDPX("") "RTN","EDPRPT7",40,0) . S LOG=0 F S LOG=$O(OTHER(LOG)) Q:LOG<1 D ADD(LOG),STAFF(LOG) "RTN","EDPRPT7",41,0) . D XML^EDPX("") "RTN","EDPRPT7",42,0) E3 ; return staff on duty "RTN","EDPRPT7",43,0) D XML^EDPX("") "RTN","EDPRPT7",44,0) I $O(MD(0)) D "RTN","EDPRPT7",45,0) . D XML^EDPX("") "RTN","EDPRPT7",46,0) . S I=0 F S I=$O(MD(I)) Q:I<1 D "RTN","EDPRPT7",47,0) .. S X="" "RTN","EDPRPT7",48,0) .. D XML^EDPX(X) "RTN","EDPRPT7",49,0) . D XML^EDPX("") "RTN","EDPRPT7",50,0) I $O(RN(0)) D "RTN","EDPRPT7",51,0) . D XML^EDPX("") "RTN","EDPRPT7",52,0) . S I=0 F S I=$O(RN(I)) Q:I<1 D "RTN","EDPRPT7",53,0) .. S X="" "RTN","EDPRPT7",54,0) .. D XML^EDPX(X) "RTN","EDPRPT7",55,0) . D XML^EDPX("") "RTN","EDPRPT7",56,0) I $O(RES(0)) D "RTN","EDPRPT7",57,0) . D XML^EDPX("") "RTN","EDPRPT7",58,0) . S I=0 F S I=$O(RES(I)) Q:I<1 D "RTN","EDPRPT7",59,0) .. S X="" "RTN","EDPRPT7",60,0) .. D XML^EDPX(X) "RTN","EDPRPT7",61,0) . D XML^EDPX("") "RTN","EDPRPT7",62,0) D XML^EDPX("") "RTN","EDPRPT7",63,0) Q "RTN","EDPRPT7",64,0) ; "RTN","EDPRPT7",65,0) FIND(IN,OUT) ; create LIST(#) of visits at same time "RTN","EDPRPT7",66,0) N TIME,I,X K LIST "RTN","EDPRPT7",67,0) S TIME=+$P(IN,".") ;ck today's arrivals "RTN","EDPRPT7",68,0) F S TIME=$O(^EDP(230,"ATI",EDPSITE,TIME)) Q:TIME<1!(TIME>OUT) D "RTN","EDPRPT7",69,0) . S I=0 F S I=$O(^EDP(230,"ATI",EDPSITE,TIME,I)) Q:I<1 D "RTN","EDPRPT7",70,0) .. S X=$P($G(^EDP(230,I,0)),U,9) I X,XROUT ;in to room after IEN left "RTN","EDPRPT7C",29,0) ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q "RTN","EDPRPT7C",30,0) ... S X=$P(RLIST(LOG,J),U,3) Q:X&(XMAX MAX=+MD S:$G(RES)>MAX MAX=+RES "RTN","EDPRPT7C",48,0) S MORE=1,(MD,RN,RES)=0 F D Q:'MORE "RTN","EDPRPT7C",49,0) . S:MD'="" MD=$O(MD(MD)) S:RN'="" RN=$O(RN(RN)) "RTN","EDPRPT7C",50,0) . S:RES'="" RES=$O(RES(RES)) ;get next "RTN","EDPRPT7C",51,0) . I MD="",RN="",RES="" S MORE=0 Q ;done "RTN","EDPRPT7C",52,0) . S X=TAB_$S(MD:MD(MD),1:"")_TAB_$S(RN:RN(RN),1:"")_TAB_$S(RES:RES(RES),1:"") "RTN","EDPRPT7C",53,0) . D ADD^EDPCSV(X) "RTN","EDPRPT7C",54,0) Q "RTN","EDPRPT7C",55,0) ; "RTN","EDPRPT7C",56,0) FIND(IN,OUT) ; create LIST(#) of visits at same time "RTN","EDPRPT7C",57,0) N TIME,I,X K LIST "RTN","EDPRPT7C",58,0) S TIME=+$P(IN,".") ;ck today's arrivals "RTN","EDPRPT7C",59,0) F S TIME=$O(^EDP(230,"ATI",EDPSITE,TIME)) Q:TIME<1!(TIME>OUT) D "RTN","EDPRPT7C",60,0) . S I=0 F S I=$O(^EDP(230,"ATI",EDPSITE,TIME,I)) Q:I<1 D "RTN","EDPRPT7C",61,0) .. S X=$P($G(^EDP(230,I,0)),U,9) I X,XEND S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT8",13,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0)) "RTN","EDPRPT8",14,0) . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),ACU=$$ECODE($P(X3,U,3)) "RTN","EDPRPT8",15,0) . S CNT=CNT+1,CNT(ACU)=CNT(ACU)+1 "RTN","EDPRPT8",16,0) . ; all admissions "RTN","EDPRPT8",17,0) . S (ADMDEC,ADMDEL)=0 "RTN","EDPRPT8",18,0) . S X=$$ADMIT^EDPRPT(LOG) I X D ;decision to admit "RTN","EDPRPT8",19,0) .. S ADM=ADM+1,ADM(ACU)=ADM(ACU)+1 "RTN","EDPRPT8",20,0) .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60 "RTN","EDPRPT8",21,0) .. S:ADMDEC MIN("DEC")=MIN("DEC")+ADMDEC,MIN("DEC",ACU)=MIN("DEC",ACU)+ADMDEC "RTN","EDPRPT8",22,0) .. S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPT8",23,0) .. S:OUT ADMDEL=$$FMDIFF^XLFDT(OUT,X,2)\60 "RTN","EDPRPT8",24,0) . I $$VADMIT^EDPRPT2(DISP) D ;VA admissions "RTN","EDPRPT8",25,0) .. S VA=VA+1,VA(ACU)=VA(ACU)+1 "RTN","EDPRPT8",26,0) .. S MIN("VADEC")=MIN("VADEC")+ADMDEC "RTN","EDPRPT8",27,0) .. S MIN("VADEC",ACU)=MIN("VADEC",ACU)+ADMDEC "RTN","EDPRPT8",28,0) .. S MIN("VADEL")=MIN("VADEL")+ADMDEL "RTN","EDPRPT8",29,0) .. S MIN("VADEL",ACU)=MIN("VADEL",ACU)+ADMDEL "RTN","EDPRPT8",30,0) A1 ; return counts and averages "RTN","EDPRPT8",31,0) S I="" F S I=$O(ADM(I)) Q:I="" D ;avg #min admit dec by acuity "RTN","EDPRPT8",32,0) . S MIN("DEC",I)=$S(ADM(I):$$ETIME^EDPRPT(MIN("DEC",I)\ADM(I)),1:0) "RTN","EDPRPT8",33,0) . S MIN("VADEC",I)=$S(VA(I):$$ETIME^EDPRPT(MIN("VADEC",I)\VA(I)),1:0) "RTN","EDPRPT8",34,0) . S MIN("VADEL",I)=$S(VA(I):$$ETIME^EDPRPT(MIN("VADEL",I)\VA(I)),1:0) "RTN","EDPRPT8",35,0) S CNT("total")=CNT,ADM("total")=ADM,VA("total")=VA "RTN","EDPRPT8",36,0) S CNT("type")="Number of Patients",ADM("type")="Number Admitted",VA("type")="Number VA Admitted" "RTN","EDPRPT8",37,0) S MIN("DEC","type")="Avg All Admit Dec Time",MIN("VADEC","type")="Avg VA Admit Dec Time",MIN("VADEL","type")="Avg VA Admit Delay Time" "RTN","EDPRPT8",38,0) S MIN("DEC","total")=$S(ADM:$$ETIME^EDPRPT(MIN("DEC")\ADM),1:0) "RTN","EDPRPT8",39,0) S MIN("VADEC","total")=$S(VA:$$ETIME^EDPRPT(MIN("VADEC")\VA),1:0) "RTN","EDPRPT8",40,0) S MIN("VADEL","total")=$S(VA:$$ETIME^EDPRPT(MIN("VADEL")\VA),1:0) "RTN","EDPRPT8",41,0) ; as CSV "RTN","EDPRPT8",42,0) I $G(CSV) D Q "RTN","EDPRPT8",43,0) . N TAB S TAB=$C(9) "RTN","EDPRPT8",44,0) . S X="Acuity->"_TAB_"0"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total/Average" "RTN","EDPRPT8",45,0) . D ADD^EDPCSV(X) "RTN","EDPRPT8",46,0) . D ROW("Number of Patients",.CNT) "RTN","EDPRPT8",47,0) . D ROW("Number Admitted",.ADM) "RTN","EDPRPT8",48,0) . D ROW("Number VA Admitted",.VA) "RTN","EDPRPT8",49,0) . M ROW=MIN("DEC") D ROW("Avg All Admit Dec Time",.ROW) K ROW "RTN","EDPRPT8",50,0) . M ROW=MIN("VADEC") D ROW("Avg VA Admit Dec Time",.ROW) K ROW "RTN","EDPRPT8",51,0) . M ROW=MIN("VADEL") D ROW("Avg VA Admit Delay Time",.ROW) K ROW "RTN","EDPRPT8",52,0) ; or as XML "RTN","EDPRPT8",53,0) D XML^EDPX("") "RTN","EDPRPT8",54,0) S X=$$XMLA^EDPX("row",.CNT) D XML^EDPX(X) "RTN","EDPRPT8",55,0) S X=$$XMLA^EDPX("row",.ADM) D XML^EDPX(X) "RTN","EDPRPT8",56,0) S X=$$XMLA^EDPX("row",.VA) D XML^EDPX(X) "RTN","EDPRPT8",57,0) M ROW=MIN("DEC") S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW "RTN","EDPRPT8",58,0) M ROW=MIN("VADEC") S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW "RTN","EDPRPT8",59,0) M ROW=MIN("VADEL") S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW "RTN","EDPRPT8",60,0) D XML^EDPX("") "RTN","EDPRPT8",61,0) Q "RTN","EDPRPT8",62,0) ; "RTN","EDPRPT8",63,0) ROW(NAME,LIST) ; add line "RTN","EDPRPT8",64,0) N I S X=NAME "RTN","EDPRPT8",65,0) F I="none","one","two","three","four","five","total" S X=X_TAB_LIST(I) "RTN","EDPRPT8",66,0) D ADD^EDPCSV(X) "RTN","EDPRPT8",67,0) Q "RTN","EDPRPT8",68,0) ; "RTN","EDPRPT8",69,0) INIT ; Initialize acuity counters "RTN","EDPRPT8",70,0) N X S (CNT,ADM,VA)=0 "RTN","EDPRPT8",71,0) F X="none","one","two","three","four","five" D "RTN","EDPRPT8",72,0) . S (CNT(X),ADM(X),VA(X),MIN("DEC",X),MIN("VADEC",X),MIN("VADEL",X))=0 "RTN","EDPRPT8",73,0) F X="DEC","VADEC","VADEL" S MIN(X)=0 "RTN","EDPRPT8",74,0) Q "RTN","EDPRPT8",75,0) ; "RTN","EDPRPT8",76,0) ECODE(IEN) ; Return external value for an Acuity code "RTN","EDPRPT8",77,0) N X0,X,Y S X0=$G(^EDPB(233.1,+IEN,0)) "RTN","EDPRPT8",78,0) S X=$P(X0,U,3) S:X<1 X=$P(X0,U,4) ;code or nat'l code "RTN","EDPRPT8",79,0) S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"none") "RTN","EDPRPT8",80,0) Q Y "RTN","EDPRPT9") 0^22^B1592058 "RTN","EDPRPT9",1,0) EDPRPT9 ;SLC/MKB - Patient Xref Report "RTN","EDPRPT9",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPT9",3,0) ; "RTN","EDPRPT9",4,0) XRF(BEG,END) ; Get Patient Xref Report for EDPSITE by date range "RTN","EDPRPT9",5,0) ; CNT = counters "RTN","EDPRPT9",6,0) N IN,LOG,DFN,ID,X,ROW,TAB "RTN","EDPRPT9",7,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPT9",8,0) . S TAB=$C(9),X="ED"_TAB_"Patient ID"_TAB_"Patient DFN" "RTN","EDPRPT9",9,0) . D ADD^EDPCSV(X) "RTN","EDPRPT9",10,0) S IN=BEG-.000001 "RTN","EDPRPT9",11,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPT9",12,0) . S DFN=$P($G(^EDP(230,LOG,0)),U,6),ID=$P($G(^(0)),U,11) Q:DFN<1 "RTN","EDPRPT9",13,0) . I $G(CSV) S X=LOG_TAB_ID_TAB_DFN D ADD^EDPCSV(X) Q "RTN","EDPRPT9",14,0) . K ROW S ROW("id")=LOG "RTN","EDPRPT9",15,0) . S ROW("patientDfn")=DFN "RTN","EDPRPT9",16,0) . S ROW("patientId")=ID "RTN","EDPRPT9",17,0) . S X=$$XMLA^EDPX("patient",.ROW) D XML^EDPX(X) "RTN","EDPRPT9",18,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPT9",19,0) Q "RTN","EDPRPTBV") 0^51^B21129991 "RTN","EDPRPTBV",1,0) EDPRPTBV ;SLC/MKB - BVAC Report "RTN","EDPRPTBV",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPRPTBV",3,0) ; "RTN","EDPRPTBV",4,0) EN(BEG,END) ; Get Activity Report for EDPSITE by date range "RTN","EDPRPTBV",5,0) N LOG,X,X0,X1,X3,DX,IN,OUT,ROW,ICD,I "RTN","EDPRPTBV",6,0) N ELAPSE,TRIAGE,ADMDEC,ADMDEL,CNT,ADM,MIN,AVG "RTN","EDPRPTBV",7,0) D INIT ;set counters, sums to 0 "RTN","EDPRPTBV",8,0) D:'$G(CSV) XML^EDPX("") I $G(CSV) D ;headers "RTN","EDPRPTBV",9,0) . N TAB S TAB=$C(9) "RTN","EDPRPTBV",10,0) . S X="Patient"_TAB_"Time In"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Dispo"_TAB_"Admit Dec"_TAB_"Admit Delay"_TAB_"Diagnosis"_TAB_"ICD9" "RTN","EDPRPTBV",11,0) . S X=X_TAB_"Viet Vet"_TAB_"Agent Orange"_TAB_"OEF/OIF"_TAB_"Pers Gulf"_TAB_"VA Pension"_TAB_"POW"_TAB_"Serv Conn %"_TAB_"Purp Hrt"_TAB_"Unemploy"_TAB_"Combat End" "RTN","EDPRPTBV",12,0) . D ADD^EDPCSV(X) "RTN","EDPRPTBV",13,0) S IN=BEG-.000001 "RTN","EDPRPTBV",14,0) F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D "RTN","EDPRPTBV",15,0) . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)) "RTN","EDPRPTBV",16,0) . S DX=$$BVAC(+$P(X0,U,3),LOG) Q:DX="" ;no codes in range "RTN","EDPRPTBV",17,0) . S CNT=CNT+1,OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW "RTN","EDPRPTBV",18,0) . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) "RTN","EDPRPTBV",19,0) . S MIN("elapsed")=MIN("elapsed")+ELAPSE "RTN","EDPRPTBV",20,0) . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT "RTN","EDPRPTBV",21,0) . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPTBV",22,0) . S MIN("triage")=MIN("triage")+TRIAGE "RTN","EDPRPTBV",23,0) . S (ADMDEC,ADMDEL)="" "RTN","EDPRPTBV",24,0) . S X=$$ADMIT^EDPRPT(LOG) I X S ADM=ADM+1 D ;decision to admit "RTN","EDPRPTBV",25,0) .. S ADMDEC=($$FMDIFF^XLFDT(X,IN,2)\60) "RTN","EDPRPTBV",26,0) .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0) "RTN","EDPRPTBV",27,0) .. S MIN("admDec")=MIN("admDec")+ADMDEC "RTN","EDPRPTBV",28,0) .. S MIN("admDel")=MIN("admDel")+ADMDEL "RTN","EDPRPTBV",29,0) . ; "RTN","EDPRPTBV",30,0) BV1 . ; add row to report "RTN","EDPRPTBV",31,0) . ;S ICD=$P($G(^ICD9(+$P(X4,U,2),0)),U) Q:ICD<290 Q:ICD>316 "RTN","EDPRPTBV",32,0) . K ROW S ROW("patient")=$P(X0,U,4) "RTN","EDPRPTBV",33,0) . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN) "RTN","EDPRPTBV",34,0) . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT) "RTN","EDPRPTBV",35,0) . S ROW("complaint")=$P(X1,U) "RTN","EDPRPTBV",36,0) . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5)) "RTN","EDPRPTBV",37,0) . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3)) "RTN","EDPRPTBV",38,0) . S ROW("elapsed")=ELAPSE_$S(ELAPSE>359:" *",1:"") "RTN","EDPRPTBV",39,0) . S ROW("triage")=TRIAGE "RTN","EDPRPTBV",40,0) . S ROW("disposition")=$$ECODE^EDPRPT($P(X1,U,2)) "RTN","EDPRPTBV",41,0) . S ROW("admDec")=ADMDEC,ROW("admDel")=ADMDEL "RTN","EDPRPTBV",42,0) . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2) "RTN","EDPRPTBV",43,0) . ; get other patient attributes from VADPT "RTN","EDPRPTBV",44,0) . N DFN,VAEL,VASV,VAMB,VAERR "RTN","EDPRPTBV",45,0) . S DFN=$P(X0,U,6) I DFN D 8^VADPT D "RTN","EDPRPTBV",46,0) .. S ROW("vietnam")=$S(VASV(1):"Y",1:"N") "RTN","EDPRPTBV",47,0) .. S ROW("agentOrange")=$S(VASV(2):"Y",1:"N") "RTN","EDPRPTBV",48,0) .. S ROW("iraq")=$S(VASV(11)!VASV(12)!VASV(13):"Y",1:"N") "RTN","EDPRPTBV",49,0) .. S ROW("persGulf")=$P($G(^DPT(DFN,.322)),U,10) "RTN","EDPRPTBV",50,0) .. S ROW("vaPension")=$S(VAMB(4):"Y",1:"N") "RTN","EDPRPTBV",51,0) .. S ROW("pow")=$S(VASV(4):"Y",1:"N") "RTN","EDPRPTBV",52,0) .. S ROW("servConnPct")=+$P(VAEL(3),U,2) "RTN","EDPRPTBV",53,0) .. S ROW("purpleHeart")=$S(VASV(9):"Y",1:"N") "RTN","EDPRPTBV",54,0) .. ; ROW("unemployable")=$P($G(^DGEN(27.11,DFN,"E")),U,17) ;or VAPD(7)=3^NOT EMPLOYED ?? "RTN","EDPRPTBV",55,0) .. S ROW("combatEndDT")=$P($G(VASV(10,1)),U) "RTN","EDPRPTBV",56,0) BV2 . ; "RTN","EDPRPTBV",57,0) . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q "RTN","EDPRPTBV",58,0) . S X=ROW("patient") "RTN","EDPRPTBV",59,0) . F I="inTS","outTS","complaint","md","acuity","elapsed","triage","disposition","admDec","admDel","dx","icd" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPTBV",60,0) . F I="vietnam","agentOrange","iraq","persGulf","vaPension","pow","servConn%","purpleHeart","unemployable","combatEndDT" S X=X_$C(9)_$G(ROW(I)) "RTN","EDPRPTBV",61,0) . D ADD^EDPCSV(X) "RTN","EDPRPTBV",62,0) D:'$G(CSV) XML^EDPX("") "RTN","EDPRPTBV",63,0) ; "RTN","EDPRPTBV",64,0) BV3 ; calculate & include averages "RTN","EDPRPTBV",65,0) Q:CNT<1 ;no visits found "RTN","EDPRPTBV",66,0) S ELAPSE=$$ETIME^EDPRPT(MIN("elapsed")\CNT),AVG("elapsed")=ELAPSE "RTN","EDPRPTBV",67,0) S TRIAGE=$$ETIME^EDPRPT(MIN("triage")\CNT),AVG("triage")=TRIAGE "RTN","EDPRPTBV",68,0) S ADMDEC=$S(ADM:$$ETIME^EDPRPT(MIN("admDec")\ADM),1:"00:00") "RTN","EDPRPTBV",69,0) S ADMDEL=$S(ADM:$$ETIME^EDPRPT(MIN("admDel")\ADM),1:"00:00") "RTN","EDPRPTBV",70,0) S AVG("admDec")=ADMDEC,AVG("admDel")=ADMDEL,AVG("total")=CNT "RTN","EDPRPTBV",71,0) ; "RTN","EDPRPTBV",72,0) I $G(CSV) D Q ;CSV format "RTN","EDPRPTBV",73,0) . N TAB,D S TAB=$C(9) "RTN","EDPRPTBV",74,0) . D BLANK^EDPCSV "RTN","EDPRPTBV",75,0) . S X=TAB_"Total Patients"_TAB_CNT_TAB_"Averages Per Patient"_TAB_TAB_TAB_ELAPSE_TAB_TRIAGE_TAB_ADMDEC_TAB_ADMDEL "RTN","EDPRPTBV",76,0) . D ADD^EDPCSV(X),BLANK^EDPCSV "RTN","EDPRPTBV",77,0) D XML^EDPX("") "RTN","EDPRPTBV",78,0) S X=$$XMLA^EDPX("average",.AVG) D XML^EDPX(X) "RTN","EDPRPTBV",79,0) D XML^EDPX("") "RTN","EDPRPTBV",80,0) Q "RTN","EDPRPTBV",81,0) ; "RTN","EDPRPTBV",82,0) INIT ; Initialize counters and sums "RTN","EDPRPTBV",83,0) N I,X S (CNT,ADM)=0 "RTN","EDPRPTBV",84,0) F I="elapsed","triage","admDec","admDel" S MIN(I)=0 "RTN","EDPRPTBV",85,0) Q "RTN","EDPRPTBV",86,0) ; "RTN","EDPRPTBV",87,0) ECODE(IEN) ; Return external value for a Code "RTN","EDPRPTBV",88,0) Q:IEN $P($G(^EDPB(233.1,IEN,0)),U,2) ;name "RTN","EDPRPTBV",89,0) Q "" "RTN","EDPRPTBV",90,0) ; "RTN","EDPRPTBV",91,0) BVAC(AREA,LOG) ; -- Return ICD^text of diagnosis in range, else null "RTN","EDPRPTBV",92,0) N X,Y,I,EDPDX S Y="" "RTN","EDPRPTBV",93,0) D DXALL^EDPQPCE(AREA,LOG,.EDPDX) "RTN","EDPRPTBV",94,0) S I=0 F S I=$O(EDPDX(I)) Q:I<1 S X=$G(EDPDX(I)) I 290<=+X,+X<=316 S Y=X Q "RTN","EDPRPTBV",95,0) Q Y "RTN","EDPX") 0^9^B9797287 "RTN","EDPX",1,0) EDPX ;SLC/KCM - Common Utilities "RTN","EDPX",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPX",3,0) ; "RTN","EDPX",4,0) ESC(X) ; Escape for XML transmission "RTN","EDPX",5,0) ; Q $ZCONVERT(X,"O","HTML") ; uncomment for fastest performance on Cache "RTN","EDPX",6,0) ; "RTN","EDPX",7,0) N I,Y,QOT S QOT="""" "RTN","EDPX",8,0) S Y=$P(X,"&") F I=2:1:$L(X,"&") S Y=Y_"&"_$P(X,"&",I) "RTN","EDPX",9,0) S X=Y,Y=$P(X,"<") F I=2:1:$L(X,"<") S Y=Y_"<"_$P(X,"<",I) "RTN","EDPX",10,0) S X=Y,Y=$P(X,">") F I=2:1:$L(X,">") S Y=Y_">"_$P(X,">",I) "RTN","EDPX",11,0) S X=Y,Y=$P(X,"'") F I=2:1:$L(X,"'") S Y=Y_"'"_$P(X,"'",I) "RTN","EDPX",12,0) S X=Y,Y=$P(X,QOT) F I=2:1:$L(X,QOT) S Y=Y_"""_$P(X,QOT,I) "RTN","EDPX",13,0) Q Y "RTN","EDPX",14,0) ; "RTN","EDPX",15,0) UES(X) ; Unescape XML "RTN","EDPX",16,0) Q X ; java side is unescaping this already "RTN","EDPX",17,0) ; Q $ZCONVERT(X,"I","HTML") "RTN","EDPX",18,0) ; "RTN","EDPX",19,0) UESREQ(REQ) ; Unescape HTTP post "RTN","EDPX",20,0) N I,X "RTN","EDPX",21,0) S X="" F S X=$O(REQ(X)) Q:X="" D "RTN","EDPX",22,0) . S I=0 F S I=$O(REQ(X,I)) Q:'I D "RTN","EDPX",23,0) . . S REQ(X,I)=$$UES(REQ(X,I)) "RTN","EDPX",24,0) Q "RTN","EDPX",25,0) VAL(X,R) ; Returns parameter value or null "RTN","EDPX",26,0) ; HTTP passes HTML-escaped values in an array as REC(param,1) "RTN","EDPX",27,0) Q $G(R(X,1)) "RTN","EDPX",28,0) ; "RTN","EDPX",29,0) NVPARSE(LST,IN) ; Parses tab delimited name-value pairs into array "RTN","EDPX",30,0) N I,X,TAB,NM,VAL "RTN","EDPX",31,0) S TAB=$C(9) "RTN","EDPX",32,0) F I=1:1:$L(IN,TAB) S X=$P(IN,TAB,I),NM=$P(X,"="),VAL=$P(X,"=",2,999) S:$L(NM) LST(NM)=VAL "RTN","EDPX",33,0) Q "RTN","EDPX",34,0) XMLS(TAG,DATA,LBL) ; Return XML node as "RTN","EDPX",35,0) Q "<"_TAG_" data="""_$$ESC(DATA)_""" label="""_$$ESC(LBL)_""" />" "RTN","EDPX",36,0) ; "RTN","EDPX",37,0) XMLA(TAG,ATT,END) ; Return XML node as "RTN","EDPX",38,0) N NODE S NODE="<"_TAG_" " "RTN","EDPX",39,0) N X "RTN","EDPX",40,0) S X="" F S X=$O(ATT(X)) Q:X="" I $L(ATT(X)) S NODE=NODE_X_"="""_$$ESC(ATT(X))_""" " "RTN","EDPX",41,0) S NODE=NODE_$G(END,"/")_">" "RTN","EDPX",42,0) Q NODE "RTN","EDPX",43,0) ; "RTN","EDPX",44,0) XMLE(SRC) ; Append list to XML array as elements "RTN","EDPX",45,0) N X,NODE "RTN","EDPX",46,0) S X="" F S X=$O(SRC(X)) Q:X="" D "RTN","EDPX",47,0) . S NODE="<"_X_">"_$$ESC(SRC(X))_"" "RTN","EDPX",48,0) . D XML(NODE) "RTN","EDPX",49,0) Q "RTN","EDPX",50,0) XML(X) ; Add a line of XML to be returned "RTN","EDPX",51,0) S EDPXML=$G(EDPXML)+1 "RTN","EDPX",52,0) S EDPXML(EDPXML)=X "RTN","EDPX",53,0) Q "RTN","EDPX",54,0) CODE(X) ; Return internal value for a code "RTN","EDPX",55,0) Q $O(^EDPB(233.1,"B",X,0)) "RTN","EDPX",56,0) ; "RTN","EDPX",57,0) SAVERR(TYP,ERR) ; Output a save error "RTN","EDPX",58,0) D XML^EDPX(""_ERR_"") "RTN","EDPX",59,0) Q "RTN","EDPX",60,0) MSG(MSG) ; Write out error message "RTN","EDPX",61,0) I MSG=1 S X="some error" "RTN","EDPX",62,0) I MSG=2300001 S X="Station Number is missing" "RTN","EDPX",63,0) I MSG=2300002 S X="Patient is already active in log" "RTN","EDPX",64,0) I MSG=2300003 S X="Unable to create lock for new record" "RTN","EDPX",65,0) I MSG=2300004 S X="Error creating new record" "RTN","EDPX",66,0) I MSG=2300005 S X="Error creating sub-record" "RTN","EDPX",67,0) I MSG=2300006 S X="Missing log record" "RTN","EDPX",68,0) I MSG=2300007 S X="Missing log IEN" "RTN","EDPX",69,0) I MSG=2300008 S X="Error updating record" "RTN","EDPX",70,0) I MSG=2300009 S X="Error updating sub-record" "RTN","EDPX",71,0) I MSG=2300010 S X="Command missing or not recognized: " "RTN","EDPX",72,0) I MSG=2300011 S X="Unknown report type" "RTN","EDPX",73,0) I MSG=2300012 S X="Missing or invalid date range" "RTN","EDPX",74,0) I MSG=2300013 S X="Shift times not defined for this site" "RTN","EDPX",75,0) I MSG=2300014 S X="Name missing" "RTN","EDPX",76,0) I MSG=2300015 S X="Unable to lock record" "RTN","EDPX",77,0) I MSG=2300016 S X="The selected room/area is now occupied." "RTN","EDPX",78,0) Q $$ESC^EDPX(X) "RTN","EDPYPRE") 0^^B8226400 "RTN","EDPYPRE",1,0) EDPYPRE ;SLC/KCM - Pre-init for facility install "RTN","EDPYPRE",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPYPRE",3,0) ; "RTN","EDPYPRE",4,0) S ^TMP("EDP-LAST-VERSION")=+$P($$VERSRV,"1.0-T",2) "RTN","EDPYPRE",5,0) ; "RTN","EDPYPRE",6,0) D FIXT5,DELFLDS,DELCODES,CHGNAMES "RTN","EDPYPRE",7,0) Q "RTN","EDPYPRE",8,0) ; "RTN","EDPYPRE",9,0) DELFLDS ; delete obsolete fields "RTN","EDPYPRE",10,0) I $$VERGTE(20) Q ; only convert if version <20 "RTN","EDPYPRE",11,0) ; "RTN","EDPYPRE",12,0) N DIK,DA "RTN","EDPYPRE",13,0) I $D(^DD(230.1,1)) D "RTN","EDPYPRE",14,0) . S DIK="^DD(230.1,",DA=1,DA(1)=230.1 "RTN","EDPYPRE",15,0) . D ^DIK "RTN","EDPYPRE",16,0) I $D(^DD(231.9,.04)) D "RTN","EDPYPRE",17,0) . S DIK="^DD(231.9,",DA=.04,DA(1)=231.9 "RTN","EDPYPRE",18,0) . D ^DIK "RTN","EDPYPRE",19,0) Q "RTN","EDPYPRE",20,0) DELCODES ; delete site code sets "RTN","EDPYPRE",21,0) I $$VERGTE(16) Q ; only convert if version <16 "RTN","EDPYPRE",22,0) ; "RTN","EDPYPRE",23,0) N X,DIK,DA "RTN","EDPYPRE",24,0) S X="" F S X=$O(^EDPB(233.2,"B",X)) Q:X="" D "RTN","EDPYPRE",25,0) . I $P(X,".")="edp" Q "RTN","EDPYPRE",26,0) . S DA=$O(^EDPB(233.2,"B",X,0)) Q:'DA "RTN","EDPYPRE",27,0) . S DIK="^EDPB(233.2," "RTN","EDPYPRE",28,0) . D ^DIK "RTN","EDPYPRE",29,0) Q "RTN","EDPYPRE",30,0) CHGNAMES ; change code names "RTN","EDPYPRE",31,0) I $$VERGTE(20) Q ; only convert if version <20 "RTN","EDPYPRE",32,0) ; "RTN","EDPYPRE",33,0) D CHG("edp.source.ambulance","zzedp.source.ambulance") "RTN","EDPYPRE",34,0) D CHG("edp.source.code","zzedp.source.code") "RTN","EDPYPRE",35,0) D CHG("edp.source.walk-in","zzedp.source.walk-in") "RTN","EDPYPRE",36,0) D CHG("edp.source.cboc","edp.source.clinic-offsite") "RTN","EDPYPRE",37,0) D CHG("edp.source.clinic","edp.source.clinic-onsite") "RTN","EDPYPRE",38,0) D CHG("edp.source.nhcu","edp.source.nhcu-onsite") "RTN","EDPYPRE",39,0) D CHG("edp.status.observation","zzedp.status.observation") "RTN","EDPYPRE",40,0) D CHG("edp.status.overflow","zzedp.status.overflow") "RTN","EDPYPRE",41,0) D CHG("edp.status.gone","zzedp.status.gone") "RTN","EDPYPRE",42,0) D CHG("edp.delay.admitorders","edp.delay.admitdispo") "RTN","EDPYPRE",43,0) Q "RTN","EDPYPRE",44,0) CHG(OLD,NEW) ; change old to new name "RTN","EDPYPRE",45,0) Q:'$D(^EDPB(233.1,"B",OLD)) "RTN","EDPYPRE",46,0) N IEN "RTN","EDPYPRE",47,0) S IEN=$O(^EDPB(233.1,"B",OLD,0)) Q:'IEN "RTN","EDPYPRE",48,0) N FDA,DIERR "RTN","EDPYPRE",49,0) S IEN=IEN_"," "RTN","EDPYPRE",50,0) S FDA(233.1,IEN,.01)=NEW "RTN","EDPYPRE",51,0) D FILE^DIE("","FDA","ERR") "RTN","EDPYPRE",52,0) D CLEAN^DILF "RTN","EDPYPRE",53,0) Q "RTN","EDPYPRE",54,0) ; "RTN","EDPYPRE",55,0) ; VERSRV copied from EDPQAR to avoid $T(VERSRV^EDPQAR) error "RTN","EDPYPRE",56,0) ; "RTN","EDPYPRE",57,0) VERSRV() ; Return server version of option name "RTN","EDPYPRE",58,0) N EDPLST,VAL "RTN","EDPYPRE",59,0) D FIND^DIC(19,"",1,"X","EDPF TRACKING SYSTEM",1,,,,"EDPLST") "RTN","EDPYPRE",60,0) S VAL=$G(EDPLST("DILIST","ID",1,1)) "RTN","EDPYPRE",61,0) S VAL=$P(VAL,"version ",2) "RTN","EDPYPRE",62,0) I 'VAL Q "1.0T?" "RTN","EDPYPRE",63,0) Q VAL "RTN","EDPYPRE",64,0) ; "RTN","EDPYPRE",65,0) VERGTE(HIGH) ; Return 1 if existing version and greater than HIGH "RTN","EDPYPRE",66,0) I $G(^TMP("EDP-LAST-VERSION"))<1 Q 1 ; no prior version "RTN","EDPYPRE",67,0) I $G(^TMP("EDP-LAST-VERSION"))>=HIGH Q 1 ; don't convert "RTN","EDPYPRE",68,0) Q 0 ; convert "RTN","EDPYPRE",69,0) ; "RTN","EDPYPRE",70,0) FIXT5 ; convert the timezone offset to visit string "RTN","EDPYPRE",71,0) ; (change occurred between T5 and T6) "RTN","EDPYPRE",72,0) I $$VERGTE(6) Q ; only convert if version <6 "RTN","EDPYPRE",73,0) ; "RTN","EDPYPRE",74,0) N LOG,X0 "RTN","EDPYPRE",75,0) S LOG=0 F S LOG=$O(^EDP(230,LOG)) Q:'LOG D "RTN","EDPYPRE",76,0) . S X0=^EDP(230,LOG,0) "RTN","EDPYPRE",77,0) . I $P(X0,U,12)="0" S $P(^EDP(230,LOG,0),U,12)="" "RTN","EDPYPRE",78,0) Q "RTN","EDPYPRE",79,0) ;. To convert VSTR to VISIT "RTN","EDPYPRE",80,0) ;. I $L($P(X0,U,12),";")=3 D "RTN","EDPYPRE",81,0) ;.. N VSTR,VISIT,DFN,VISITIEN,I "RTN","EDPYPRE",82,0) ;.. S VSTR=$P(X0,U,12),DFN=$P(X0,U,6) "RTN","EDPYPRE",83,0) ;.. Q:'DFN "RTN","EDPYPRE",84,0) ;.. K ^TMP("PXKENC",$J) "RTN","EDPYPRE",85,0) ;.. S VISIT=+$$GETENC^PXAPI(DFN,$P(VSTR,";",2),$P(VSTR,";")) "RTN","EDPYPRE",86,0) ;.. I VISIT<0 S $P(^EDP(230,LOG,0),U,12)="" Q "RTN","EDPYPRE",87,0) ;.. S VISITIEN="" "RTN","EDPYPRE",88,0) ;.. F I=1:1:$L(VISIT,U) I $P(^TMP("PXKENC",$J,$P(VISIT,U,I),"VST",$P(VISIT,U,I),0),U,6)=DUZ(2) S VISITIEN=$P(VISIT,U,I) Q "RTN","EDPYPRE",89,0) ;.. S $P(^EDP(230,LOG,0),U,12)=VISITIEN "RTN","EDPYPRE",90,0) Q "RTN","EDPYPST") 0^^B35872203 "RTN","EDPYPST",1,0) EDPYPST ;SLC/KCM - Post-init for facility install "RTN","EDPYPST",2,0) ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74 "RTN","EDPYPST",3,0) ; "RTN","EDPYPST",4,0) D PROXY,CONVERT,FIXSPEC,FIXWAIT,FIXDFLT,AO,CHOICES,DELBRD,FIXAPX,FIXSTA,FIXICD,FIXPDFN "RTN","EDPYPST",5,0) K ^TMP("EDP-LAST-VERSION") "RTN","EDPYPST",6,0) Q "RTN","EDPYPST",7,0) ; "RTN","EDPYPST",8,0) PROXY ; Create proxy user "RTN","EDPYPST",9,0) Q:$O(^VA(200,"B","EDPTRACKING,PROXY",0)) "RTN","EDPYPST",10,0) N X "RTN","EDPYPST",11,0) S X=$$CREATE^XUSAP("EDPTRACKING,PROXY","","EDPS BOARD CONTEXT") "RTN","EDPYPST",12,0) Q "RTN","EDPYPST",13,0) ; "RTN","EDPYPST",14,0) CONVERT ; set ^XTMP for tracking conversion "RTN","EDPYPST",15,0) Q:'$D(^DIZ(172006,0)) Q:$G(^XTMP("EDP-CONV"))="DONE" "RTN","EDPYPST",16,0) I '$D(^XTMP("EDP-CONV")) S ^XTMP("EDP-CONV",0)=$$FMADD^XLFDT(DT,365)_U_DT_"^Copy ED data to EDIS files" "RTN","EDPYPST",17,0) N I,DIV,X S X=$G(^XTMP("EDP-CONV","X")) ;old format "RTN","EDPYPST",18,0) S I=0 F S I=$O(^DIZ(172012,I)) Q:I<1 D "RTN","EDPYPST",19,0) . S DIV=$$DIV(I) Q:'DIV Q:$D(^XTMP("EDP-CONV","D",DIV)) "RTN","EDPYPST",20,0) . N X1,X2,X3 S (X2,X3)=0 "RTN","EDPYPST",21,0) . S X1=$S($L(X):"",1:I) "RTN","EDPYPST",22,0) . S:$P(X,U,2) X2="" I $P(X,U,3) S X2="" D ;old format - active done "RTN","EDPYPST",23,0) .. N L S L=$P(X,U,3)+1 "RTN","EDPYPST",24,0) .. F S L=$O(^DIZ(172006,L),-1) Q:L<1 I +$G(^(L,3))=DIV S X3=L Q "RTN","EDPYPST",25,0) . S ^XTMP("EDP-CONV","D",DIV)=X1_U_X2_U_X3 ; I^0^0 "RTN","EDPYPST",26,0) Q "RTN","EDPYPST",27,0) DIV(X) ; return file 4 ien for Configuration "RTN","EDPYPST",28,0) N X0,Y "RTN","EDPYPST",29,0) S X0=$G(^DIZ(172012,+$G(X),0)),Y=+X0 "RTN","EDPYPST",30,0) I Y<1 S Y=+$S($P(X0,U,2):$P(X0,U,2),1:$$SITE^VASITE) "RTN","EDPYPST",31,0) Q Y "RTN","EDPYPST",32,0) ; "RTN","EDPYPST",33,0) FIXSPEC ; add the display properties to existing spec "RTN","EDPYPST",34,0) I $$VERGTE^EDPYPRE(16) Q ; only convert if version <16 "RTN","EDPYPST",35,0) ; "RTN","EDPYPST",36,0) N SPEC "RTN","EDPYPST",37,0) S SPEC=0 F S SPEC=$O(^EDPB(231.9,SPEC)) Q:'SPEC D ADDPROP(SPEC),MOVEBRD(SPEC) "RTN","EDPYPST",38,0) Q "RTN","EDPYPST",39,0) ADDPROP(SPEC) ; add display properties to spec "RTN","EDPYPST",40,0) N I,X,WP,ORIG,SKIP,DIERR "RTN","EDPYPST",41,0) S SKIP=0 "RTN","EDPYPST",42,0) S I=0 F S I=$O(^EDPB(231.9,SPEC,2,I)) Q:'I D "RTN","EDPYPST",43,0) . S ORIG(I)=^EDPB(231.9,SPEC,2,I,0) "RTN","EDPYPST",44,0) . I ORIG(I)["displayProperties" S SKIP=1 "RTN","EDPYPST",45,0) Q:SKIP "RTN","EDPYPST",46,0) ; "RTN","EDPYPST",47,0) N LN S LN=0 "RTN","EDPYPST",48,0) S I=0 F S I=$O(ORIG(I)) Q:'I D "RTN","EDPYPST",49,0) . S LN=LN+1 S WP(LN)=ORIG(I) "RTN","EDPYPST",50,0) . I ORIG(I)["" S LN=LN+1,WP(LN)=$P($T(DP+1),";",3,99) "RTN","EDPYPST",51,0) D WP^DIE(231.9,SPEC_",",2,"","WP") "RTN","EDPYPST",52,0) D CLEAN^DILF "RTN","EDPYPST",53,0) Q "RTN","EDPYPST",54,0) MOVEBRD(AREA) ; move the display board spec into a multiple "RTN","EDPYPST",55,0) I $P($G(^EDPB(231.9,AREA,4,0)),U,4) Q ; already entries in the multiple "RTN","EDPYPST",56,0) I '$O(^EDPB(231.9,AREA,2,0)) Q ; no spec to move "RTN","EDPYPST",57,0) ; "RTN","EDPYPST",58,0) N I,X0,WP,MSG "RTN","EDPYPST",59,0) S I=0 F S I=$O(^EDPB(231.9,AREA,2,I)) Q:'I D "RTN","EDPYPST",60,0) . S X0=^EDPB(231.9,AREA,2,I,0) "RTN","EDPYPST",61,0) . Q:X0="" Q:X0="" "RTN","EDPYPST",62,0) . S WP(I)=X0 "RTN","EDPYPST",63,0) D UPDBRD^EDPBCF(AREA,0,"Main (default)",.WP,.MSG) "RTN","EDPYPST",64,0) Q "RTN","EDPYPST",65,0) DP ; default display properties "RTN","EDPYPST",66,0) ;; "RTN","EDPYPST",67,0) ; "RTN","EDPYPST",68,0) FIXWAIT ; change the category of waiting room to "waiting" "RTN","EDPYPST",69,0) I $$VERGTE^EDPYPRE(14) Q ; only convert if version <14 "RTN","EDPYPST",70,0) ; "RTN","EDPYPST",71,0) N IEN "RTN","EDPYPST",72,0) S IEN=0 F S IEN=$O(^EDPB(231.8,"B","Waiting",IEN)) Q:'IEN D "RTN","EDPYPST",73,0) . S $P(^EDPB(231.8,IEN,0),U,9)=2 "RTN","EDPYPST",74,0) Q "RTN","EDPYPST",75,0) FIXDFLT ; create initial default rooms "RTN","EDPYPST",76,0) N AREA,X1,AMB,DFLT,STN "RTN","EDPYPST",77,0) S AREA=0 F S AREA=$O(^EDPB(231.9,AREA)) Q:'AREA D "RTN","EDPYPST",78,0) . S X1=$G(^EDPB(231.9,AREA,1)),AMB=$P(X1,U,11),DFLT=$P(X1,U,12) "RTN","EDPYPST",79,0) . S STN=$P(^EDPB(231.9,AREA,0),U,2) "RTN","EDPYPST",80,0) . I 'AMB D "RTN","EDPYPST",81,0) . . S AMB=$O(^EDPB(231.8,"AC",STN,AREA,"AMBU",0)) "RTN","EDPYPST",82,0) . . S:AMB $P(^EDPB(231.9,AREA,1),U,11)=AMB "RTN","EDPYPST",83,0) . I 'DFLT D "RTN","EDPYPST",84,0) . . S DFLT=$O(^EDPB(231.8,"AC",STN,AREA,"WAIT",0)) "RTN","EDPYPST",85,0) . . S $P(^EDPB(231.9,AREA,1),U,12)=DFLT "RTN","EDPYPST",86,0) Q "RTN","EDPYPST",87,0) ; "RTN","EDPYPST",88,0) DELBRD ; delete the DD and data for the old display board spec "RTN","EDPYPST",89,0) I $$VERGTE^EDPYPRE(20) Q ; only convert if version <20 "RTN","EDPYPST",90,0) ; "RTN","EDPYPST",91,0) I $$GET1^DID(231.9,2,,"TYPE")'="WORD-PROCESSING" Q "RTN","EDPYPST",92,0) N DIU "RTN","EDPYPST",93,0) S DIU=231.92,DIU(0)="SD" "RTN","EDPYPST",94,0) D EN^DIU2 "RTN","EDPYPST",95,0) Q "RTN","EDPYPST",96,0) AO ; build AO index on #230 "RTN","EDPYPST",97,0) Q:$D(^EDP(230,"AO")) "RTN","EDPYPST",98,0) N LOG,IEN,ORD "RTN","EDPYPST",99,0) S LOG=0 F S LOG=+$O(^EDP(230,LOG)) Q:LOG<1 D "RTN","EDPYPST",100,0) . S IEN=0 F S IEN=+$O(^EDP(230,LOG,8,IEN)) Q:IEN<1 S ORD=+$G(^(IEN,0)) D "RTN","EDPYPST",101,0) .. S:ORD ^EDP(230,"AO",ORD,LOG,IEN)="" "RTN","EDPYPST",102,0) Q "RTN","EDPYPST",103,0) CHOICES ; initialize choices timestamps "RTN","EDPYPST",104,0) N AREA "RTN","EDPYPST",105,0) S AREA=0 F S AREA=$O(^EDPB(231.9,AREA)) Q:'AREA S ^EDPB(231.9,AREA,231)=$H "RTN","EDPYPST",106,0) Q "RTN","EDPYPST",107,0) FIXNV ; convert the "no value" codes to 0 "RTN","EDPYPST",108,0) Q ; maybe do this later.... "RTN","EDPYPST",109,0) N NOVAL,LOG "RTN","EDPYPST",110,0) S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0)) "RTN","EDPYPST",111,0) Q:'NOVAL "RTN","EDPYPST",112,0) S LOG=0 F S LOG=$O(^EDP(230,LOG)) Q:'LOG D "RTN","EDPYPST",113,0) . D CHGNV(230,LOG,0,10) "RTN","EDPYPST",114,0) . D CHGNV(230,LOG,1,2) "RTN","EDPYPST",115,0) . D CHGNV(230,LOG,1,5) "RTN","EDPYPST",116,0) . D CHGNV(230,LOG,3,2) "RTN","EDPYPST",117,0) . D CHGNV(230,LOG,3,3) "RTN","EDPYPST",118,0) S LOG=0 F S LOG=$O(^EDP(230.1,LOG)) Q:'LOG D "RTN","EDPYPST",119,0) . D CHGNV(230.1,LOG,0,10) "RTN","EDPYPST",120,0) . D CHGNV(230.1,LOG,0,11) "RTN","EDPYPST",121,0) . D CHGNV(230.1,LOG,0,12) "RTN","EDPYPST",122,0) . D CHGNV(230.1,LOG,3,2) "RTN","EDPYPST",123,0) . D CHGNV(230.1,LOG,3,3) "RTN","EDPYPST",124,0) Q "RTN","EDPYPST",125,0) CHGNV(FN,LOG,SUB,P) ; convert individual piece, expects NOVAL defined "RTN","EDPYPST",126,0) Q ; maybe do this later.... "RTN","EDPYPST",127,0) I $P($G(^EDP(FN,LOG,SUB)),U,P)=NOVAL S $P(^EDP(FN,LOG,SUB),U,P)=0 "RTN","EDPYPST",128,0) Q "RTN","EDPYPST",129,0) FIXAPX ; fix the AP xref in 230 "RTN","EDPYPST",130,0) I $$VERGTE^EDPYPRE(21) Q ; only convert if version <21 "RTN","EDPYPST",131,0) ; "RTN","EDPYPST",132,0) K ^EDP(230,"AP") "RTN","EDPYPST",133,0) N DIK,DA "RTN","EDPYPST",134,0) S DIK="^EDP(230,",DIK(1)=".06^AP" "RTN","EDPYPST",135,0) D ENALL^DIK "RTN","EDPYPST",136,0) Q "RTN","EDPYPST",137,0) FIXPDFN ; create the DFN xref in 230 "RTN","EDPYPST",138,0) I $$VERGTE^EDPYPRE(24) Q ; only convert if last version <24 "RTN","EDPYPST",139,0) ; "RTN","EDPYPST",140,0) K ^EDP(230,"PDFN") "RTN","EDPYPST",141,0) N DIK,DA "RTN","EDPYPST",142,0) S DIK="^EDP(230,",DIK(1)=".06^PDFN" "RTN","EDPYPST",143,0) D ENALL^DIK "RTN","EDPYPST",144,0) Q "RTN","EDPYPST",145,0) FIXSTA ; convert the station number field to an institution pointer "RTN","EDPYPST",146,0) I $$VERGTE^EDPYPRE(22) Q ; only convert if version <22 "RTN","EDPYPST",147,0) ; "RTN","EDPYPST",148,0) N IEN "RTN","EDPYPST",149,0) S IEN=0 F S IEN=$O(^EDP(230,IEN)) Q:'IEN D CHGSTA(230,IEN) "RTN","EDPYPST",150,0) S IEN=0 F S IEN=$O(^EDPB(231.7,IEN)) Q:'IEN D CHGSTA(231.7,IEN) "RTN","EDPYPST",151,0) S IEN=0 F S IEN=$O(^EDPB(231.8,IEN)) Q:'IEN D CHGSTA(231.8,IEN) "RTN","EDPYPST",152,0) S IEN=0 F S IEN=$O(^EDPB(231.9,IEN)) Q:'IEN D CHGSTA(231.9,IEN) "RTN","EDPYPST",153,0) D CLEAN^DILF "RTN","EDPYPST",154,0) Q "RTN","EDPYPST",155,0) CHGSTA(EDPFILE,EDPIEN) ; convert station number to institution pointer withing file "RTN","EDPYPST",156,0) N STA,INST "RTN","EDPYPST",157,0) S STA=$P($S(EDPFILE<231:^EDP(EDPFILE,EDPIEN,0),1:^EDPB(EDPFILE,EDPIEN,0)),U,2) "RTN","EDPYPST",158,0) S INST=$$IEN^XUAF4(STA) "RTN","EDPYPST",159,0) ; "RTN","EDPYPST",160,0) N FDA,DIERR,ERR "RTN","EDPYPST",161,0) S FDA(EDPFILE,EDPIEN_",",.02)=INST "RTN","EDPYPST",162,0) D FILE^DIE("","FDA","ERR") "RTN","EDPYPST",163,0) I $D(DIERR) W !,"STA Error, File=",EDPFILE," IEN=",EDPIEN," STA=",STN," INST=",INST "RTN","EDPYPST",164,0) Q "RTN","EDPYPST",165,0) FIXICD ; convert the ICD Code file to a pointer to the ICD file "RTN","EDPYPST",166,0) I $$VERGTE^EDPYPRE(22) Q ; only convert if version <22 "RTN","EDPYPST",167,0) ; "RTN","EDPYPST",168,0) N LOG,IEN "RTN","EDPYPST",169,0) S LOG=0 F S LOG=$O(^EDP(230,LOG)) Q:'LOG D "RTN","EDPYPST",170,0) . S IEN=0 F S IEN=$O(^EDP(230,LOG,4,IEN)) Q:'IEN D CHGICD(LOG,IEN) "RTN","EDPYPST",171,0) D CLEAN^DILF "RTN","EDPYPST",172,0) Q "RTN","EDPYPST",173,0) CHGICD(LOG,IEN) ; convert individual ICD Code to ICD Pointer "RTN","EDPYPST",174,0) N ICDCODE,ICDIEN "RTN","EDPYPST",175,0) S ICDCODE=$P($P(^EDP(230,LOG,4,IEN,0),U,2),"/",1) "RTN","EDPYPST",176,0) Q:'$L(ICDCODE) "RTN","EDPYPST",177,0) S ICDIEN=+$O(^ICD9("BA",ICDCODE_" ",0)) "RTN","EDPYPST",178,0) ; "RTN","EDPYPST",179,0) N FDA,DIERR,ERR "RTN","EDPYPST",180,0) S FDA(230.04,IEN_","_LOG_",",.02)=ICDIEN "RTN","EDPYPST",181,0) D FILE^DIE("","FDA","ERR") "RTN","EDPYPST",182,0) I $D(DIERR) W !,"STA Error, File=",EDPFILE," IEN=",EDPIEN," STA=",STN," INST=",INST "RTN","EDPYPST",183,0) Q "SEC","^DIC",230,230,0,"AUDIT") @ "SEC","^DIC",230,230,0,"DD") @ "SEC","^DIC",230,230,0,"DEL") @ "SEC","^DIC",230,230,0,"LAYGO") @ "SEC","^DIC",230,230,0,"RD") @ "SEC","^DIC",230,230,0,"WR") @ "SEC","^DIC",230.1,230.1,0,"AUDIT") @ "SEC","^DIC",230.1,230.1,0,"DD") @ "SEC","^DIC",230.1,230.1,0,"DEL") @ "SEC","^DIC",230.1,230.1,0,"LAYGO") @ "SEC","^DIC",230.1,230.1,0,"RD") @ "SEC","^DIC",230.1,230.1,0,"WR") @ "SEC","^DIC",231.7,231.7,0,"AUDIT") @ "SEC","^DIC",231.7,231.7,0,"DD") @ "SEC","^DIC",231.7,231.7,0,"DEL") @ "SEC","^DIC",231.7,231.7,0,"LAYGO") @ "SEC","^DIC",231.7,231.7,0,"RD") @ "SEC","^DIC",231.7,231.7,0,"WR") @ "SEC","^DIC",231.8,231.8,0,"AUDIT") @ "SEC","^DIC",231.8,231.8,0,"DD") @ "SEC","^DIC",231.8,231.8,0,"DEL") @ "SEC","^DIC",231.8,231.8,0,"LAYGO") @ "SEC","^DIC",231.8,231.8,0,"RD") @ "SEC","^DIC",231.8,231.8,0,"WR") @ "SEC","^DIC",231.9,231.9,0,"AUDIT") @ "SEC","^DIC",231.9,231.9,0,"DD") @ "SEC","^DIC",231.9,231.9,0,"DEL") @ "SEC","^DIC",231.9,231.9,0,"LAYGO") @ "SEC","^DIC",231.9,231.9,0,"RD") @ "SEC","^DIC",231.9,231.9,0,"WR") @ "SEC","^DIC",233.1,233.1,0,"AUDIT") @ "SEC","^DIC",233.1,233.1,0,"DD") @ "SEC","^DIC",233.1,233.1,0,"DEL") @ "SEC","^DIC",233.1,233.1,0,"LAYGO") @ "SEC","^DIC",233.1,233.1,0,"RD") @ "SEC","^DIC",233.1,233.1,0,"WR") @ "SEC","^DIC",233.2,233.2,0,"AUDIT") @ "SEC","^DIC",233.2,233.2,0,"DD") @ "SEC","^DIC",233.2,233.2,0,"DEL") @ "SEC","^DIC",233.2,233.2,0,"LAYGO") @ "SEC","^DIC",233.2,233.2,0,"RD") @ "SEC","^DIC",233.2,233.2,0,"WR") @ "VER") 8.0^22.0 "^DD",230,230,0) FIELD^^.14^29 "^DD",230,230,0,"DDA") N "^DD",230,230,0,"DT") 3081215 "^DD",230,230,0,"IX","AVISIT",230,.12) "^DD",230,230,0,"IX","B",230,.01) "^DD",230,230,0,"IX","V",230,.12) "^DD",230,230,0,"NM","ED LOG") "^DD",230,230,0,"PT",230.1,.01) "^DD",230,230,0,"VRPK") EMERGENCY DEPARTMENT "^DD",230,230,.01,0) LOG ENTRY TIME^RD^^0;1^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230,.01,1,0) ^.1 "^DD",230,230,.01,1,1,0) 230^B "^DD",230,230,.01,1,1,1) S ^EDP(230,"B",$E(X,1,30),DA)="" "^DD",230,230,.01,1,1,2) K ^EDP(230,"B",$E(X,1,30),DA) "^DD",230,230,.01,3) Enter the time the record was created. "^DD",230,230,.01,21,0) ^^1^1^3080912^ "^DD",230,230,.01,21,1,0) This is the date/time that this log record was added to the file. "^DD",230,230,.01,"DT") 3070721 "^DD",230,230,.02,0) INSTITUTION^RP4'^DIC(4,^0;2^Q "^DD",230,230,.02,1,0) ^.1^^0 "^DD",230,230,.02,3) Select the institution for this log entry. "^DD",230,230,.02,21,0) ^^3^3^3081008^ "^DD",230,230,.02,21,1,0) This allows the log entry to be associated with the station that "^DD",230,230,.02,21,2,0) originated it. It allows multiple institutions to be served by the same "^DD",230,230,.02,21,3,0) system. "^DD",230,230,.02,"DT") 3081222 "^DD",230,230,.03,0) AREA^RP231.9'^EDPB(231.9,^0;3^Q "^DD",230,230,.03,1,0) ^.1^^0 "^DD",230,230,.03,3) Select the area for this record. "^DD",230,230,.03,21,0) ^^3^3^3080912^ "^DD",230,230,.03,21,1,0) This is the area in the hospital for which this record applies. "^DD",230,230,.03,21,2,0) Initially, the only area is the emergency department. This field allows "^DD",230,230,.03,21,3,0) use to be expanded into other departments. "^DD",230,230,.03,23,0) ^^3^3^3080912^ "^DD",230,230,.03,23,1,0) The area field is also used for training classes. In the class, each "^DD",230,230,.03,23,2,0) user may be assigned a separate area so as to avoid conflicts when "^DD",230,230,.03,23,3,0) setting up configurations. "^DD",230,230,.03,"DT") 3081222 "^DD",230,230,.04,0) PATIENT NAME^F^^0;4^K:$L(X)>30!($L(X)<3) X "^DD",230,230,.04,3) Answer must be 3-30 characters in length. "^DD",230,230,.04,21,0) ^^5^5^3081003^ "^DD",230,230,.04,21,1,0) This is the name of the patient. It allows a name to be entered in the "^DD",230,230,.04,21,2,0) case of humanitarian care when the patient has not been entered into "^DD",230,230,.04,21,3,0) VistA yet. "^DD",230,230,.04,21,4,0) "^DD",230,230,.04,21,5,0) LastName,FirstName is the name format that should be used. "^DD",230,230,.04,23,0) ^^13^13^3081003^ "^DD",230,230,.04,23,1,0) This field also assists in checking for duplicates and similar names on "^DD",230,230,.04,23,2,0) the display board within a single area. This allows appropriate "^DD",230,230,.04,23,3,0) indicators to be shown on the display board. "^DD",230,230,.04,23,4,0) "^DD",230,230,.04,23,5,0) The clerk only enters the name in this field if the patient is not in "^DD",230,230,.04,23,6,0) VistA. If the patient gets added to VistA during the visit, the name "^DD",230,230,.04,23,7,0) used in VistA replaces the clerk-entered name. If the patient is "^DD",230,230,.04,23,8,0) selected from VistA, the software gets the VistA name and places it "^DD",230,230,.04,23,9,0) here. This allows the software to flag patients with similar names that "^DD",230,230,.04,23,10,0) might be active in the Emergency Department simultaneously. "^DD",230,230,.04,23,11,0) "^DD",230,230,.04,23,12,0) This field is set to "(ambulance en route)" in the case where an "^DD",230,230,.04,23,13,0) ambulance is arriving but the name of the patient is unknown. "^DD",230,230,.04,"DT") 3081003 "^DD",230,230,.05,0) PATIENT SSN*^F^^0;5^K:$L(X)>9!($L(X)<1) X "^DD",230,230,.05,1,0) ^.1^^0 "^DD",230,230,.05,3) Answer must be 1-9 characters in length. "^DD",230,230,.05,21,0) ^.001^2^2^3081003^^ "^DD",230,230,.05,21,1,0) This is the patient social security number in the case of humanitarian "^DD",230,230,.05,21,2,0) care for a patient that does not exist in VistA. "^DD",230,230,.05,23,0) ^.001^2^2^3081003^^ "^DD",230,230,.05,23,1,0) It was part of the class 3 product, but is not currently used. It may be "^DD",230,230,.05,23,2,0) used in the future again, but is currently marked for deletion. "^DD",230,230,.05,"DT") 3081003 "^DD",230,230,.06,0) PATIENT ID^P2'^DPT(^0;6^Q "^DD",230,230,.06,3) Select a patient. "^DD",230,230,.06,21,0) ^.001^1^1^3081003^^ "^DD",230,230,.06,21,1,0) This is the patient in VistA for whom this log record is created. "^DD",230,230,.06,23,0) ^^9^9^3081003^ "^DD",230,230,.06,23,1,0) This field may be absent in the case of an arriving ambulance, where the "^DD",230,230,.06,23,2,0) patient is not yet known. It may also be absent when humanitarian aid is "^DD",230,230,.06,23,3,0) rendered for a non-VA patient. "^DD",230,230,.06,23,4,0) "^DD",230,230,.06,23,5,0) If the patient is in VistA, the software gets the name field from file 2 "^DD",230,230,.06,23,6,0) and places it in the PATIENT NAME field in this file. This allows the "^DD",230,230,.06,23,7,0) software to flag patients with similar names who are active in the "^DD",230,230,.06,23,8,0) emergency department at the same time. The clerk does not enter the "^DD",230,230,.06,23,9,0) PATIENT NAME field directly if the patient is in VistA. "^DD",230,230,.06,"DT") 3081222 "^DD",230,230,.07,0) CLOSED^S^1:YES;0:NO;^0;7^Q "^DD",230,230,.07,1,0) ^.1^^0 "^DD",230,230,.07,3) Enter "Yes" when the patient should be removed from the board. "^DD",230,230,.07,9) ^ "^DD",230,230,.07,21,0) ^^3^3^3081003^ "^DD",230,230,.07,21,1,0) This flag is set to YES when the patient has left the area (Emergency "^DD",230,230,.07,21,2,0) Department) and has been properly dispositioned. At this time, the entry "^DD",230,230,.07,21,3,0) no longer appears on the display board. "^DD",230,230,.07,"DT") 3081004 "^DD",230,230,.08,0) TIME IN^D^^0;8^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230,.08,3) Enter the actual time of arrival. "^DD",230,230,.08,21,0) ^^2^2^3080912^ "^DD",230,230,.08,21,1,0) This is the time that the patient actually arrived at the emergency "^DD",230,230,.08,21,2,0) department. The length of the visit is measured from this point in time. "^DD",230,230,.08,"DT") 3071120 "^DD",230,230,.09,0) TIME OUT^D^^0;9^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230,.09,3) Enter the time the patient left. "^DD",230,230,.09,21,0) ^^2^2^3080912^ "^DD",230,230,.09,21,1,0) This is the time that the patient was discharged from the emergency "^DD",230,230,.09,21,2,0) department (sent home, admitted, transferred somewhere else). "^DD",230,230,.09,23,0) ^^2^2^3080912^ "^DD",230,230,.09,23,1,0) Prompting for delay reasons is based on the difference between the time "^DD",230,230,.09,23,2,0) in and the time out. "^DD",230,230,.09,"DT") 3071018 "^DD",230,230,.1,0) ARRIVAL MODE^P233.1'^EDPB(233.1,^0;10^Q "^DD",230,230,.1,3) Select the source of the patient visit. "^DD",230,230,.1,21,0) ^^2^2^3081003^ "^DD",230,230,.1,21,1,0) This is the source of the emergency department visit. For example, the "^DD",230,230,.1,21,2,0) patient may have arrived from a nursing home, VA Hospital, walked in, etc. "^DD",230,230,.1,23,0) ^.001^2^2^3081003^^ "^DD",230,230,.1,23,1,0) The values for this field are associated with the .arrival and the "^DD",230,230,.1,23,2,0) edp.arrival code sets. "^DD",230,230,.1,"DT") 3070913 "^DD",230,230,.11,0) PATIENT BRIEF ID^F^^0;11^K:$L(X)>10!($L(X)<4) X "^DD",230,230,.11,3) Answer must be 4-10 characters in length. "^DD",230,230,.11,21,0) ^^5^5^3081015^ "^DD",230,230,.11,21,1,0) This is a patient identifier that shows on the display board. In the case "^DD",230,230,.11,21,2,0) of an ambulance or non-VA patient, this identifier may be constructed and "^DD",230,230,.11,21,3,0) stored here. The identifier should be in the format: last initial + last "^DD",230,230,.11,21,4,0) 4 of ssn. For example, given a fictional patient named TWENTY VEHU with "^DD",230,230,.11,21,5,0) an SSN of 000-00-0020, this field would be V0020. "^DD",230,230,.11,23,0) ^.001^9^9^3081015^^ "^DD",230,230,.11,23,1,0) Since last initial + last 4 digits of the social security number are "^DD",230,230,.11,23,2,0) commonly used to identify patients, this field assists in checking for "^DD",230,230,.11,23,3,0) patients with the same last initial / last 4. When a VistA patient is "^DD",230,230,.11,23,4,0) selected, the last initial / last 4 is constructed from information in "^DD",230,230,.11,23,5,0) file 2 and stored here. This allows patients with the same last initial / "^DD",230,230,.11,23,6,0) last 4 to be indicated on the display board. "^DD",230,230,.11,23,7,0) "^DD",230,230,.11,23,8,0) If an ambulance is en route and the patient is not known, the value of "^DD",230,230,.11,23,9,0) this field is "(amb)". "^DD",230,230,.11,"DT") 3071129 "^DD",230,230,.12,0) VISIT^P9000010'^AUPNVSIT(^0;12^Q "^DD",230,230,.12,1,0) ^.1 "^DD",230,230,.12,1,1,0) 230^AVISIT^MUMPS "^DD",230,230,.12,1,1,1) D ADD^AUPNVSIT "^DD",230,230,.12,1,1,2) D SUB^AUPNVSIT "^DD",230,230,.12,1,1,"%D",0) ^^2^2^3080318^ "^DD",230,230,.12,1,1,"%D",1,0) This increments and decrements the dependency counter in the VISIT file "^DD",230,230,.12,1,1,"%D",2,0) (9000010). "^DD",230,230,.12,1,1,"DT") 3080318 "^DD",230,230,.12,1,2,0) 230^V "^DD",230,230,.12,1,2,1) S ^EDP(230,"V",$E(X,1,30),DA)="" "^DD",230,230,.12,1,2,2) K ^EDP(230,"V",$E(X,1,30),DA) "^DD",230,230,.12,1,2,"%D",0) ^^1^1^3080418^ "^DD",230,230,.12,1,2,"%D",1,0) This is used by PCE to help identify dependent entries. "^DD",230,230,.12,1,2,"DT") 3080418 "^DD",230,230,.12,3) Select a visit. "^DD",230,230,.12,21,0) ^^1^1^3081010^ "^DD",230,230,.12,21,1,0) This is the VISIT associated with this emergency department encounter. "^DD",230,230,.12,23,0) ^.001^6^6^3081010^^ "^DD",230,230,.12,23,1,0) Since emergency departments don't use appointments, the arrival of the "^DD",230,230,.12,23,2,0) patient is recorded in the emergency department tracking system itself. "^DD",230,230,.12,23,3,0) The tracking system can then create a visit in PCE so that subsequent "^DD",230,230,.12,23,4,0) care givers can associate orders and progress notes with that same "^DD",230,230,.12,23,5,0) visit. The visit is created once any PCE related field is collected so "^DD",230,230,.12,23,6,0) that DATA2PCE may be called. This is usually the triage nurse. "^DD",230,230,.12,"DT") 3080418 "^DD",230,230,.13,0) CREATION SOURCE^S^0:EDIS;1:SCHEDULING;2:CPRS;^0;13^Q "^DD",230,230,.13,3) Enter the mechanism which caused this entry to be created. "^DD",230,230,.13,21,0) ^^1^1^3080912^ "^DD",230,230,.13,21,1,0) This field identifies the route by which the visit was created. "^DD",230,230,.13,23,0) ^^5^5^3080912^ "^DD",230,230,.13,23,1,0) Generally the VISIT field is populated by calling DATA2PCE from EDIS. It "^DD",230,230,.13,23,2,0) is possible that the visit may be created by entering an appointment to "^DD",230,230,.13,23,3,0) the emergency department or writing a progress note for the emergency "^DD",230,230,.13,23,4,0) department location. This field records which mechanism was responsible "^DD",230,230,.13,23,5,0) for creating the entry in the VISIT file. "^DD",230,230,.13,"DT") 3080722 "^DD",230,230,.14,0) CLINIC^P44'^SC(^0;14^Q "^DD",230,230,.14,3) Select a clinic. "^DD",230,230,.14,21,0) ^.001^2^2^3081215^^ "^DD",230,230,.14,21,1,0) This is the specific clinic within the department (if multiple clinics "^DD",230,230,.14,21,2,0) are used) that will be associated with this visit. "^DD",230,230,.14,23,0) ^^3^3^3081215^ "^DD",230,230,.14,23,1,0) When a patient is checked in via scheduling, the selected clinic is "^DD",230,230,.14,23,2,0) stored here until a visit can be created. When the visit is created, the "^DD",230,230,.14,23,3,0) location stored here is used. "^DD",230,230,.14,"DT") 3081215 "^DD",230,230,1.1,0) COMPLAINT^F^^1;1^K:$L(X)>50!($L(X)<1) X "^DD",230,230,1.1,3) Answer must be 1-50 characters in length. "^DD",230,230,1.1,21,0) ^^3^3^3081003^ "^DD",230,230,1.1,21,1,0) This is the complaint that the patient presents with. It is usually "^DD",230,230,1.1,21,2,0) shown on the display board, so it should be brief enough to fit in the "^DD",230,230,1.1,21,3,0) column on the display board. "^DD",230,230,1.1,"DT") 3070720 "^DD",230,230,1.2,0) DISPOSITION^P233.1'^EDPB(233.1,^1;2^Q "^DD",230,230,1.2,3) Select the disposition of the patient. "^DD",230,230,1.2,21,0) ^^1^1^3080912^ "^DD",230,230,1.2,21,1,0) This is how the patient is dispositioned at the end of the visit. "^DD",230,230,1.2,23,0) ^^2^2^3080912^ "^DD",230,230,1.2,23,1,0) The values for this field are associated with the .disposition and "^DD",230,230,1.2,23,2,0) the edp.disposition code sets. "^DD",230,230,1.2,"DT") 3070720 "^DD",230,230,1.3,0) DISPOSITION TIME^D^^1;3^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230,1.3,3) Enter the time of disposition. "^DD",230,230,1.3,21,0) ^^1^1^3080912^ "^DD",230,230,1.3,21,1,0) This is the time that the disposition field was last updated. "^DD",230,230,1.3,"DT") 3070720 "^DD",230,230,1.4,0) DIAGNOSIS TIME^D^^1;4^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230,1.4,3) Enter the time the diagnosis was made. "^DD",230,230,1.4,21,0) ^^1^1^3080912^ "^DD",230,230,1.4,21,1,0) This is the time that the diagnoses were last updated. "^DD",230,230,1.4,"DT") 3070720 "^DD",230,230,1.5,0) DELAY REASON^P233.1'^EDPB(233.1,^1;5^Q "^DD",230,230,1.5,3) Select a delay reason. "^DD",230,230,1.5,21,0) ^^2^2^3081010^ "^DD",230,230,1.5,21,1,0) This is the reason for delay in the case where the visit has taken longer "^DD",230,230,1.5,21,2,0) than the time recommended. "^DD",230,230,1.5,23,0) ^.001^1^1^3081010^^^ "^DD",230,230,1.5,23,1,0) This field is associated with the .delay and edp.delay code sets. "^DD",230,230,1.5,"DT") 3081003 "^DD",230,230,2,0) COMPLAINT (LONG)^F^^2;1^K:$L(X)>220!($L(X)<1) X "^DD",230,230,2,3) Answer must be 1-220 characters in length. "^DD",230,230,2,21,0) ^^3^3^3080912^ "^DD",230,230,2,21,1,0) This is an optional field that allows the complaint to be entered in a "^DD",230,230,2,21,2,0) form that is longer than that allowed by the complaint column on the "^DD",230,230,2,21,3,0) display board. "^DD",230,230,2,"DT") 3070720 "^DD",230,230,3.2,0) STATUS^P233.1'^EDPB(233.1,^3;2^Q "^DD",230,230,3.2,1,0) ^.1^^0 "^DD",230,230,3.2,3) Select a patient status. "^DD",230,230,3.2,21,0) ^^2^2^3080912^ "^DD",230,230,3.2,21,1,0) This is the status of the patient during the course of the emergency "^DD",230,230,3.2,21,2,0) department visit (awaiting triage, ed patient, etc.). "^DD",230,230,3.2,23,0) ^^2^2^3080912^ "^DD",230,230,3.2,23,1,0) This field is associated with the .status and the edp.status code "^DD",230,230,3.2,23,2,0) sets. "^DD",230,230,3.2,"DT") 3080305 "^DD",230,230,3.3,0) ACUITY^P233.1'^EDPB(233.1,^3;3^Q "^DD",230,230,3.3,3) Select an acuity level. "^DD",230,230,3.3,21,0) ^^2^2^3080912^ "^DD",230,230,3.3,21,1,0) This is the acuity of the patient. The acuity is based on the ESI scale "^DD",230,230,3.3,21,2,0) with acuity levels 1-5. "^DD",230,230,3.3,23,0) ^^1^1^3080912^ "^DD",230,230,3.3,23,1,0) This field is associated with the edp.acuity code set. "^DD",230,230,3.3,"DT") 3071129 "^DD",230,230,3.4,0) LOC^P231.8'^EDPB(231.8,^3;4^Q "^DD",230,230,3.4,3) Select a room or area. "^DD",230,230,3.4,21,0) ^^4^4^3080912^ "^DD",230,230,3.4,21,1,0) This is the room / area where the patient is. This may be a physical "^DD",230,230,3.4,21,2,0) room or a specific bed. It may also be a "conceptual area", such as the "^DD",230,230,3.4,21,3,0) hallway, parking lot, x-ray, etc. It does not necessarily need to be a "^DD",230,230,3.4,21,4,0) physical location. "^DD",230,230,3.4,"DT") 3071129 "^DD",230,230,3.5,0) MD ASSIGNED^P200'^VA(200,^3;5^Q "^DD",230,230,3.5,3) Select a provider. "^DD",230,230,3.5,21,0) ^^1^1^3080912^ "^DD",230,230,3.5,21,1,0) This is the provider currently assigned to the patient. "^DD",230,230,3.5,"DT") 3080305 "^DD",230,230,3.6,0) NURSE ASSIGNED^P200'^VA(200,^3;6^Q "^DD",230,230,3.6,3) Select a nurse. "^DD",230,230,3.6,21,0) ^^1^1^3080912^ "^DD",230,230,3.6,21,1,0) This is the nurse assigned to the patient. "^DD",230,230,3.6,"DT") 3080305 "^DD",230,230,3.7,0) RESIDENT ASSIGNED^P200'^VA(200,^3;7^Q "^DD",230,230,3.7,3) Select a resident. "^DD",230,230,3.7,21,0) ^^1^1^3080912^ "^DD",230,230,3.7,21,1,0) This is the resident assigned to the patient. "^DD",230,230,3.7,"DT") 3080305 "^DD",230,230,3.8,0) COMMENT^F^^3;8^K:$L(X)>80!($L(X)<1) X "^DD",230,230,3.8,3) Answer must be 1-80 characters in length. "^DD",230,230,3.8,21,0) ^^2^2^3080912^ "^DD",230,230,3.8,21,1,0) This is a comment that may be entered or updated for this particular "^DD",230,230,3.8,21,2,0) visit. The comment may be optionally shown on the display board. "^DD",230,230,3.8,"DT") 3071129 "^DD",230,230,4,0) DISCHARGE DIAGNOSIS^230.04A^^4;0 "^DD",230,230,4,21,0) ^^1^1^3081010^ "^DD",230,230,4,21,1,0) This multiple contains the diagnosis or diagnoses for the visit. "^DD",230,230,4,23,0) ^^13^13^3081010^ "^DD",230,230,4,23,1,0) This multiple serves two purposes: "^DD",230,230,4,23,2,0) "^DD",230,230,4,23,3,0) 1) If the site has chosen to allow free text diagnoses, the list of "^DD",230,230,4,23,4,0) diagnoses entered is stored here. In this case there will be no ICD 9 "^DD",230,230,4,23,5,0) code. Clerical staff will enter the diagnosis list into PCE at a later "^DD",230,230,4,23,6,0) time using information from this list. "^DD",230,230,4,23,7,0) "^DD",230,230,4,23,8,0) 2) If the site has chosen to use coded diagnoses, this multiple is used "^DD",230,230,4,23,9,0) to hold the selected diagnoses until a PCE visit is created. In that "^DD",230,230,4,23,10,0) case, PCE becomes the real holder of the diagnosis list. "^DD",230,230,4,23,11,0) "^DD",230,230,4,23,12,0) The parameter that controls the behavior of this list is in the TRACKING "^DD",230,230,4,23,13,0) AREA file (231.9). "^DD",230,230,8,0) ORDERS^230.08A^^8;0 "^DD",230,230,8,21,0) ^^2^2^3080912^ "^DD",230,230,8,21,1,0) This multiple tracks orders during the course of the patient stay in the "^DD",230,230,8,21,2,0) emergency department. "^DD",230,230,8,23,0) ^^6^6^3080912^ "^DD",230,230,8,23,1,0) This multiple is populated by an order entry event monitor, which "^DD",230,230,8,23,2,0) identifies orders related to the current emergency department visit. The "^DD",230,230,8,23,3,0) display board is refreshed frequently (every few seconds). The board "^DD",230,230,8,23,4,0) constantly shows the status of emergency department related orders, and "^DD",230,230,8,23,5,0) this multiple allows a quick up to date display. It allows the reports to "^DD",230,230,8,23,6,0) track the history of orders related to an emergency department visit. "^DD",230,230.04,0) DISCHARGE DIAGNOSIS SUB-FIELD^^.03^3 "^DD",230,230.04,0,"DT") 3081008 "^DD",230,230.04,0,"IX","B",230.04,.01) "^DD",230,230.04,0,"NM","DISCHARGE DIAGNOSIS") "^DD",230,230.04,0,"UP") 230 "^DD",230,230.04,.01,0) DISCHARGE DIAGNOSIS^MF^^0;1^K:$L(X)>50!($L(X)<1) X "^DD",230,230.04,.01,1,0) ^.1 "^DD",230,230.04,.01,1,1,0) 230.04^B "^DD",230,230.04,.01,1,1,1) S ^EDP(230,DA(1),4,"B",$E(X,1,30),DA)="" "^DD",230,230.04,.01,1,1,2) K ^EDP(230,DA(1),4,"B",$E(X,1,30),DA) "^DD",230,230.04,.01,3) Answer must be 1-50 characters in length. "^DD",230,230.04,.01,21,0) ^.001^1^1^3081010^^^ "^DD",230,230.04,.01,21,1,0) This is the free text of the diagnosis. "^DD",230,230.04,.01,23,0) ^^4^4^3081010^ "^DD",230,230.04,.01,23,1,0) If the parameters are set so that coded diagnoses will be required, the "^DD",230,230.04,.01,23,2,0) text will match the Clinical Lexicon text. Some Clinical Lexicon entries "^DD",230,230.04,.01,23,3,0) map to more than one ICD code. $$ICDONE^LEXU is used to determine which "^DD",230,230.04,.01,23,4,0) code to store here. "^DD",230,230.04,.01,"DT") 3070720 "^DD",230,230.04,.02,0) ICD9 CODE^P80'^ICD9(^0;2^Q "^DD",230,230.04,.02,3) Select the ICD Code for this diagnosis. "^DD",230,230.04,.02,21,0) ^.001^1^1^3081010^^^^ "^DD",230,230.04,.02,21,1,0) This is the ICD code for the diagnosis. "^DD",230,230.04,.02,23,0) ^^4^4^3081010^ "^DD",230,230.04,.02,23,1,0) Clinical Lexicon utilities are used by the application to look up "^DD",230,230.04,.02,23,2,0) diagnoses. Some Clinical Lexicon entries map to more than one ICD code. "^DD",230,230.04,.02,23,3,0) $$ICDONE^LEXU is used to determine which code to store here. This also "^DD",230,230.04,.02,23,4,0) becomes the code that is stored in PCE. "^DD",230,230.04,.02,"DT") 3081008 "^DD",230,230.04,.03,0) PRIMARY^S^0:NO (secondary);1:YES (primary);^0;3^Q "^DD",230,230.04,.03,3) Enter 'yes' if this is the primary diagnosis. "^DD",230,230.04,.03,21,0) ^^2^2^3080912^ "^DD",230,230.04,.03,21,1,0) This flag indicates which of the diagnoses is to be considered the "^DD",230,230.04,.03,21,2,0) primary diagnosis. "^DD",230,230.04,.03,"DT") 3080605 "^DD",230,230.08,0) ORDERS SUB-FIELD^^.05^5 "^DD",230,230.08,0,"DT") 3081003 "^DD",230,230.08,0,"IX","AC",230.08,.02) "^DD",230,230.08,0,"IX","B",230.08,.01) "^DD",230,230.08,0,"NM","ORDERS") "^DD",230,230.08,0,"UP") 230 "^DD",230,230.08,.01,0) ORDER^MF^^0;1^K:$L(X)>30!($L(X)<1) X "^DD",230,230.08,.01,1,0) ^.1 "^DD",230,230.08,.01,1,1,0) 230.08^B "^DD",230,230.08,.01,1,1,1) S ^EDP(230,DA(1),8,"B",$E(X,1,30),DA)="" "^DD",230,230.08,.01,1,1,2) K ^EDP(230,DA(1),8,"B",$E(X,1,30),DA) "^DD",230,230.08,.01,3) Answer must be 1-30 characters in length. "^DD",230,230.08,.01,21,0) ^^1^1^3080912^ "^DD",230,230.08,.01,21,1,0) This is the order id for an emergency department related order. "^DD",230,230.08,.01,"DT") 3080527 "^DD",230,230.08,.02,0) SERVICE^S^M:Medication;L:Lab;R:Radiology;C:Consult;A:All Other;^0;2^Q "^DD",230,230.08,.02,1,0) ^.1 "^DD",230,230.08,.02,1,1,0) 230.08^AC "^DD",230,230.08,.02,1,1,1) S ^EDP(230,DA(1),8,"AC",$E(X,1,30),DA)="" "^DD",230,230.08,.02,1,1,2) K ^EDP(230,DA(1),8,"AC",$E(X,1,30),DA) "^DD",230,230.08,.02,1,1,"%D",0) ^^2^2^3071115^ "^DD",230,230.08,.02,1,1,"%D",1,0) Allows quick check for the existence of various types of orders for this "^DD",230,230.08,.02,1,1,"%D",2,0) ED visit. "^DD",230,230.08,.02,1,1,"DT") 3071115 "^DD",230,230.08,.02,3) Select the service filling the order. "^DD",230,230.08,.02,21,0) ^.001^2^2^3081003^^ "^DD",230,230.08,.02,21,1,0) This is a general identification of the service to which the order is "^DD",230,230.08,.02,21,2,0) related. "^DD",230,230.08,.02,"DT") 3081003 "^DD",230,230.08,.03,0) STATUS^S^N:New;A:Active;C:Complete;^0;3^Q "^DD",230,230.08,.03,3) Select the current status of the order. "^DD",230,230.08,.03,21,0) ^.001^1^1^3081003^^ "^DD",230,230.08,.03,21,1,0) This is the general status of the order. "^DD",230,230.08,.03,23,0) ^.001^2^2^3081003^^ "^DD",230,230.08,.03,23,1,0) The status may be used to highlight orders on the display board and "^DD",230,230.08,.03,23,2,0) monitor for those that have been outstanding too long. "^DD",230,230.08,.03,"DT") 3081003 "^DD",230,230.08,.04,0) STAT^S^1:Stat;0:Not Stat;^0;4^Q "^DD",230,230.08,.04,3) Enter stat if this is a stat order. "^DD",230,230.08,.04,21,0) ^.001^1^1^3081003^^ "^DD",230,230.08,.04,21,1,0) This flag identifies the order as being STAT. "^DD",230,230.08,.04,23,0) ^.001^1^1^3081003^^ "^DD",230,230.08,.04,23,1,0) STAT orders may be optionally highlighted by color on the display board. "^DD",230,230.08,.04,"DT") 3081003 "^DD",230,230.08,.05,0) RELEASE TIME^D^^0;5^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X "^DD",230,230.08,.05,3) Enter the date/time the order was released to the filling service. "^DD",230,230.08,.05,21,0) ^^2^2^3080912^ "^DD",230,230.08,.05,21,1,0) This is the time the order was released to the service. It is used to "^DD",230,230.08,.05,21,2,0) monitor orders that may be delayed. "^DD",230,230.08,.05,"DT") 3071115 "^DD",230.1,230.1,0) FIELD^^.14^22 "^DD",230.1,230.1,0,"DDA") N "^DD",230.1,230.1,0,"DT") 3081215 "^DD",230.1,230.1,0,"IX","B",230.1,.01) "^DD",230.1,230.1,0,"NM","ED LOG HISTORY") "^DD",230.1,230.1,0,"VRPK") EMERGENCY DEPARTMENT "^DD",230.1,230.1,.01,0) LOG ENTRY^RP230'^EDP(230,^0;1^Q "^DD",230.1,230.1,.01,1,0) ^.1 "^DD",230.1,230.1,.01,1,1,0) 230.1^B "^DD",230.1,230.1,.01,1,1,1) S ^EDP(230.1,"B",$E(X,1,30),DA)="" "^DD",230.1,230.1,.01,1,1,2) K ^EDP(230.1,"B",$E(X,1,30),DA) "^DD",230.1,230.1,.01,3) Select ED LOG entry. "^DD",230.1,230.1,.01,21,0) ^^2^2^3080912^ "^DD",230.1,230.1,.01,21,1,0) This references an entry in the ED LOG file. Entries in this file record "^DD",230.1,230.1,.01,21,2,0) modifications to entries in the ED LOG file. "^DD",230.1,230.1,.01,"DT") 3081016 "^DD",230.1,230.1,.02,0) TIME^RD^^0;2^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X "^DD",230.1,230.1,.02,3) Enter time of modification. "^DD",230.1,230.1,.02,21,0) ^.001^1^1^3080912^^ "^DD",230.1,230.1,.02,21,1,0) This is the time that the log record was modified. "^DD",230.1,230.1,.02,"DT") 3081016 "^DD",230.1,230.1,.03,0) ENTERED BY^RP200'^VA(200,^0;3^Q "^DD",230.1,230.1,.03,3) Select the person responsible for this update. "^DD",230.1,230.1,.03,21,0) ^.001^1^1^3081004^^ "^DD",230.1,230.1,.03,21,1,0) This is the person who updated the log. "^DD",230.1,230.1,.03,"DT") 3080912 "^DD",230.1,230.1,.04,0) PATIENT NAME^F^^0;4^K:$L(X)>40!($L(X)<3) X "^DD",230.1,230.1,.04,3) Answer must be 3-40 characters in length. "^DD",230.1,230.1,.04,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.04,21,1,0) If updated, this is the updated value of the patient name. "^DD",230.1,230.1,.04,"DT") 3071123 "^DD",230.1,230.1,.05,0) PATIENT SSN*^F^^0;5^K:$L(X)>10!($L(X)<1) X "^DD",230.1,230.1,.05,3) Answer must be 1-10 characters in length. "^DD",230.1,230.1,.05,21,0) ^^2^2^3080912^ "^DD",230.1,230.1,.05,21,1,0) If updated, this is the updated value of the patient social security "^DD",230.1,230.1,.05,21,2,0) number. "^DD",230.1,230.1,.05,23,0) ^^3^3^3080912^ "^DD",230.1,230.1,.05,23,1,0) The social security number was recorded in the class 3 product in the "^DD",230.1,230.1,.05,23,2,0) case that a patient without a DFN came to the emergency room. It is not "^DD",230.1,230.1,.05,23,3,0) currently used, but is here for compatibility with the class 3 version. "^DD",230.1,230.1,.05,"DT") 3080305 "^DD",230.1,230.1,.06,0) PATIENT ID^P2'^DPT(^0;6^Q "^DD",230.1,230.1,.06,3) Select the patient. "^DD",230.1,230.1,.06,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.06,21,1,0) If updated, this is the updated value of the patient DFN. "^DD",230.1,230.1,.06,"DT") 3080305 "^DD",230.1,230.1,.07,0) COMPLAINT^F^^0;7^K:$L(X)>50!($L(X)<1) X "^DD",230.1,230.1,.07,3) Answer must be 1-50 characters in length. "^DD",230.1,230.1,.07,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.07,21,1,0) If updated, this is the updated value of the complaint. "^DD",230.1,230.1,.07,"DT") 3071123 "^DD",230.1,230.1,.08,0) TIME IN^D^^0;8^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230.1,230.1,.08,3) Enter the arrival time of the patient. "^DD",230.1,230.1,.08,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.08,21,1,0) If updated, this is the updated value of the arrival time of the patient. "^DD",230.1,230.1,.08,"DT") 3071123 "^DD",230.1,230.1,.09,0) TIME OUT^D^^0;9^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X "^DD",230.1,230.1,.09,3) Enter the departure time. "^DD",230.1,230.1,.09,21,0) ^^2^2^3080912^ "^DD",230.1,230.1,.09,21,1,0) If updated, this is the updated value of the departure time of the "^DD",230.1,230.1,.09,21,2,0) patient. "^DD",230.1,230.1,.09,"DT") 3071123 "^DD",230.1,230.1,.1,0) ARRIVAL MODE^P233.1'^EDPB(233.1,^0;10^Q "^DD",230.1,230.1,.1,3) Enter the source of the patient visit. "^DD",230.1,230.1,.1,21,0) ^.001^2^2^3080912^^ "^DD",230.1,230.1,.1,21,1,0) If updated, this is the updated value of the source of the patient visit "^DD",230.1,230.1,.1,21,2,0) (came from nursing home, hospital ward, walk-in). "^DD",230.1,230.1,.1,"DT") 3071123 "^DD",230.1,230.1,.11,0) DISPOSITION^P233.1'^EDPB(233.1,^0;11^Q "^DD",230.1,230.1,.11,3) Enter the disposition. "^DD",230.1,230.1,.11,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.11,21,1,0) If updated, this is the updated value of the disposition. "^DD",230.1,230.1,.11,"DT") 3071123 "^DD",230.1,230.1,.12,0) DELAY^P233.1'^EDPB(233.1,^0;12^Q "^DD",230.1,230.1,.12,3) Enter the delay reason. "^DD",230.1,230.1,.12,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,.12,21,1,0) If updated, this is the updated value of the delay reason. "^DD",230.1,230.1,.12,"DT") 3071123 "^DD",230.1,230.1,.14,0) CLINIC^P44'^SC(^0;14^Q "^DD",230.1,230.1,.14,3) Select a clinic. "^DD",230.1,230.1,.14,21,0) ^^1^1^3081215^ "^DD",230.1,230.1,.14,21,1,0) If updated, this is the updated value of the clinic. "^DD",230.1,230.1,.14,"DT") 3081215 "^DD",230.1,230.1,2,0) COMPLAINT (LONG)^F^^2;1^K:$L(X)>220!($L(X)<1) X "^DD",230.1,230.1,2,3) Answer must be 1-220 characters in length. "^DD",230.1,230.1,2,21,0) ^^2^2^3080912^ "^DD",230.1,230.1,2,21,1,0) If updated, this is the updated value of the long complaint (the optional "^DD",230.1,230.1,2,21,2,0) complaint that may be longer than the display board allows). "^DD",230.1,230.1,2,"DT") 3071129 "^DD",230.1,230.1,3.2,0) STATUS^P233.1'^EDPB(233.1,^3;2^Q "^DD",230.1,230.1,3.2,3) Select a status. "^DD",230.1,230.1,3.2,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,3.2,21,1,0) If updated, this is the updated value of the status. "^DD",230.1,230.1,3.2,"DT") 3071129 "^DD",230.1,230.1,3.3,0) ACUITY^P233.1'^EDPB(233.1,^3;3^Q "^DD",230.1,230.1,3.3,3) Select an acuity level. "^DD",230.1,230.1,3.3,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,3.3,21,1,0) If updated, this is the updated value of the acuity. "^DD",230.1,230.1,3.3,"DT") 3071129 "^DD",230.1,230.1,3.4,0) LOC^P231.8'^EDPB(231.8,^3;4^Q "^DD",230.1,230.1,3.4,3) Select a room/area "^DD",230.1,230.1,3.4,21,0) ^.001^1^1^3080912^^ "^DD",230.1,230.1,3.4,21,1,0) If updated, this is the updated value of the room / area. "^DD",230.1,230.1,3.4,"DT") 3071129 "^DD",230.1,230.1,3.5,0) MD ASSIGNED^P200'^VA(200,^3;5^Q "^DD",230.1,230.1,3.5,3) Select a provider. "^DD",230.1,230.1,3.5,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,3.5,21,1,0) If updated, this is the updated provider. "^DD",230.1,230.1,3.5,"DT") 3080305 "^DD",230.1,230.1,3.6,0) NURSE ASSIGNED^P200'^VA(200,^3;6^Q "^DD",230.1,230.1,3.6,3) Select a nurse. "^DD",230.1,230.1,3.6,21,0) ^.001^1^1^3080912^^ "^DD",230.1,230.1,3.6,21,1,0) If updated, this is the updated nurse. "^DD",230.1,230.1,3.6,"DT") 3080305 "^DD",230.1,230.1,3.7,0) RESIDENT ASSIGNED^P200'^VA(200,^3;7^Q "^DD",230.1,230.1,3.7,3) Select a resident. "^DD",230.1,230.1,3.7,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,3.7,21,1,0) If updated, this is the updated resident. "^DD",230.1,230.1,3.7,"DT") 3080305 "^DD",230.1,230.1,3.8,0) COMMENT^F^^3;8^K:$L(X)>80!($L(X)<1) X "^DD",230.1,230.1,3.8,3) Answer must be 1-80 characters in length. "^DD",230.1,230.1,3.8,21,0) ^^1^1^3080912^ "^DD",230.1,230.1,3.8,21,1,0) If updated, this is the updated comment. "^DD",230.1,230.1,3.8,"DT") 3071129 "^DD",230.1,230.1,9.1,0) MODIFIED FIELDS^F^^9;1^K:$L(X)>100!($L(X)<1) X "^DD",230.1,230.1,9.1,3) Answer must be 1-100 characters in length. "^DD",230.1,230.1,9.1,21,0) ^^3^3^3080912^ "^DD",230.1,230.1,9.1,21,1,0) This lists the fields that were modified in the corresponding ED LOG "^DD",230.1,230.1,9.1,21,2,0) record at the time of this update. The list contains the field numbers "^DD",230.1,230.1,9.1,21,3,0) and is semi-colon delimited. "^DD",230.1,230.1,9.1,"DT") 3080411 "^DD",231.7,231.7,0) FIELD^^.08^8 "^DD",231.7,231.7,0,"DDA") N "^DD",231.7,231.7,0,"DT") 3081008 "^DD",231.7,231.7,0,"IX","B",231.7,.01) "^DD",231.7,231.7,0,"NM","TRACKING STAFF") "^DD",231.7,231.7,0,"VRPK") EMERGENCY DEPARTMENT "^DD",231.7,231.7,.01,0) PERSON^RP200'^VA(200,^0;1^Q "^DD",231.7,231.7,.01,1,0) ^.1 "^DD",231.7,231.7,.01,1,1,0) 231.7^B "^DD",231.7,231.7,.01,1,1,1) S ^EDPB(231.7,"B",$E(X,1,30),DA)="" "^DD",231.7,231.7,.01,1,1,2) K ^EDPB(231.7,"B",$E(X,1,30),DA) "^DD",231.7,231.7,.01,3) Select a provider, resident, or nurse. "^DD",231.7,231.7,.01,21,0) ^^2^2^3080912^ "^DD",231.7,231.7,.01,21,1,0) This is a person who is assigned to work as staff in the emergency "^DD",231.7,231.7,.01,21,2,0) department. "^DD",231.7,231.7,.01,"DT") 3080305 "^DD",231.7,231.7,.02,0) INSTITUTION^RP4'^DIC(4,^0;2^Q "^DD",231.7,231.7,.02,3) Select the institution for this staff list. "^DD",231.7,231.7,.02,21,0) ^^1^1^3081008^ "^DD",231.7,231.7,.02,21,1,0) This allows each station to have its own set of staff assignments. "^DD",231.7,231.7,.02,"DT") 3081008 "^DD",231.7,231.7,.03,0) AREA^P231.9'^EDPB(231.9,^0;3^Q "^DD",231.7,231.7,.03,3) Select an area for this person. "^DD",231.7,231.7,.03,21,0) ^^1^1^3080912^ "^DD",231.7,231.7,.03,21,1,0) This is the area to which the person is assigned as staff. "^DD",231.7,231.7,.03,23,0) ^^2^2^3080912^ "^DD",231.7,231.7,.03,23,1,0) The only area currently supported is the emergency department, but "^DD",231.7,231.7,.03,23,2,0) expansion into other areas is anticipated. "^DD",231.7,231.7,.03,"DT") 3080305 "^DD",231.7,231.7,.04,0) INACTIVE^S^0:ACTIVE;1:INACTIVE;^0;4^Q "^DD",231.7,231.7,.04,3) Enter 'active' or 'inactive'. "^DD",231.7,231.7,.04,21,0) ^^2^2^3080912^ "^DD",231.7,231.7,.04,21,1,0) This flag is set to 'inactive' when the person is no longer an active "^DD",231.7,231.7,.04,21,2,0) member of the staff for this area. "^DD",231.7,231.7,.04,"DT") 3071124 "^DD",231.7,231.7,.05,0) LOCAL ID*^F^^0;5^K:$L(X)>12!($L(X)<1) X "^DD",231.7,231.7,.05,3) Answer must be 1-12 characters in length. "^DD",231.7,231.7,.05,"DT") 3080305 "^DD",231.7,231.7,.06,0) ROLE^S^P:Provider;R:Resident;N:Nurse;^0;6^Q "^DD",231.7,231.7,.06,3) Enter the role (provider, nurse, resident). "^DD",231.7,231.7,.06,21,0) ^^2^2^3080912^ "^DD",231.7,231.7,.06,21,1,0) This is the role the person has on the staff. The roles currently "^DD",231.7,231.7,.06,21,2,0) supported are provider, nurse, and resident. "^DD",231.7,231.7,.06,"DT") 3081005 "^DD",231.7,231.7,.07,0) INITIALS*^F^^0;7^K:$L(X)>7!($L(X)<1) X "^DD",231.7,231.7,.07,3) Answer must be 1-7 characters in length. "^DD",231.7,231.7,.07,"DT") 3080305 "^DD",231.7,231.7,.08,0) COLOR^F^^0;8^K:$L(X)>20!($L(X)<1) X "^DD",231.7,231.7,.08,3) Answer must be 1-20 characters in length. "^DD",231.7,231.7,.08,21,0) ^^2^2^3080912^ "^DD",231.7,231.7,.08,21,1,0) This contains the RGB values for the foreground and background colors "^DD",231.7,231.7,.08,21,2,0) used to highlight this person on the display board. "^DD",231.7,231.7,.08,23,0) ^^9^9^3080912^ "^DD",231.7,231.7,.08,23,1,0) The format of the color map for a person is: "^DD",231.7,231.7,.08,23,2,0) "^DD",231.7,231.7,.08,23,3,0) ,, "^DD",231.7,231.7,.08,23,4,0) "^DD",231.7,231.7,.08,23,5,0) All colors are represented in hexadecimal. For example, "^DD",231.7,231.7,.08,23,6,0) "^DD",231.7,231.7,.08,23,7,0) 1,0xff0000,0xffffff "^DD",231.7,231.7,.08,23,8,0) "^DD",231.7,231.7,.08,23,9,0) means to use color, foreground color is red, background color is white. "^DD",231.7,231.7,.08,"DT") 3071124 "^DD",231.8,231.8,0) FIELD^^.12^12 "^DD",231.8,231.8,0,"DDA") N "^DD",231.8,231.8,0,"DT") 3081008 "^DD",231.8,231.8,0,"IX","B",231.8,.01) "^DD",231.8,231.8,0,"NM","TRACKING ROOM-BED") "^DD",231.8,231.8,0,"PT",230,3.4) "^DD",231.8,231.8,0,"PT",230.1,3.4) "^DD",231.8,231.8,0,"PT",231.9,1.11) "^DD",231.8,231.8,0,"PT",231.9,1.12) "^DD",231.8,231.8,0,"VRPK") EMERGENCY DEPARTMENT "^DD",231.8,231.8,.01,0) NAME^RF^^0;1^K:$L(X)>30!($L(X)<2)!'(X'?1P.E) X "^DD",231.8,231.8,.01,1,0) ^.1 "^DD",231.8,231.8,.01,1,1,0) 231.8^B "^DD",231.8,231.8,.01,1,1,1) S ^EDPB(231.8,"B",$E(X,1,30),DA)="" "^DD",231.8,231.8,.01,1,1,2) K ^EDPB(231.8,"B",$E(X,1,30),DA) "^DD",231.8,231.8,.01,3) Answer must be 2-30 characters in length. "^DD",231.8,231.8,.01,21,0) ^^2^2^3080915^ "^DD",231.8,231.8,.01,21,1,0) This is the internal name of the room, bed, or area that a patient may be "^DD",231.8,231.8,.01,21,2,0) during the course of their visit. "^DD",231.8,231.8,.01,"DT") 3080915 "^DD",231.8,231.8,.02,0) INSTITUTION^P4'^DIC(4,^0;2^Q "^DD",231.8,231.8,.02,3) Select the institution for this bed, room, or area. "^DD",231.8,231.8,.02,21,0) ^^2^2^3081008^ "^DD",231.8,231.8,.02,21,1,0) This allows each station (division, for example) to manage its own set of "^DD",231.8,231.8,.02,21,2,0) rooms / beds / areas. "^DD",231.8,231.8,.02,"DT") 3081008 "^DD",231.8,231.8,.03,0) AREA^P231.9'^EDPB(231.9,^0;3^Q "^DD",231.8,231.8,.03,3) Enter the hospital area for this room/bed/area. "^DD",231.8,231.8,.03,21,0) ^^3^3^3080915^ "^DD",231.8,231.8,.03,21,1,0) This is the area in the hospital associated with this room or bed. "^DD",231.8,231.8,.03,21,2,0) Initially, the only area supported is the emergency department. It is "^DD",231.8,231.8,.03,21,3,0) expected that additional areas will be supported in the future. "^DD",231.8,231.8,.03,23,0) ^^2^2^3080915^ "^DD",231.8,231.8,.03,23,1,0) For training classes, a separate area may be set up for each user so that "^DD",231.8,231.8,.03,23,2,0) they may configure their own set of rooms/beds. "^DD",231.8,231.8,.03,"DT") 3080111 "^DD",231.8,231.8,.04,0) INACTIVE^S^0:ACTIVE;1:INACTIVE;^0;4^Q "^DD",231.8,231.8,.04,3) Enter 'INACTIVE' to disallow use of this room/bed/area. "^DD",231.8,231.8,.04,21,0) ^^1^1^3080915^ "^DD",231.8,231.8,.04,21,1,0) This flag is used to mark a room/bed/area as out of service. "^DD",231.8,231.8,.04,23,0) ^^3^3^3080915^ "^DD",231.8,231.8,.04,23,1,0) When a room is marked inactive, it is no longer available for selection "^DD",231.8,231.8,.04,23,2,0) in EDIS. However, the room will still show up on reports and entry "^DD",231.8,231.8,.04,23,3,0) screens for previous entries. "^DD",231.8,231.8,.04,"DT") 3070911 "^DD",231.8,231.8,.05,0) SEQUENCE^NJ7,2^^0;5^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."3N.N) X "^DD",231.8,231.8,.05,3) Type a Number between 1 and 9999, 2 Decimal Digits "^DD",231.8,231.8,.05,21,0) ^^2^2^3080915^ "^DD",231.8,231.8,.05,21,1,0) This is the sequence for displaying the room/bed/area on the large "^DD",231.8,231.8,.05,21,2,0) display board. "^DD",231.8,231.8,.05,"DT") 3070911 "^DD",231.8,231.8,.06,0) DISPLAY NAME^F^^0;6^K:$L(X)>30!($L(X)<1) X "^DD",231.8,231.8,.06,3) Answer must be 1-30 characters in length. "^DD",231.8,231.8,.06,21,0) ^^2^2^3080915^ "^DD",231.8,231.8,.06,21,1,0) This is the name that is shown on the large display board. It should be "^DD",231.8,231.8,.06,21,2,0) concise or abbreviated to save space on the display board. "^DD",231.8,231.8,.06,"DT") 3080111 "^DD",231.8,231.8,.07,0) DISPLAY WHEN^S^0:OCCUPIED;1:ALWAYS;2:NEVER;^0;7^Q "^DD",231.8,231.8,.07,3) Enter when this room/bed/area should be shown on the display board. "^DD",231.8,231.8,.07,21,0) ^^3^3^3081010^ "^DD",231.8,231.8,.07,21,1,0) This indicates when the room/bed/area should show up on the large display "^DD",231.8,231.8,.07,21,2,0) board. The room may always show, show only if currently occupied by a "^DD",231.8,231.8,.07,21,3,0) patient, or never show. "^DD",231.8,231.8,.07,"DT") 3070912 "^DD",231.8,231.8,.08,0) DEFAULT STATUS^P233.1'^EDPB(233.1,^0;8^Q "^DD",231.8,231.8,.08,3) Enter the status that should be assigned, if any, when this room/area is selected. "^DD",231.8,231.8,.08,21,0) ^^4^4^3080915^ "^DD",231.8,231.8,.08,21,1,0) If populated, the default status is automatically assigned to the entry "^DD",231.8,231.8,.08,21,2,0) in the ED LOG file when the room/bed/area is selected. For example, you "^DD",231.8,231.8,.08,21,3,0) might want to automatically assign the status, Awaiting Triage, when the "^DD",231.8,231.8,.08,21,4,0) patient is assigned to the waiting room. "^DD",231.8,231.8,.08,"DT") 3070911 "^DD",231.8,231.8,.09,0) MULTIPLE ASSIGN^S^0:Single;1:Multiple;2:Waiting;3:Single Non-ED;4:Multiple Non-ED;^0;9^Q "^DD",231.8,231.8,.09,3) Enter 'single' to allow only one patient at a time, 'waiting' for waiting areas, 'non-ED' for areas outside the emergency department. "^DD",231.8,231.8,.09,21,0) ^^6^6^3080915^ "^DD",231.8,231.8,.09,21,1,0) This field affects the behavior of the room for data entry and reports. "^DD",231.8,231.8,.09,21,2,0) If single, only one patient at a time may be assigned to the room. Exam "^DD",231.8,231.8,.09,21,3,0) rooms are a common example. If multiple, multiple patients may be "^DD",231.8,231.8,.09,21,4,0) simultaneously assigned to the room. Waiting is a special case to "^DD",231.8,231.8,.09,21,5,0) identify waiting areas in the reports. Non-ED indicates an area where the "^DD",231.8,231.8,.09,21,6,0) patient may be that is outside the emergency department itself. "^DD",231.8,231.8,.09,"DT") 3080512 "^DD",231.8,231.8,.1,0) SHARED NAME^F^^0;10^K:$L(X)>30!($L(X)<1) X "^DD",231.8,231.8,.1,3) Answer must be 1-30 characters in length. "^DD",231.8,231.8,.1,21,0) ^^3^3^3080915^ "^DD",231.8,231.8,.1,21,1,0) If several beds or areas share the same physical space, use this field to "^DD",231.8,231.8,.1,21,2,0) create a common name for these beds/areas. By having this shared name, "^DD",231.8,231.8,.1,21,3,0) the reports may by used to identify exposures to contagious organisms. "^DD",231.8,231.8,.1,"DT") 3070911 "^DD",231.8,231.8,.11,0) BOARD^F^^0;11^K:$L(X)>30!($L(X)<1) X "^DD",231.8,231.8,.11,3) Answer must be 1-30 characters in length. "^DD",231.8,231.8,.11,21,0) ^^2^2^3080915^ "^DD",231.8,231.8,.11,21,1,0) An entry in this field indicates that the room/area should be displayed "^DD",231.8,231.8,.11,21,2,0) on a specific board that uses the name entered here. "^DD",231.8,231.8,.11,"DT") 3071030 "^DD",231.8,231.8,.12,0) COLOR^F^^0;12^K:$L(X)>20!($L(X)<1) X "^DD",231.8,231.8,.12,3) Answer must be 1-20 characters in length. "^DD",231.8,231.8,.12,21,0) ^^2^2^3080915^ "^DD",231.8,231.8,.12,21,1,0) A specific room/area may be mapped to a particular foreground and "^DD",231.8,231.8,.12,21,2,0) background color for use with the display board. "^DD",231.8,231.8,.12,23,0) ^^9^9^3080915^ "^DD",231.8,231.8,.12,23,1,0) The format for color is: "^DD",231.8,231.8,.12,23,2,0) "^DD",231.8,231.8,.12,23,3,0) ,, "^DD",231.8,231.8,.12,23,4,0) "^DD",231.8,231.8,.12,23,5,0) For example, "^DD",231.8,231.8,.12,23,6,0) "^DD",231.8,231.8,.12,23,7,0) 1,0x0,0xff0000 "^DD",231.8,231.8,.12,23,8,0) "^DD",231.8,231.8,.12,23,9,0) is a red font on a black background. "^DD",231.8,231.8,.12,"DT") 3071123 "^DD",231.9,231.9,0) FIELD^^1.9^18 "^DD",231.9,231.9,0,"DDA") N "^DD",231.9,231.9,0,"DT") 3081215 "^DD",231.9,231.9,0,"IX","B",231.9,.01) "^DD",231.9,231.9,0,"IX","C",231.9,.02) "^DD",231.9,231.9,0,"NM","TRACKING AREA") "^DD",231.9,231.9,0,"PT",230,.03) "^DD",231.9,231.9,0,"PT",231.7,.03) "^DD",231.9,231.9,0,"PT",231.8,.03) "^DD",231.9,231.9,0,"VRPK") EMERGENCY DEPARTMENT "^DD",231.9,231.9,.01,0) NAME^RF^^0;1^K:$L(X)>30!($L(X)<3)!'(X'?1P.E) X "^DD",231.9,231.9,.01,1,0) ^.1 "^DD",231.9,231.9,.01,1,1,0) 231.9^B "^DD",231.9,231.9,.01,1,1,1) S ^EDPB(231.9,"B",$E(X,1,30),DA)="" "^DD",231.9,231.9,.01,1,1,2) K ^EDPB(231.9,"B",$E(X,1,30),DA) "^DD",231.9,231.9,.01,3) Answer must be 3-30 characters in length. "^DD",231.9,231.9,.01,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,.01,21,1,0) This is the name for an area within the hospital. Emergency Department "^DD",231.9,231.9,.01,21,2,0) is the only area currently supported. "^DD",231.9,231.9,.01,"DT") 3080915 "^DD",231.9,231.9,.02,0) INSTITUTION^RP4'^DIC(4,^0;2^Q "^DD",231.9,231.9,.02,1,0) ^.1 "^DD",231.9,231.9,.02,1,1,0) 231.9^C "^DD",231.9,231.9,.02,1,1,1) S ^EDPB(231.9,"C",$E(X,1,30),DA)="" "^DD",231.9,231.9,.02,1,1,2) K ^EDPB(231.9,"C",$E(X,1,30),DA) "^DD",231.9,231.9,.02,1,1,"%D",0) ^^1^1^3081010^ "^DD",231.9,231.9,.02,1,1,"%D",1,0) This allows finding an area within a specific division. "^DD",231.9,231.9,.02,1,1,"DT") 3070913 "^DD",231.9,231.9,.02,3) Select the instutition for this area. "^DD",231.9,231.9,.02,21,0) ^^2^2^3081008^ "^DD",231.9,231.9,.02,21,1,0) This allows each station served by the VistA system to have its own set of "^DD",231.9,231.9,.02,21,2,0) areas. "^DD",231.9,231.9,.02,"DT") 3081008 "^DD",231.9,231.9,.03,0) LAST UPDATE^D^^0;3^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X "^DD",231.9,231.9,.03,3) Enter the date/time the configuration changed. "^DD",231.9,231.9,.03,21,0) ^^3^3^3080915^ "^DD",231.9,231.9,.03,21,1,0) This is the date/time that the configuration was last updated. This "^DD",231.9,231.9,.03,21,2,0) helps the client or display board know whether it is necessary to reload "^DD",231.9,231.9,.03,21,3,0) the configuration parameters. "^DD",231.9,231.9,.03,"DT") 3080502 "^DD",231.9,231.9,1.1,0) DIAGNOSIS REQUIRED^S^0:NO;1:YES;^1;1^Q "^DD",231.9,231.9,1.1,3) Enter 'YES' if a diagnosis must be entered before removing the patient from the board. "^DD",231.9,231.9,1.1,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,1.1,21,1,0) This is true if a diagnosis must be entered before removing a patient "^DD",231.9,231.9,1.1,21,2,0) from the display board. "^DD",231.9,231.9,1.1,"DT") 3071015 "^DD",231.9,231.9,1.11,0) AMBULANCE^P231.8'^EDPB(231.8,^1;11^Q "^DD",231.9,231.9,1.11,3) Select the room/area that represents an arriving ambulance. "^DD",231.9,231.9,1.11,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,1.11,21,1,0) This field identifies which entry in the TRACKING ROOM-BED represents an "^DD",231.9,231.9,1.11,21,2,0) arriving ambulance. "^DD",231.9,231.9,1.11,"DT") 3080514 "^DD",231.9,231.9,1.12,0) INITIAL ROOM^P231.8'^EDPB(231.8,^1;12^Q "^DD",231.9,231.9,1.12,3) Enter the room/area that is initially assigned. "^DD",231.9,231.9,1.12,21,0) ^^3^3^3080915^ "^DD",231.9,231.9,1.12,21,1,0) This field refers to the entry in the TRACKING ROOM-BED file that should "^DD",231.9,231.9,1.12,21,2,0) be initially assigned to a patient when the patient is first added to the "^DD",231.9,231.9,1.12,21,3,0) board (the default room). Often this is the waiting room. "^DD",231.9,231.9,1.12,"DT") 3080514 "^DD",231.9,231.9,1.2,0) CODED DIAGNOSIS^S^0:NO;1:YES;^1;2^Q "^DD",231.9,231.9,1.2,3) Enter YES if the diagnosis is required to be an ICD9 code. "^DD",231.9,231.9,1.2,21,0) ^^2^2^3080922^ "^DD",231.9,231.9,1.2,21,1,0) This is set to YES if the diagnosis is required to be an ICD9 code. "^DD",231.9,231.9,1.2,21,2,0) Otherwise, the diagnosis may be free text. "^DD",231.9,231.9,1.2,"DT") 3071015 "^DD",231.9,231.9,1.3,0) DISPOSITION REQUIRED^S^0:NO;1:YES;^1;3^Q "^DD",231.9,231.9,1.3,3) Enter 'YES' if a disposition must be entered before removing patient from the board. "^DD",231.9,231.9,1.3,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,1.3,21,1,0) This is true if a disposition must be entered before removing a patient "^DD",231.9,231.9,1.3,21,2,0) from the display board. "^DD",231.9,231.9,1.3,"DT") 3071015 "^DD",231.9,231.9,1.4,0) DELAY REQUIRED^S^0:NO;1:YES;^1;4^Q "^DD",231.9,231.9,1.4,3) Enter 'YES' if a delay reason is required for visits exceeding the pre-set number of minutes allowed. "^DD",231.9,231.9,1.4,21,0) ^^3^3^3080915^ "^DD",231.9,231.9,1.4,21,1,0) This is true if a delay reason must be entered for visits that have "^DD",231.9,231.9,1.4,21,2,0) lasted longer than the number of minutes identified in DELAY MINUTES "^DD",231.9,231.9,1.4,21,3,0) before removing the patient from the board. "^DD",231.9,231.9,1.4,"DT") 3071015 "^DD",231.9,231.9,1.5,0) DELAY MINUTES^NJ4,0^^1;5^K:+X'=X!(X>1440)!(X<1)!(X?.E1"."1N.N) X "^DD",231.9,231.9,1.5,3) Type a Number between 1 and 1440, 0 Decimal Digits "^DD",231.9,231.9,1.5,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,1.5,21,1,0) This represents the number of minutes a visit may last before a delay "^DD",231.9,231.9,1.5,21,2,0) reason is required. "^DD",231.9,231.9,1.5,"DT") 3081010 "^DD",231.9,231.9,1.6,0) FIRST SHIFT START^NJ4,0^^1;6^K:+X'=X!(X>1440)!(X<0)!(X?.E1"."1N.N) X "^DD",231.9,231.9,1.6,3) Type a Number between 0 and 1440, 0 Decimal Digits "^DD",231.9,231.9,1.6,21,0) ^^5^5^3081010^ "^DD",231.9,231.9,1.6,21,1,0) Some of the reports may be generated by shift. This is the time that the "^DD",231.9,231.9,1.6,21,2,0) first shift of the day begins. It is currently assumed that the shifts "^DD",231.9,231.9,1.6,21,3,0) have equal length. "^DD",231.9,231.9,1.6,21,4,0) "^DD",231.9,231.9,1.6,21,5,0) This is the number of minutes past midnight when the first shift begins. "^DD",231.9,231.9,1.6,"DT") 3081010 "^DD",231.9,231.9,1.7,0) SHIFT DURATION^NJ4,0^^1;7^K:+X'=X!(X>1440)!(X<0)!(X?.E1"."1N.N) X "^DD",231.9,231.9,1.7,3) Type a Number between 0 and 1440, 0 Decimal Digits "^DD",231.9,231.9,1.7,21,0) ^^2^2^3080915^ "^DD",231.9,231.9,1.7,21,1,0) This represents the number of minutes the comprise a shift. If the shift "^DD",231.9,231.9,1.7,21,2,0) is 8 hours long, this value would be 480 (8*60). "^DD",231.9,231.9,1.7,"DT") 3081010 "^DD",231.9,231.9,1.8,0) PROMPT RESIDENTS^S^0:NO;1:YES;^1;8^Q "^DD",231.9,231.9,1.8,3) Enter 'YES' if residents should be prompted for. "^DD",231.9,231.9,1.8,21,0) ^^2^2^3081010^ "^DD",231.9,231.9,1.8,21,1,0) This flag is set to YES if residents should be prompted for in addition to "^DD",231.9,231.9,1.8,21,2,0) providers (i.e., the attending provider). "^DD",231.9,231.9,1.8,"DT") 3071130 "^DD",231.9,231.9,1.9,0) PROMPT CLINICS^S^0:NO;1:YES;^1;9^Q "^DD",231.9,231.9,1.9,3) Enter 'YES' if clinics should be prompted for. "^DD",231.9,231.9,1.9,21,0) ^^2^2^3081215^ "^DD",231.9,231.9,1.9,21,1,0) This flag is set to YES if clinics should be prompted for. This allows "^DD",231.9,231.9,1.9,21,2,0) the visit to be created based on an explicitly selected clinic. "^DD",231.9,231.9,1.9,"DT") 3081215 "^DD",231.9,231.9,3,0) COLOR SPEC^231.93^^3;0 "^DD",231.9,231.9,3,21,0) ^^2^2^3080922^ "^DD",231.9,231.9,3,21,1,0) This contains an XML document that is a map of the colors to be used for "^DD",231.9,231.9,3,21,2,0) the display board. "^DD",231.9,231.9,4,0) DISPLAY BOARD CONFIG^231.94A^^4;0 "^DD",231.9,231.9,4,21,0) ^^2^2^3080922^ "^DD",231.9,231.9,4,21,1,0) This multiple contains the XML descriptions of each display board "^DD",231.9,231.9,4,21,2,0) definition. "^DD",231.9,231.9,230.1,0) TRACKING UPDATED^F^^230;1^K:$L(X)>30!($L(X)<1) X "^DD",231.9,231.9,230.1,3) Answer must be 1-30 characters in length. "^DD",231.9,231.9,230.1,21,0) ^.001^2^2^3081017^^^ "^DD",231.9,231.9,230.1,21,1,0) This timestamp is set whenever the data that is shown on any display board "^DD",231.9,231.9,230.1,21,2,0) for an area has been updated. "^DD",231.9,231.9,230.1,23,0) ^^2^2^3081017^ "^DD",231.9,231.9,230.1,23,1,0) The timestamp kept in this field is $H. The $H value is used as a token "^DD",231.9,231.9,230.1,23,2,0) by the client to know that tracking data has changed. "^DD",231.9,231.9,230.1,"DT") 3071006 "^DD",231.9,231.9,231.1,0) CHOICES UPDATED^F^^231;1^K:$L(X)>30!($L(X)<1) X "^DD",231.9,231.9,231.1,3) Answer must be 1-30 characters in length. "^DD",231.9,231.9,231.1,21,0) ^.001^2^2^3081017^^^ "^DD",231.9,231.9,231.1,21,1,0) This is a timestamp that is set whenever the definition of any display "^DD",231.9,231.9,231.1,21,2,0) board for a given area has been modified. "^DD",231.9,231.9,231.1,23,0) ^^2^2^3081017^ "^DD",231.9,231.9,231.1,23,1,0) The timestamp kept in this field is $H. The $H value is used as a token "^DD",231.9,231.9,231.1,23,2,0) by the client to know that display choices have been updated. "^DD",231.9,231.9,231.1,"DT") 3080727 "^DD",231.9,231.93,0) COLOR SPEC SUB-FIELD^^.01^1 "^DD",231.9,231.93,0,"DT") 3071027 "^DD",231.9,231.93,0,"NM","COLOR SPEC") "^DD",231.9,231.93,0,"UP") 231.9 "^DD",231.9,231.93,.01,0) COLOR SPEC^WL^^0;1^Q "^DD",231.9,231.93,.01,3) Enter the XML-based color map. "^DD",231.9,231.93,.01,21,0) ^^2^2^3080922^ "^DD",231.9,231.93,.01,21,1,0) This contains an XML document that is a map of the colors to be used for "^DD",231.9,231.93,.01,21,2,0) the display board. "^DD",231.9,231.93,.01,"DT") 3071027 "^DD",231.9,231.94,0) DISPLAY BOARD CONFIG SUB-FIELD^^1^2 "^DD",231.9,231.94,0,"DT") 3080514 "^DD",231.9,231.94,0,"IX","B",231.94,.01) "^DD",231.9,231.94,0,"NM","DISPLAY BOARD CONFIG") "^DD",231.9,231.94,0,"UP") 231.9 "^DD",231.9,231.94,.01,0) NAME^F^^0;1^K:$L(X)>30!($L(X)<1) X "^DD",231.9,231.94,.01,1,0) ^.1 "^DD",231.9,231.94,.01,1,1,0) 231.94^B "^DD",231.9,231.94,.01,1,1,1) S ^EDPB(231.9,DA(1),4,"B",$E(X,1,30),DA)="" "^DD",231.9,231.94,.01,1,1,2) K ^EDPB(231.9,DA(1),4,"B",$E(X,1,30),DA) "^DD",231.9,231.94,.01,3) Enter a unique name for this display board configuration. "^DD",231.9,231.94,.01,21,0) ^^1^1^3080922^ "^DD",231.9,231.94,.01,21,1,0) This is the name of the specific display board. "^DD",231.9,231.94,.01,"DT") 3080514 "^DD",231.9,231.94,1,0) SPEC^231.941^^1;0 "^DD",231.9,231.94,1,21,0) ^^1^1^3080922^ "^DD",231.9,231.94,1,21,1,0) This is the XML description for a specific display board. "^DD",231.9,231.941,0) SPEC SUB-FIELD^^.01^1 "^DD",231.9,231.941,0,"DT") 3080514 "^DD",231.9,231.941,0,"NM","SPEC") "^DD",231.9,231.941,0,"UP") 231.94 "^DD",231.9,231.941,.01,0) SPEC^WL^^0;1^Q "^DD",231.9,231.941,.01,3) Enter the XML that represents the board specification. "^DD",231.9,231.941,.01,21,0) ^^1^1^3080922^ "^DD",231.9,231.941,.01,21,1,0) This is the XML-based description of a specific display board definition. "^DD",231.9,231.941,.01,"DT") 3080514 "^DD",233.1,233.1,0) FIELD^^2^6 "^DD",233.1,233.1,0,"DT") 3081010 "^DD",233.1,233.1,0,"IX","B",233.1,.01) "^DD",233.1,233.1,0,"NM","TRACKING CODE") "^DD",233.1,233.1,0,"PT",230,.1) "^DD",233.1,233.1,0,"PT",230,1.2) "^DD",233.1,233.1,0,"PT",230,1.5) "^DD",233.1,233.1,0,"PT",230,3.2) "^DD",233.1,233.1,0,"PT",230,3.3) "^DD",233.1,233.1,0,"PT",230.1,.1) "^DD",233.1,233.1,0,"PT",230.1,.11) "^DD",233.1,233.1,0,"PT",230.1,.12) "^DD",233.1,233.1,0,"PT",230.1,3.2) "^DD",233.1,233.1,0,"PT",230.1,3.3) "^DD",233.1,233.1,0,"PT",231.8,.08) "^DD",233.1,233.1,0,"PT",233.1,.04) "^DD",233.1,233.1,0,"PT",233.21,.02) "^DD",233.1,233.1,0,"VRPK") EMERGENCY DEPARTMENT "^DD",233.1,233.1,.01,0) NAME^RF^^0;1^K:$L(X)>30!(X?.N)!($L(X)<3)!'(X'?1P.E) X "^DD",233.1,233.1,.01,1,0) ^.1 "^DD",233.1,233.1,.01,1,1,0) 233.1^B "^DD",233.1,233.1,.01,1,1,1) S ^EDPB(233.1,"B",$E(X,1,30),DA)="" "^DD",233.1,233.1,.01,1,1,2) K ^EDPB(233.1,"B",$E(X,1,30),DA) "^DD",233.1,233.1,.01,3) NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH PUNCTUATION "^DD",233.1,233.1,.01,21,0) ^^4^4^3081010^ "^DD",233.1,233.1,.01,21,1,0) This is a unique name for a value in a selection list used by the patient "^DD",233.1,233.1,.01,21,2,0) tracking system. Each name is made unique by a prefix. This prefix is "^DD",233.1,233.1,.01,21,3,0) "edp." for nationally exported names. Names that are added by the site "^DD",233.1,233.1,.01,21,4,0) are prefixed with the station number and a period -- "500.", for example. "^DD",233.1,233.1,.01,"DT") 3080122 "^DD",233.1,233.1,.02,0) DISPLAY NAME^F^^0;2^K:$L(X)>60!($L(X)<1) X "^DD",233.1,233.1,.02,3) Answer must be 1-60 characters in length. "^DD",233.1,233.1,.02,21,0) ^^1^1^3080922^ "^DD",233.1,233.1,.02,21,1,0) This is the name of the selection that should appear on the display board. "^DD",233.1,233.1,.02,"DT") 3080122 "^DD",233.1,233.1,.03,0) ABBREVIATION^F^^0;3^K:$L(X)>30!($L(X)<1) X "^DD",233.1,233.1,.03,3) Answer must be 1-30 characters in length. "^DD",233.1,233.1,.03,21,0) ^^1^1^3080922^ "^DD",233.1,233.1,.03,21,1,0) This is an abbreviation of the display name that is used in some reports. "^DD",233.1,233.1,.03,"DT") 3080122 "^DD",233.1,233.1,.04,0) NATIONAL CODE^P233.1'^EDPB(233.1,^0;4^Q "^DD",233.1,233.1,.04,3) Enter the national code that most closely matches this local code. "^DD",233.1,233.1,.04,21,0) ^^2^2^3080922^ "^DD",233.1,233.1,.04,21,1,0) This will allow a mapping from a site defined code to a national code when "^DD",233.1,233.1,.04,21,2,0) such a code exists. "^DD",233.1,233.1,.04,"DT") 3070719 "^DD",233.1,233.1,.05,0) FLAGS^F^^0;5^K:$L(X)>4!($L(X)<1) X "^DD",233.1,233.1,.05,3) Answer must be 1-4 characters in length. "^DD",233.1,233.1,.05,21,0) ^^11^11^3081010^ "^DD",233.1,233.1,.05,21,1,0) The flags are used to further classify a specific code. "^DD",233.1,233.1,.05,21,2,0) The possible flags are: "^DD",233.1,233.1,.05,21,3,0) "^DD",233.1,233.1,.05,21,4,0) M: Missed Opportunity "^DD",233.1,233.1,.05,21,5,0) A: Admission "^DD",233.1,233.1,.05,21,6,0) VA: VA Admission "^DD",233.1,233.1,.05,21,7,0) O: Observation "^DD",233.1,233.1,.05,21,8,0) "^DD",233.1,233.1,.05,21,9,0) Multiple flags are allowed. No delimiters are required, as each "^DD",233.1,233.1,.05,21,10,0) character has a specific meaning. In the case of "VA", the "A" indicates "^DD",233.1,233.1,.05,21,11,0) an admission and the "V" indicates that the admission was to the VA. "^DD",233.1,233.1,.05,"DT") 3081010 "^DD",233.1,233.1,2,0) DESCRIPTION^233.12^^2;0 "^DD",233.1,233.1,2,21,0) ^^1^1^3080922^ "^DD",233.1,233.1,2,21,1,0) This allows the code to be further described. "^DD",233.1,233.12,0) DESCRIPTION SUB-FIELD^^.01^1 "^DD",233.1,233.12,0,"DT") 3070720 "^DD",233.1,233.12,0,"NM","DESCRIPTION") "^DD",233.1,233.12,0,"UP") 233.1 "^DD",233.1,233.12,.01,0) DESCRIPTION^W^^0;1^Q "^DD",233.1,233.12,.01,21,0) ^^1^1^3080922^ "^DD",233.1,233.12,.01,21,1,0) This allows the code to be further described. "^DD",233.1,233.12,.01,"DT") 3070720 "^DD",233.2,233.2,0) FIELD^^1^2 "^DD",233.2,233.2,0,"DDA") N "^DD",233.2,233.2,0,"DT") 3071229 "^DD",233.2,233.2,0,"IX","AS",233.21,.02) "^DD",233.2,233.2,0,"IX","AS",233.21,.04) "^DD",233.2,233.2,0,"IX","AS",233.21,.05) "^DD",233.2,233.2,0,"IX","B",233.2,.01) "^DD",233.2,233.2,0,"NM","TRACKING CODE SET") "^DD",233.2,233.2,0,"VRPK") EMERGENCY DEPARTMENT "^DD",233.2,233.2,.01,0) NAME^RF^^0;1^K:$L(X)>30!(X?.N)!($L(X)<3)!'(X'?1P.E) X "^DD",233.2,233.2,.01,1,0) ^.1 "^DD",233.2,233.2,.01,1,1,0) 233.2^B "^DD",233.2,233.2,.01,1,1,1) S ^EDPB(233.2,"B",$E(X,1,30),DA)="" "^DD",233.2,233.2,.01,1,1,2) K ^EDPB(233.2,"B",$E(X,1,30),DA) "^DD",233.2,233.2,.01,3) NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH PUNCTUATION "^DD",233.2,233.2,.01,21,0) ^^3^3^3080922^ "^DD",233.2,233.2,.01,21,1,0) This is the name for this set of tracking codes. The set is used as a "^DD",233.2,233.2,.01,21,2,0) selection list in the patient tracking software. The selection lists may "^DD",233.2,233.2,.01,21,3,0) be modifed at each site. "^DD",233.2,233.2,1,0) CODES^233.21A^^1;0 "^DD",233.2,233.2,1,21,0) ^^1^1^3080922^ "^DD",233.2,233.2,1,21,1,0) This is the list of codes that are available in the selection list. "^DD",233.2,233.21,0) CODES SUB-FIELD^^.05^5 "^DD",233.2,233.21,0,"DT") 3071229 "^DD",233.2,233.21,0,"IX","B",233.21,.01) "^DD",233.2,233.21,0,"NM","CODES") "^DD",233.2,233.21,0,"UP") 233.2 "^DD",233.2,233.21,.01,0) SEQUENCE^MNJ4,0^^0;1^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) X "^DD",233.2,233.21,.01,1,0) ^.1 "^DD",233.2,233.21,.01,1,1,0) 233.21^B "^DD",233.2,233.21,.01,1,1,1) S ^EDPB(233.2,DA(1),1,"B",$E(X,1,30),DA)="" "^DD",233.2,233.21,.01,1,1,2) K ^EDPB(233.2,DA(1),1,"B",$E(X,1,30),DA) "^DD",233.2,233.21,.01,3) Type a Number between 1 and 9999, 0 Decimal Digits "^DD",233.2,233.21,.01,21,0) ^^1^1^3080922^ "^DD",233.2,233.21,.01,21,1,0) This is the order in which the code should appear in the list. "^DD",233.2,233.21,.01,"DT") 3070719 "^DD",233.2,233.21,.02,0) CODE^P233.1'^EDPB(233.1,^0;2^Q "^DD",233.2,233.21,.02,1,0) ^.1 "^DD",233.2,233.21,.02,1,1,0) 233.2^AS^MUMPS "^DD",233.2,233.21,.02,1,1,1) D LFS^EDPDD "^DD",233.2,233.21,.02,1,1,2) D LFK^EDPDD "^DD",233.2,233.21,.02,1,1,"%D",0) ^^2^2^3080924^ "^DD",233.2,233.21,.02,1,1,"%D",1,0) Allows quick access to the local display name. "^DD",233.2,233.21,.02,1,1,"%D",2,0) ListName,CodePtr,IEN)=Abbreviation^Name "^DD",233.2,233.21,.02,1,1,"DT") 3080723 "^DD",233.2,233.21,.02,3) Select a code to include in the selection list. "^DD",233.2,233.21,.02,21,0) ^^1^1^3080922^ "^DD",233.2,233.21,.02,21,1,0) This is the code to include in the selection list. "^DD",233.2,233.21,.02,"DT") 3080723 "^DD",233.2,233.21,.03,0) INACTIVE^S^1:INACTIVE;0:ACTIVE;^0;3^Q "^DD",233.2,233.21,.03,3) Enter INACTIVE if selection of the code should be disallowed. "^DD",233.2,233.21,.03,21,0) ^^2^2^3080922^ "^DD",233.2,233.21,.03,21,1,0) This may be used to indicate that the code is to be temporarily "^DD",233.2,233.21,.03,21,2,0) inactivated. "^DD",233.2,233.21,.03,"DT") 3071228 "^DD",233.2,233.21,.04,0) NAME AT SITE^F^^0;4^K:$L(X)>60!($L(X)<1) X "^DD",233.2,233.21,.04,1,0) ^.1 "^DD",233.2,233.21,.04,1,1,0) 233.2^AS^MUMPS "^DD",233.2,233.21,.04,1,1,1) D LFS1^EDPDD "^DD",233.2,233.21,.04,1,1,2) D LFK1^EDPDD "^DD",233.2,233.21,.04,1,1,"%D",0) ^^2^2^3080924^ "^DD",233.2,233.21,.04,1,1,"%D",1,0) Allows quick access to the local display name. "^DD",233.2,233.21,.04,1,1,"%D",2,0) ListName,CodePtr,IEN)=Abbreviation^Name "^DD",233.2,233.21,.04,1,1,"DT") 3080723 "^DD",233.2,233.21,.04,3) Answer must be 1-60 characters in length. "^DD",233.2,233.21,.04,21,0) ^^3^3^3081010^ "^DD",233.2,233.21,.04,21,1,0) This field allows a site to use a name that is different from the "^DD",233.2,233.21,.04,21,2,0) nationally exported display name. This name should not change the "^DD",233.2,233.21,.04,21,3,0) underlying meaning of the nationally exported name. "^DD",233.2,233.21,.04,"DT") 3080723 "^DD",233.2,233.21,.05,0) ABBREVIATION AT SITE^F^^0;5^K:$L(X)>30!($L(X)<1) X "^DD",233.2,233.21,.05,1,0) ^.1 "^DD",233.2,233.21,.05,1,1,0) 233.2^AS^MUMPS "^DD",233.2,233.21,.05,1,1,1) D LFS1^EDPDD "^DD",233.2,233.21,.05,1,1,2) D LFK1^EDPDD "^DD",233.2,233.21,.05,1,1,"%D",0) ^.101^2^2^3081010^^ "^DD",233.2,233.21,.05,1,1,"%D",1,0) Allows quick access to the local display names. "^DD",233.2,233.21,.05,1,1,"%D",2,0) ListName,CodePtr,IEN)=Abbreviation^Name "^DD",233.2,233.21,.05,1,1,"DT") 3080723 "^DD",233.2,233.21,.05,3) Answer must be 1-30 characters in length. "^DD",233.2,233.21,.05,21,0) ^^2^2^3080922^ "^DD",233.2,233.21,.05,21,1,0) This allows a site to use a different abbreviation for a national code "^DD",233.2,233.21,.05,21,2,0) without changing the underlying meaning of the code. "^DD",233.2,233.21,.05,"DT") 3080723 "^DIC",230,230,0) ED LOG^230 "^DIC",230,230,0,"GL") ^EDP(230, "^DIC",230,230,"%D",0) ^^12^12^3081004^ "^DIC",230,230,"%D",1,0) This file serves as the log of emergency department visits. It works "^DIC",230,230,"%D",2,0) together with the ED LOG HISTORY file to track when activities of a "^DIC",230,230,"%D",3,0) typical emergency department visit are done. It records where the patient "^DIC",230,230,"%D",4,0) went, who was responsible, and when key things happened (such as triage "^DIC",230,230,"%D",5,0) and disposition). "^DIC",230,230,"%D",6,0) "^DIC",230,230,"%D",7,0) This file serves as the key source of information for data that is "^DIC",230,230,"%D",8,0) displayed on the emergency department display board (an electronic "white "^DIC",230,230,"%D",9,0) board"). Patient visits that are currently active are shown on the "^DIC",230,230,"%D",10,0) display board. The display board is refreshed every 30 seconds. Many of "^DIC",230,230,"%D",11,0) the indexes in this file assist in making the refresh code as efficient as "^DIC",230,230,"%D",12,0) possible. "^DIC",230,"B","ED LOG",230) "^DIC",230.1,230.1,0) ED LOG HISTORY^230.1 "^DIC",230.1,230.1,0,"GL") ^EDP(230.1, "^DIC",230.1,230.1,"%D",0) ^^13^13^3081004^ "^DIC",230.1,230.1,"%D",1,0) This file contains a history of changes to key fields in the ED LOG "^DIC",230.1,230.1,"%D",2,0) file. When a record is first created in the ED LOG file, and each time "^DIC",230.1,230.1,"%D",3,0) that record is updated, a record is also created in this file that "^DIC",230.1,230.1,"%D",4,0) contains the values of the fields that actually changed. This gives a "^DIC",230.1,230.1,"%D",5,0) thorough history of what was changed when and by whom. A major purpose to "^DIC",230.1,230.1,"%D",6,0) the Emergency Department Tracking System is to measure how long it takes "^DIC",230.1,230.1,"%D",7,0) to do things. By keeping this history file, with all the time stamps, it "^DIC",230.1,230.1,"%D",8,0) is possible to generate a variety of reports. These include information "^DIC",230.1,230.1,"%D",9,0) such as wait times, lengths of visit, number of delayed visits, etc. "^DIC",230.1,230.1,"%D",10,0) "^DIC",230.1,230.1,"%D",11,0) The fields in this file correspond to the identically named fields in the "^DIC",230.1,230.1,"%D",12,0) ED LOG file (230). For more detail in the field description, please "^DIC",230.1,230.1,"%D",13,0) refer to the matching field in the ED LOG file. "^DIC",230.1,"B","ED LOG HISTORY",230.1) "^DIC",231.7,231.7,0) TRACKING STAFF^231.7 "^DIC",231.7,231.7,0,"GL") ^EDPB(231.7, "^DIC",231.7,231.7,"%D",0) ^^6^6^3081005^ "^DIC",231.7,231.7,"%D",1,0) This file contains staff assigned to a particular area (e.g., the "^DIC",231.7,231.7,"%D",2,0) emergency department). It allows for concise selection lists when "^DIC",231.7,231.7,"%D",3,0) updating the tracking log. It also allows for particular colors to be "^DIC",231.7,231.7,"%D",4,0) associated with staff. When that person is shown on the display board, "^DIC",231.7,231.7,"%D",5,0) the colors may be used to more easily tell who is assigned to which "^DIC",231.7,231.7,"%D",6,0) patient. "^DIC",231.7,"B","TRACKING STAFF",231.7) "^DIC",231.8,231.8,0) TRACKING ROOM-BED^231.8 "^DIC",231.8,231.8,0,"GL") ^EDPB(231.8, "^DIC",231.8,231.8,"%D",0) ^^6^6^3080915^ "^DIC",231.8,231.8,"%D",1,0) As the patient moves thru a visit, such as a visit to the emergency "^DIC",231.8,231.8,"%D",2,0) department, there are a number of areas the patient may stop at. This "^DIC",231.8,231.8,"%D",3,0) file allows the department to set up places a patient may be, physical or "^DIC",231.8,231.8,"%D",4,0) conceptual, so that the patient may be tracked throughout their visit. "^DIC",231.8,231.8,"%D",5,0) These places may include specific beds, waiting areas, other areas of the "^DIC",231.8,231.8,"%D",6,0) hospital such as radiology, exam rooms, etc. "^DIC",231.8,"B","TRACKING ROOM-BED",231.8) "^DIC",231.9,231.9,0) TRACKING AREA^231.9 "^DIC",231.9,231.9,0,"GL") ^EDPB(231.9, "^DIC",231.9,231.9,"%D",0) ^^4^4^3080922^ "^DIC",231.9,231.9,"%D",1,0) This file contains the parameters that control the behavior of the "^DIC",231.9,231.9,"%D",2,0) tracking software. It also contains XML descriptions that are used by "^DIC",231.9,231.9,"%D",3,0) the client display board software to control column appearance, row "^DIC",231.9,231.9,"%D",4,0) content, and cell color. "^DIC",231.9,"B","TRACKING AREA",231.9) "^DIC",233.1,233.1,0) TRACKING CODE^233.1 "^DIC",233.1,233.1,0,"GL") ^EDPB(233.1, "^DIC",233.1,233.1,"%D",0) ^^3^3^3080922^ "^DIC",233.1,233.1,"%D",1,0) This file contains entries that are used in selection lists within the "^DIC",233.1,233.1,"%D",2,0) tracking software. The entries for these selection lists may eventually "^DIC",233.1,233.1,"%D",3,0) be rolled up for reporting to the Emergency Department director. "^DIC",233.1,"B","TRACKING CODE",233.1) "^DIC",233.2,233.2,0) TRACKING CODE SET^233.2 "^DIC",233.2,233.2,0,"GL") ^EDPB(233.2, "^DIC",233.2,233.2,"%D",0) ^^3^3^3080922^ "^DIC",233.2,233.2,"%D",1,0) This file contains collections of codes that represent a specific "^DIC",233.2,233.2,"%D",2,0) selection list (acuities, patient statuses, dispositions, delay reasons, "^DIC",233.2,233.2,"%D",3,0) etc.) used within the patient tracking software. "^DIC",233.2,"B","TRACKING CODE SET",233.2) **END** **END**