Ignore:
Timestamp:
May 11, 2011, 10:00:58 AM (14 years ago)
Author:
Sam Habiel
Message:

Updated BMX 4.1000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/kids/bmx_041000.kids

    r1150 r1183  
    1 KIDS Distribution saved on Apr 17, 2011@10:32:29
    2 BMX 4.1000 for WorldVistA
     1KIDS Distribution saved on May 11, 2011@17:02:50
     2BMX 4.1000 try 2
    33**KIDS**:BMX 4.1000^
    44
     
    66BMX 4.1000
    77"BLD",7911,0)
    8 BMX 4.1000^BMXNET RPMS .NET UTILITIES^0^3110417^y
     8BMX 4.1000^BMXNET RPMS .NET UTILITIES^0^3110511^y
    99"BLD",7911,1,0)
    1010^^3^3^3110417^
     
    4242
    4343"BLD",7911,6.3)
    44 1
     442
    4545"BLD",7911,"INIT")
    4646POST^BMXUTL6
     
    124124BMXMEVN^^0^B50045062
    125125"BLD",7911,"KRN",9.8,"NM",31,0)
    126 BMXMON^^0^B185134800
     126BMXMON^^0^B189828327
    127127"BLD",7911,"KRN",9.8,"NM",32,0)
    128128BMXMSEC^^0^B14524048
     
    140140BMXRPC2^^0^B11504982
    141141"BLD",7911,"KRN",9.8,"NM",39,0)
    142 BMXRPC3^^0^B38590311
     142BMXRPC3^^0^B38580443
    143143"BLD",7911,"KRN",9.8,"NM",40,0)
    144144BMXRPC4^^0^B27858921
     
    184184BMXUTL6^^0^B1075011
    185185"BLD",7911,"KRN",9.8,"NM",62,0)
    186 BMXRPC10^^0^B93587525
     186BMXRPC10^^0^B102094048
    187187"BLD",7911,"KRN",9.8,"NM",63,0)
    188188BMXADOX1^^0^B84889528
     
    2606260659512,54859
    26072607"KRN",19,11047,"RPC",0)
    2608 ^19.05P^88^88
     2608^19.05P^89^89
    26092609"KRN",19,11047,"RPC",1,0)
    26102610BMX SQL
     
    27092709"KRN",19,11047,"RPC",88,0)
    27102710BMX TEST ADO
     2711"KRN",19,11047,"RPC",89,0)
     2712BMX UTF-8
    27112713"KRN",19,11047,"U")
    27122714BMX PROCEDURE CALLS
     
    286628680^41
    28672869"KRN",8994,2562,0)
    2868 BMXGetFacRS^GETFCRS^BMXRPC10^4
     2870BMXGetFacRS^GETFCRS^BMXRPC3^1
    28692871"KRN",8994,2563,-1)
    287028720^46
     
    29862988BMX UTF-8^UTF8^BMXRPC^1^P
    29872989"KRN",8994,2646,1,0)
    2988 ^8994.01^4^4^3110407^^
     2990^^4^4^3100907^
    29892991"KRN",8994,2646,1,1,0)
    29902992This RPC returns a single value of 1 if database supports UTF-8; 0 if
     
    30723074^9.49I^1^1
    30733075"PKG",212,22,1,0)
    3074 4.1000^3110417
     30764.1000^3110511
    30753077"PKG",212,22,1,1,0)
    3076 ^^3^3^3110417
     3078^^3^3^3110511
    30773079"PKG",212,22,1,1,1,0)
    30783080BMX 4.1000; WV version of BMX 4.0 for IHS.
     
    31643166BMXADE1 ; IHS/OIT/HMW - BMXNet ADO.NET PROVIDER ;
    31653167"RTN","BMXADE1",2,0)
    3166  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     3168 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    31673169"RTN","BMXADE1",3,0)
    31683170 ;
     
    33323334BMXADE2 ; IHS/OIT/HMW - BMXNet ADO.NET PROVIDER ;
    33333335"RTN","BMXADE2",2,0)
    3334  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     3336 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    33353337"RTN","BMXADE2",3,0)
    33363338 ;
     
    35143516BMXADO ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    35153517"RTN","BMXADO",2,0)
    3516  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     3518 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    35173519"RTN","BMXADO",3,0)
    35183520 ; SS^BMXADO: RPC EP FROM WINDOWS/WEB APP TO GENERATE A SCHEMEA STRING (& OPTIONALLY, A DATA SET AS WELL)
     
    38303832BMXADO2 ; IHS/CIHA/GIS - BMX ADO RECORDSET UTILS ;
    38313833"RTN","BMXADO2",2,0)
    3832  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     3834 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    38333835"RTN","BMXADO2",3,0)
    38343836 ;
     
    39923994BMXADOF ; IHS/CIHA/GIS - RPC CALL FOR EXTENDED FUNCTIONALITY OF BMXNet UTILITIES ; 4/6/11 12:52pm
    39933995"RTN","BMXADOF",2,0)
    3994  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     3996 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    39953997"RTN","BMXADOF",3,0)
    39963998 ; THIS IS THE ADO RECORDSET FILER: ADO -> FILEMAN
     
    44564458BMXADOF1 ; IHS/CIHA/GIS - RPC CALL FOR EXTENDED FUNCTIONALITY OF BMXNet UTILITIES ;
    44574459"RTN","BMXADOF1",2,0)
    4458  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     4460 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    44594461"RTN","BMXADOF1",3,0)
    44604462 ; UPDATE FILEMAN WITH AN ADO RECORD SET FROM A WINDOWS/WEB APPLICATION
     
    46084610BMXADOF2 ; IHS/CIHA/GIS - RPC CALL FOR EXTENDED FUNCTIONALITY OF BMXNet UTILITIES ;
    46094611"RTN","BMXADOF2",2,0)
    4610  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     4612 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    46114613"RTN","BMXADOF2",3,0)
    46124614 ; THIS ROUTINE CONTAINS SPECIAL ENTRY POINTS FOR UPDATING RPMS
     
    47244726BMXADOFD ; IHS/CIHA/GIS - RPC CALL FOR EXTENDED FUNCTIONALITY OF BMXNet UTILITIES ; 31 Jul 2009  12:41 PM
    47254727"RTN","BMXADOFD",2,0)
    4726  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     4728 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    47274729"RTN","BMXADOFD",3,0)
    47284730 ; THIS IS THE ADO RECORDSET FILER: ADO -> FILEMAN
     
    48964898BMXADOFS ; IHS/CIHA/GIS - RPC CALL FOR EXTENDED FUNCTIONALITY OF BMXNet UTILITIES ; 31 Jul 2009  12:42 PM
    48974899"RTN","BMXADOFS",2,0)
    4898  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     4900 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    48994901"RTN","BMXADOFS",3,0)
    49004902 ; THIS IS THE ADO RECORDSET FILER: ADO -> FILEMAN
     
    53145316BMXADOI ; IHS/CIHA/GIS - RPC CALL: GENERATE DATA FOR AN ADO DATASET ;
    53155317"RTN","BMXADOI",2,0)
    5316  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     5318 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    53175319"RTN","BMXADOI",3,0)
    53185320 ; CUSTOM IDENTIFIERS
     
    54805482BMXADOS ; IHS/CIHA/GIS - UPDATE THE BMX ADO SCHEMA FILE ; 4/5/11 1:54pm
    54815483"RTN","BMXADOS",2,0)
    5482  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     5484 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    54835485"RTN","BMXADOS",3,0)
    54845486 ; ENABLES NAVIGATION TO SUBFILES PRIOR TO UPDATING THE SCHEMA FILE ENTRY
     
    60146016BMXADOS1 ; IHS/CIHA/GIS - UPDATE THE BMX ADO SCHEMA FILE GUI VERSION ;
    60156017"RTN","BMXADOS1",2,0)
    6016  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     6018 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    60176019"RTN","BMXADOS1",3,0)
    60186020 ; RPC CALLS
     
    62286230BMXADOV ; CIHA/CIHA/GIS - RPC CALL: GENERATE DATA FOR AN ADO DATASET
    62296231"RTN","BMXADOV",2,0)
    6230  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     6232 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    62316233"RTN","BMXADOV",3,0)
    62326234 ;
     
    64746476BMXADOV1 ; IHS/CIHA/GIS - RPC CALL: GENERATE DATA FOR AN ADO DATASET ;
    64756477"RTN","BMXADOV1",2,0)
    6476  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     6478 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    64776479"RTN","BMXADOV1",3,0)
    64786480 ; CONTINUATION FILE FOR BMXADOV
     
    69346936BMXADOV2 ; IHS/CIHA/GIS - RPC CALL: GENERATE DATA FOR AN ADO DATASET ;
    69356937"RTN","BMXADOV2",2,0)
    6936  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     6938 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    69376939"RTN","BMXADOV2",3,0)
    69386940 ; CUSTOM ITERATORS FOR RPMS
     
    72107212BMXADOVJ ; IHS/CIHA/GIS - RPC CALL: GENERATE DATA FOR AN ADO DATASET ;
    72117213"RTN","BMXADOVJ",2,0)
    7212  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     7214 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    72137215"RTN","BMXADOVJ",3,0)
    72147216 ; THIS ROUTINE MANAGES THE JOINS
     
    73687370BMXADOX ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    73697371"RTN","BMXADOX",2,0)
    7370  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     7372 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    73717373"RTN","BMXADOX",3,0)
    73727374 ; EXMAPLES OF RPMS SCHEMAE GENERATION
     
    83728374BMXADOX1 ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    83738375"RTN","BMXADOX1",2,0)
    8374  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     8376 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    83758377"RTN","BMXADOX1",3,0)
    83768378 ; EXMAPLES OF FILEMAN SCHEMA GENERATION
     
    90249026BMXADOX2 ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    90259027"RTN","BMXADOX2",2,0)
    9026  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     9028 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    90279029"RTN","BMXADOX2",3,0)
    90289030 ; EXMAPLES OF FILEMAN SCHEMA GENERATION
     
    92729274BMXADOXX ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    92739275"RTN","BMXADOXX",2,0)
    9274  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     9276 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    92759277"RTN","BMXADOXX",3,0)
    92769278 ; EXMAPLES OF RPMS SCHEMAE GENERATION
     
    1015210154BMXADOXY ; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
    1015310155"RTN","BMXADOXY",2,0)
    10154  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     10156 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1015510157"RTN","BMXADOXY",3,0)
    1015610158 ; EXMAPLES OF FILEMAN SCHEMA GENERATION
     
    1074610748BMXE01 ; IHS/OIT/FJE - ENVIRONMENT CHECK FOR BMX 2.0 ; 4/6/11 4:20pm
    1074710749"RTN","BMXE01",2,0)
    10748  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     10750 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1074910751"RTN","BMXE01",3,0)
    1075010752 ;
     
    1085210854BMXEHR ; IHS/OIT/GIS - ENCAPSULATE BMX CALLS FOR USE WITHIN THE EHR 14 Jan 2009 4:37 PM ; 04 Jun 2010  3:16 PM
    1085310855"RTN","BMXEHR",2,0)
    10854  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     10856 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1085510857"RTN","BMXEHR",3,0)
    1085610858 ;
     
    1134211344BMXFIND ; IHS/OIT/HMW - BMX GENERIC FIND ;
    1134311345"RTN","BMXFIND",2,0)
    11344  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     11346 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1134511347"RTN","BMXFIND",3,0)
    1134611348 ;
     
    1186411866BMXG ; IHS/OIT/HMW - UTIL: GET DATA ;
    1186511867"RTN","BMXG",2,0)
    11866  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     11868 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1186711869"RTN","BMXG",3,0)
    1186811870 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    1197411976BMXGETS ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1197511977"RTN","BMXGETS",2,0)
    11976  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     11978 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1197711979"RTN","BMXGETS",3,0)
    1197811980 ;
     
    1226812270BMXMBRK ; IHS/OIT/HMW - BMXNet MONITOR ;
    1226912271"RTN","BMXMBRK",2,0)
    12270  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     12272 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1227112273"RTN","BMXMBRK",3,0)
    1227212274 ;
     
    1270412706BMXMBRK2 ;IHS/OIT/HMW - BMXNet MONITOR ;
    1270512707"RTN","BMXMBRK2",2,0)
    12706  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     12708 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1270712709"RTN","BMXMBRK2",3,0)
    1270812710 ;
     
    1304613048BMXMEVN ; IHS/OIT/HMW - BMXNet MONITOR ;
    1304713049"RTN","BMXMEVN",2,0)
    13048  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     13050 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1304913051"RTN","BMXMEVN",3,0)
    1305013052 ;
     
    1358013582 Q
    1358113583"RTN","BMXMON")
    13582 0^31^B185134800
     135840^31^B189828327
    1358313585"RTN","BMXMON",1,0)
    13584 BMXMON ; IHS/OIT/HMW - BMXNet MONITOR ; 4/6/11 12:42pm
     13586BMXMON ; IHS/OIT/HMW - BMXNet MONITOR ; 5/9/11 10:16am
    1358513587"RTN","BMXMON",2,0)
    13586  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     13588 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1358713589"RTN","BMXMON",3,0)
    1358813590 ;
    1358913591"RTN","BMXMON",4,0)
    13590  ; IMPORTANT: Logging is on by default. Set XWBDEBUG=0 to turn it off.
     13592 ; Changes for *1000 by WV/SMH (Feb 2 2011) to support GT.M
    1359113593"RTN","BMXMON",5,0)
    13592  ;
     13594 ; - XINETD entry point for GT.M
    1359313595"RTN","BMXMON",6,0)
    13594  ; Changes for *1000 by WV/SMH (Feb 2 2011) to support GT.M
     13596 ; - Replacement of all W *-3 to W !
    1359513597"RTN","BMXMON",7,0)
    13596  ; - XINETD entry point for GT.M
     13598 ; - Addition of logging capabilities for analysis using XWBDLOG
    1359713599"RTN","BMXMON",8,0)
    13598  ; - Replacement of all W *-3 to W !
     13600 ; - In SESSRES
    1359913601"RTN","BMXMON",9,0)
    13600  ; - Addition of logging capabilities for analysis
     13602 ; -- Broker Timeout set from Kernel System Parameter Broker Timeout Field
    1360113603"RTN","BMXMON",10,0)
    13602  ; - In SESSRES
     13604 ; -- Process Name now gets Set to show in %SS or ZSY
    1360313605"RTN","BMXMON",11,0)
    13604  ; -- Broker Timeout set from Kernel System Parameter Broker Timeout Field
     13606 ; - Error Handling does not log Network Errors to the Error Trap.
    1360513607"RTN","BMXMON",12,0)
    13606  ; -- Process Name now changes to show name in %SS or ZSY
     13608    ; - Major refactoring to Writing to the TCP Network Stream.
    1360713609"RTN","BMXMON",13,0)
    13608  ;
     13610    ; --> All writes are buffered up to 32767 characters (max string on Cache)
    1360913611"RTN","BMXMON",14,0)
    13610  ;
     13612    ; --> Then sent...
    1361113613"RTN","BMXMON",15,0)
     13614    ; --> See EP's WRITE and WBF
     13615"RTN","BMXMON",16,0)
     13616    ; --> This avoids the side effects of the Nagle Algorithm on the Linux TCP Stack
     13617"RTN","BMXMON",17,0)
     13618    ; - BMXERR renamed to BMXERROR in EP ETRAP so that it can be sent via SNDERR.
     13619"RTN","BMXMON",18,0)
     13620    ; --> This reduces the need for custom error trap handling which is very difficult to do
     13621"RTN","BMXMON",19,0)
     13622    ; --> in Mumps for new programmers. Mumps errors now are thrown on the client.
     13623"RTN","BMXMON",20,0)
     13624 ;
     13625"RTN","BMXMON",21,0)
    1361213626 ;IHS/OIT/HMW Patch 1 added validity check for passed-in namespace
    13613 "RTN","BMXMON",16,0)
    13614  ;
    13615 "RTN","BMXMON",17,0)
     13627"RTN","BMXMON",22,0)
     13628 ;
     13629"RTN","BMXMON",23,0)
    1361613630STRT(BMXPORT,NS,IS,VB) ;EP
    13617 "RTN","BMXMON",18,0)
     13631"RTN","BMXMON",24,0)
    1361813632 ;Interactive monitor start
    13619 "RTN","BMXMON",19,0)
     13633"RTN","BMXMON",25,0)
    1362013634 ;Optional NS = namespace.  If undefined, start in current ns
    13621 "RTN","BMXMON",20,0)
     13635"RTN","BMXMON",26,0)
    1362213636 ;Optional IS = Integrated Security.  Default is 1
    13623 "RTN","BMXMON",21,0)
     13637"RTN","BMXMON",27,0)
    1362413638 ;Optional VB = Verbose. Default is 1
    13625 "RTN","BMXMON",22,0)
    13626  ;
    13627 "RTN","BMXMON",23,0)
     13639"RTN","BMXMON",28,0)
     13640 ;
     13641"RTN","BMXMON",29,0)
    1362813642 N Y,BMXNS,BMXWIN
    13629 "RTN","BMXMON",24,0)
    13630  ;
    13631 "RTN","BMXMON",25,0)
     13643"RTN","BMXMON",30,0)
     13644 ;
     13645"RTN","BMXMON",31,0)
    1363213646 ;Verbose
    13633 "RTN","BMXMON",26,0)
     13647"RTN","BMXMON",32,0)
    1363413648 S BMXVB=$G(VB,1)
    13635 "RTN","BMXMON",27,0)
    13636  ;
    13637 "RTN","BMXMON",28,0)
     13649"RTN","BMXMON",33,0)
     13650 ;
     13651"RTN","BMXMON",34,0)
    1363813652 ;Check if port already running
    13639 "RTN","BMXMON",29,0)
     13653"RTN","BMXMON",35,0)
    1364013654 I '$$SEMAPHOR(BMXPORT,"LOCK") W:BMXVB "BMXNet Monitor on port "_BMXPORT_" appears to be running already.",! Q
    13641 "RTN","BMXMON",30,0)
     13655"RTN","BMXMON",36,0)
    1364213656 S %=$$SEMAPHOR(BMXPORT,"UNLOCK")
    13643 "RTN","BMXMON",31,0)
    13644  ;
    13645 "RTN","BMXMON",32,0)
     13657"RTN","BMXMON",37,0)
     13658 ;
     13659"RTN","BMXMON",38,0)
    1364613660 D MARKER(BMXPORT,1) ;record problem marker
    13647 "RTN","BMXMON",33,0)
     13661"RTN","BMXMON",39,0)
    1364813662 ; -- start the monitor
    13649 "RTN","BMXMON",34,0)
    13650  ;
    13651 "RTN","BMXMON",35,0)
     13663"RTN","BMXMON",40,0)
     13664 ;
     13665"RTN","BMXMON",41,0)
    1365213666 ;Namespace
    13653 "RTN","BMXMON",36,0)
     13667"RTN","BMXMON",42,0)
    1365413668 X ^%ZOSF("UCI")
    13655 "RTN","BMXMON",37,0)
     13669"RTN","BMXMON",43,0)
    1365613670 S BMXNS=$G(NS,$P(Y,","))
    13657 "RTN","BMXMON",38,0)
    13658  ;
    13659 "RTN","BMXMON",39,0)
     13671"RTN","BMXMON",44,0)
     13672 ;
     13673"RTN","BMXMON",45,0)
    1366013674 ;Integrated security
    13661 "RTN","BMXMON",40,0)
     13675"RTN","BMXMON",46,0)
    1366213676 S BMXWIN=$G(IS,1)
    13663 "RTN","BMXMON",41,0)
    13664  ;
    13665 "RTN","BMXMON",42,0)
     13677"RTN","BMXMON",47,0)
     13678 ;
     13679"RTN","BMXMON",48,0)
    1366613680 ;J DEBUG^%Serenji("MON^BMXMON("_BMXPORT_","_BMXNS_","_BMXWIN_")")
    13667 "RTN","BMXMON",43,0)
     13681"RTN","BMXMON",49,0)
    1366813682 J MON^BMXMON(BMXPORT,BMXNS,BMXWIN)::5 I '$T W:BMXVB "Unable to run BMXNet Monitor in background.",! Q  ;IHS/OIT/HMW SAC Exemption Applied For
    13669 "RTN","BMXMON",44,0)
     13683"RTN","BMXMON",50,0)
    1367013684 F %=1:1:5 D  Q:%=0
    13671 "RTN","BMXMON",45,0)
     13685"RTN","BMXMON",51,0)
    1367213686 . W:BMXVB "Checking if BMXNet Monitor has started...",!
    13673 "RTN","BMXMON",46,0)
     13687"RTN","BMXMON",52,0)
    1367413688 . H 1
    13675 "RTN","BMXMON",47,0)
     13689"RTN","BMXMON",53,0)
    1367613690 . S:'$$MARKER(BMXPORT,0) %=0
    13677 "RTN","BMXMON",48,0)
     13691"RTN","BMXMON",54,0)
    1367813692 I $$MARKER(BMXPORT,0) D
    13679 "RTN","BMXMON",49,0)
     13693"RTN","BMXMON",55,0)
    1368013694 . W:BMXVB !,"BMXNet Monitor could not be started!",!
    13681 "RTN","BMXMON",50,0)
     13695"RTN","BMXMON",56,0)
    1368213696 . W:BMXVB "Check if port "_BMXPORT_" is busy on this CPU.",!
    13683 "RTN","BMXMON",51,0)
     13697"RTN","BMXMON",57,0)
    1368413698 . D MARKER(BMXPORT,-1) ;clear marker
    13685 "RTN","BMXMON",52,0)
     13699"RTN","BMXMON",58,0)
    1368613700 E  W:BMXVB "BMXNet Monitor started successfully."
    13687 "RTN","BMXMON",53,0)
    13688  ;
    13689 "RTN","BMXMON",54,0)
    13690  Q
    13691 "RTN","BMXMON",55,0)
    13692  ;
    13693 "RTN","BMXMON",56,0)
     13701"RTN","BMXMON",59,0)
     13702 ;
     13703"RTN","BMXMON",60,0)
     13704 Q
     13705"RTN","BMXMON",61,0)
     13706 ;
     13707"RTN","BMXMON",62,0)
    1369413708RESTART ;EP
    13695 "RTN","BMXMON",57,0)
     13709"RTN","BMXMON",63,0)
    1369613710 ;Stop and Start all monitors in BMX MONITOR file
    13697 "RTN","BMXMON",58,0)
     13711"RTN","BMXMON",64,0)
    1369813712 ;Called by option BMX MONITOR START
    13699 "RTN","BMXMON",59,0)
    13700  ;
    13701 "RTN","BMXMON",60,0)
     13713"RTN","BMXMON",65,0)
     13714 ;
     13715"RTN","BMXMON",66,0)
    1370213716 D STOPALL
    13703 "RTN","BMXMON",61,0)
     13717"RTN","BMXMON",67,0)
    1370413718 D STRTALL
    13705 "RTN","BMXMON",62,0)
    13706  Q
    13707 "RTN","BMXMON",63,0)
    13708  ;
    13709 "RTN","BMXMON",64,0)
     13719"RTN","BMXMON",68,0)
     13720 Q
     13721"RTN","BMXMON",69,0)
     13722 ;
     13723"RTN","BMXMON",70,0)
    1371013724STRTALL ;EP
    13711 "RTN","BMXMON",65,0)
     13725"RTN","BMXMON",71,0)
    1371213726 ;Start all monitors in BMX MONITOR file
    13713 "RTN","BMXMON",66,0)
    13714  ;
    13715 "RTN","BMXMON",67,0)
     13727"RTN","BMXMON",72,0)
     13728 ;
     13729"RTN","BMXMON",73,0)
    1371613730 N BMXIEN
    13717 "RTN","BMXMON",68,0)
     13731"RTN","BMXMON",74,0)
    1371813732 S BMXIEN=0 F  S BMXIEN=$O(^BMXMON(BMXIEN)) Q:'+BMXIEN  D
    13719 "RTN","BMXMON",69,0)
     13733"RTN","BMXMON",75,0)
    1372013734 . S BMXNOD=$G(^BMXMON(BMXIEN,0))
    13721 "RTN","BMXMON",70,0)
     13735"RTN","BMXMON",76,0)
    1372213736 . Q:'+BMXNOD
    13723 "RTN","BMXMON",71,0)
     13737"RTN","BMXMON",77,0)
    1372413738 . Q:'+$P(BMXNOD,U,2)
    13725 "RTN","BMXMON",72,0)
     13739"RTN","BMXMON",78,0)
    1372613740 . S BMXWIN=$P(BMXNOD,U,3)
    13727 "RTN","BMXMON",73,0)
     13741"RTN","BMXMON",79,0)
    1372813742 . S BMXNS=$P(BMXNOD,U,4)
    13729 "RTN","BMXMON",74,0)
     13743"RTN","BMXMON",80,0)
    1373013744 . D STRT($P(BMXNOD,U),BMXNS,BMXWIN,0)
    13731 "RTN","BMXMON",75,0)
     13745"RTN","BMXMON",81,0)
    1373213746 . Q
    13733 "RTN","BMXMON",76,0)
    13734  Q
    13735 "RTN","BMXMON",77,0)
    13736  ;
    13737 "RTN","BMXMON",78,0)
     13747"RTN","BMXMON",82,0)
     13748 Q
     13749"RTN","BMXMON",83,0)
     13750 ;
     13751"RTN","BMXMON",84,0)
    1373813752STOPALL ;EP
    13739 "RTN","BMXMON",79,0)
     13753"RTN","BMXMON",85,0)
    1374013754 ;Stop all monitors in BMXNET MONITOR file
    13741 "RTN","BMXMON",80,0)
    13742  ;
    13743 "RTN","BMXMON",81,0)
     13755"RTN","BMXMON",86,0)
     13756 ;
     13757"RTN","BMXMON",87,0)
    1374413758 N BMXIEN,BMXPORT
    13745 "RTN","BMXMON",82,0)
     13759"RTN","BMXMON",88,0)
    1374613760 S BMXIEN=0 F  S BMXIEN=$O(^BMXMON(BMXIEN)) Q:'+BMXIEN  D
    13747 "RTN","BMXMON",83,0)
     13761"RTN","BMXMON",89,0)
    1374813762 . S BMXNOD=$G(^BMXMON(BMXIEN,0))
    13749 "RTN","BMXMON",84,0)
     13763"RTN","BMXMON",90,0)
    1375013764 . Q:'+BMXNOD
    13751 "RTN","BMXMON",85,0)
     13765"RTN","BMXMON",91,0)
    1375213766 . S BMXPORT=+BMXNOD
    13753 "RTN","BMXMON",86,0)
     13767"RTN","BMXMON",92,0)
    1375413768 . D STOP(BMXPORT,0)
    13755 "RTN","BMXMON",87,0)
    13756  Q
    13757 "RTN","BMXMON",88,0)
    13758  ;
    13759 "RTN","BMXMON",89,0)
     13769"RTN","BMXMON",93,0)
     13770 Q
     13771"RTN","BMXMON",94,0)
     13772 ;
     13773"RTN","BMXMON",95,0)
    1376013774STOP(BMXPORT,VB) ;EP Stop monitor on BMXPORT
    13761 "RTN","BMXMON",90,0)
     13775"RTN","BMXMON",96,0)
    1376213776 ;Open a channel to monitor on BMXPORT and send shutdown request
    13763 "RTN","BMXMON",91,0)
     13777"RTN","BMXMON",97,0)
    1376413778 ;Optional VB = Verbose. Default is 1
    13765 "RTN","BMXMON",92,0)
    13766  ;
    13767 "RTN","BMXMON",93,0)
     13779"RTN","BMXMON",98,0)
     13780 ;
     13781"RTN","BMXMON",99,0)
    1376813782 N IP,REF,X,DEV
    13769 "RTN","BMXMON",94,0)
     13783"RTN","BMXMON",100,0)
    1377013784 S U="^" D HOME^%ZIS
    13771 "RTN","BMXMON",95,0)
    13772  ;
    13773 "RTN","BMXMON",96,0)
     13785"RTN","BMXMON",101,0)
     13786 ;
     13787"RTN","BMXMON",102,0)
    1377413788 ;Verbose
    13775 "RTN","BMXMON",97,0)
     13789"RTN","BMXMON",103,0)
    1377613790 S BMXVB=$G(VB,1)
    13777 "RTN","BMXMON",98,0)
    13778  ;
    13779 "RTN","BMXMON",99,0)
     13791"RTN","BMXMON",104,0)
     13792 ;
     13793"RTN","BMXMON",105,0)
    1378013794 D:BMXVB EN^DDIOL("Stop BMXNet Monitor...")
    13781 "RTN","BMXMON",100,0)
     13795"RTN","BMXMON",106,0)
    1378213796 X ^%ZOSF("UCI") S REF=Y
    13783 "RTN","BMXMON",101,0)
     13797"RTN","BMXMON",107,0)
    1378413798 S IP="0.0.0.0" ;get server IP
    13785 "RTN","BMXMON",102,0)
     13799"RTN","BMXMON",108,0)
    1378613800 IF $G(BMXPORT)="" S BMXPORT=9200
    13787 "RTN","BMXMON",103,0)
     13801"RTN","BMXMON",109,0)
    1378813802 ; -- make sure the listener is running
    13789 "RTN","BMXMON",104,0)
     13803"RTN","BMXMON",110,0)
    1379013804 I $$SEMAPHOR(BMXPORT,"LOCK") D  Q
    13791 "RTN","BMXMON",105,0)
     13805"RTN","BMXMON",111,0)
    1379213806 . S %=$$SEMAPHOR(BMXPORT,"UNLOCK")
    13793 "RTN","BMXMON",106,0)
     13807"RTN","BMXMON",112,0)
    1379413808 . D:BMXVB EN^DDIOL("BMXNet Monitor does not appear to be running.")
    13795 "RTN","BMXMON",107,0)
     13809"RTN","BMXMON",113,0)
    1379613810 ; -- send the shutdown message to the TCP Listener process
    13797 "RTN","BMXMON",108,0)
     13811"RTN","BMXMON",114,0)
    1379813812 D CALL^%ZISTCP("127.0.0.1",BMXPORT) I POP D  Q
    13799 "RTN","BMXMON",109,0)
     13813"RTN","BMXMON",115,0)
    1380013814 . S %=$$SEMAPHOR(BMXPORT,"UNLOCK")
    13801 "RTN","BMXMON",110,0)
     13815"RTN","BMXMON",116,0)
    1380213816 . D:BMXVB EN^DDIOL("BMXNet Monitor does not appear to be running.")
    13803 "RTN","BMXMON",111,0)
     13817"RTN","BMXMON",117,0)
    1380413818 U IO
    13805 "RTN","BMXMON",112,0)
     13819"RTN","BMXMON",118,0)
    1380613820 S X=$T(+2),X=$P(X,";;",2),X=$P(X,";")
    13807 "RTN","BMXMON",113,0)
     13821"RTN","BMXMON",119,0)
    1380813822 IF X="" S X=0
    13809 "RTN","BMXMON",114,0)
     13823"RTN","BMXMON",120,0)
    1381013824 S X=$C($L(X))_X
    13811 "RTN","BMXMON",115,0)
     13825"RTN","BMXMON",121,0)
    1381213826 W "{BMX}00011TCPshutdown",!
    13813 "RTN","BMXMON",116,0)
     13827"RTN","BMXMON",122,0)
    1381413828 R X#3:5 ;IHS/OIT/HMW SAC Exemption Applied For
    13815 "RTN","BMXMON",117,0)
     13829"RTN","BMXMON",123,0)
    1381613830 D CLOSE^%ZISTCP
    13817 "RTN","BMXMON",118,0)
     13831"RTN","BMXMON",124,0)
    1381813832 I X="ack" D:BMXVB EN^DDIOL("BMXNet Monitor has been shutdown.")
    13819 "RTN","BMXMON",119,0)
     13833"RTN","BMXMON",125,0)
    1382013834 E  D:BMXVB EN^DDIOL("Shutdown Failed!")
    13821 "RTN","BMXMON",120,0)
     13835"RTN","BMXMON",126,0)
    1382213836 ;change process name
    13823 "RTN","BMXMON",121,0)
     13837"RTN","BMXMON",127,0)
    1382413838 D CHPRN($J)
    13825 "RTN","BMXMON",122,0)
    13826  Q
    13827 "RTN","BMXMON",123,0)
    13828  ;
    13829 "RTN","BMXMON",124,0)
     13839"RTN","BMXMON",128,0)
     13840 Q
     13841"RTN","BMXMON",129,0)
     13842 ;
     13843"RTN","BMXMON",130,0)
    1383013844MON(BMXPORT,NS,IS) ;Monitor port for connection & shutdown requests
    13831 "RTN","BMXMON",125,0)
     13845"RTN","BMXMON",131,0)
    1383213846 ;NS = Namespace to Start monitor
    13833 "RTN","BMXMON",126,0)
     13847"RTN","BMXMON",132,0)
    1383413848 ;IS = 1: Enable integrated security
    13835 "RTN","BMXMON",127,0)
    13836  ;
    13837 "RTN","BMXMON",128,0)
     13849"RTN","BMXMON",133,0)
     13850 ;
     13851"RTN","BMXMON",134,0)
    1383813852 N BMXDEV,BMXQUIT,BMXDTIME,BMXLEN,BMXACT,BMXWIN,BMXNS
    13839 "RTN","BMXMON",129,0)
     13853"RTN","BMXMON",135,0)
    1384013854 S BMXQUIT=0,BMXDTIME=999999
    13841 "RTN","BMXMON",130,0)
    13842  ;
    13843 "RTN","BMXMON",131,0)
     13855"RTN","BMXMON",136,0)
     13856 ;
     13857"RTN","BMXMON",137,0)
    1384413858 ;Set lock
    13845 "RTN","BMXMON",132,0)
     13859"RTN","BMXMON",138,0)
    1384613860 Q:'$$SEMAPHOR(BMXPORT,"LOCK")
    13847 "RTN","BMXMON",133,0)
     13861"RTN","BMXMON",139,0)
    1384813862 ;Clear problem marker
    13849 "RTN","BMXMON",134,0)
     13863"RTN","BMXMON",140,0)
    1385013864 D MARKER(BMXPORT,-1)
    13851 "RTN","BMXMON",135,0)
     13865"RTN","BMXMON",141,0)
    1385213866 ;H 1
    13853 "RTN","BMXMON",136,0)
    13854  ;
    13855 "RTN","BMXMON",137,0)
     13867"RTN","BMXMON",142,0)
     13868 ;
     13869"RTN","BMXMON",143,0)
    1385613870 ;Namespace
    13857 "RTN","BMXMON",138,0)
     13871"RTN","BMXMON",144,0)
    1385813872 X ^%ZOSF("UCI")
    13859 "RTN","BMXMON",139,0)
     13873"RTN","BMXMON",145,0)
    1386013874 I $G(NS)="" S BMXNS=$P(Y,",")
    13861 "RTN","BMXMON",140,0)
     13875"RTN","BMXMON",146,0)
    1386213876 E  S BMXNS=NS
    13863 "RTN","BMXMON",141,0)
    13864  ;
    13865 "RTN","BMXMON",142,0)
     13877"RTN","BMXMON",147,0)
     13878 ;
     13879"RTN","BMXMON",148,0)
    1386613880 ;Integrated security
    13867 "RTN","BMXMON",143,0)
     13881"RTN","BMXMON",149,0)
    1386813882 S BMXWIN=$G(IS,1)
    13869 "RTN","BMXMON",144,0)
    13870  ;
    13871 "RTN","BMXMON",145,0)
     13883"RTN","BMXMON",150,0)
     13884 ;
     13885"RTN","BMXMON",151,0)
    1387213886 ;Open server port;
    13873 "RTN","BMXMON",146,0)
     13887"RTN","BMXMON",152,0)
    1387413888 S BMXDEV="|TCP|"_BMXPORT
    13875 "RTN","BMXMON",147,0)
     13889"RTN","BMXMON",153,0)
    1387613890 C BMXDEV ;IHS/OIT/HMW SAC Exemption Applied For
    13877 "RTN","BMXMON",148,0)
     13891"RTN","BMXMON",154,0)
    1387813892 O BMXDEV:(:BMXPORT:"S"):5 I '$T Q  ;IHS/OIT/HMW SAC Exemption Applied For
    13879 "RTN","BMXMON",149,0)
    13880  ;
    13881 "RTN","BMXMON",150,0)
     13893"RTN","BMXMON",155,0)
     13894 ;
     13895"RTN","BMXMON",156,0)
    1388213896 ;S BMXDTIME(1)=BMXDTIME ; TODO: Set timeouts
    13883 "RTN","BMXMON",151,0)
     13897"RTN","BMXMON",157,0)
    1388413898 S BMXDTIME(1)=.5 ;HMW 20050120
    13885 "RTN","BMXMON",152,0)
     13899"RTN","BMXMON",158,0)
    1388613900 U BMXDEV
    13887 "RTN","BMXMON",153,0)
     13901"RTN","BMXMON",159,0)
    1388813902 F  D  Q:BMXQUIT
    13889 "RTN","BMXMON",154,0)
     13903"RTN","BMXMON",160,0)
    1389013904 . R BMXACT#5:BMXDTIME ;Read first 5 chars from TCP buffer, timeout=BMXDTIME ;IHS/OIT/HMW SAC Exemption Applied For
    13891 "RTN","BMXMON",155,0)
     13905"RTN","BMXMON",161,0)
    1389213906 . I BMXACT'="{BMX}" S BMXQUIT=1 Q
    13893 "RTN","BMXMON",156,0)
     13907"RTN","BMXMON",162,0)
    1389413908 . R BMXACT#5:BMXDTIME ;Read next 5 chars - message length ;IHS/OIT/HMW SAC Exemption Applied For
    13895 "RTN","BMXMON",157,0)
     13909"RTN","BMXMON",163,0)
    1389613910 . S BMXLEN=+BMXACT
    13897 "RTN","BMXMON",158,0)
     13911"RTN","BMXMON",164,0)
    1389813912 . R BMXACT#BMXLEN:BMXDTIME ;IHS/OIT/HMW SAC Exemption Applied For
    13899 "RTN","BMXMON",159,0)
     13913"RTN","BMXMON",165,0)
    1390013914 . I $P(BMXACT,"^")="TCPconnect" D  Q
    13901 "RTN","BMXMON",160,0)
     13915"RTN","BMXMON",166,0)
    1390213916 . . N BMXNSJ,X,Y,ZCHILD,%
    13903 "RTN","BMXMON",161,0)
     13917"RTN","BMXMON",167,0)
    1390413918 . . S BMXNSJ=$P(BMXACT,"^",2) ;Namespace
    13905 "RTN","BMXMON",162,0)
     13919"RTN","BMXMON",168,0)
    1390613920 . . S BMXNSJ=$P(BMXNSJ,",")
    13907 "RTN","BMXMON",163,0)
     13921"RTN","BMXMON",169,0)
    1390813922 . . I BMXNSJ="" S BMXNSJ=BMXNS
    13909 "RTN","BMXMON",164,0)
     13923"RTN","BMXMON",170,0)
    1391013924 . . S X=BMXNSJ
    13911 "RTN","BMXMON",165,0)
     13925"RTN","BMXMON",171,0)
    1391213926 . . X ^%ZOSF("UCICHECK") I Y=0 S BMXNSJ=BMXNS
    13913 "RTN","BMXMON",166,0)
     13927"RTN","BMXMON",172,0)
    1391413928 . . S STATUS=$S(Y'=0:"CONNECTION OK",1:"CONNECTION FAILED, INVALID NAMESPACE") ; SET CONNECTION STATUS BASED ON NAMESPACE VALIDITY
    13915 "RTN","BMXMON",167,0)
     13929"RTN","BMXMON",173,0)
    1391613930 . . J SESSION^BMXMON(BMXWIN)[BMXNSJ]:(:5:BMXDEV:BMXDEV):5 ;IHS/OIT/HMW SAC Exemption Applied For
    13917 "RTN","BMXMON",168,0)
     13931"RTN","BMXMON",174,0)
    1391813932 . . X ("S ZCHILD="_$C(36,90)_"CHILD")
    13919 "RTN","BMXMON",169,0)
     13933"RTN","BMXMON",175,0)
    1392013934 . . I ZCHILD S ^BMXTMP("CONNECT STATUS",ZCHILD)=STATUS
    13921 "RTN","BMXMON",170,0)
     13935"RTN","BMXMON",176,0)
    1392213936 . . Q
    13923 "RTN","BMXMON",171,0)
     13937"RTN","BMXMON",177,0)
    1392413938 . I $P(BMXACT,"^")="TCPshutdown" S BMXQUIT=1 W "ack",!
    13925 "RTN","BMXMON",172,0)
     13939"RTN","BMXMON",178,0)
    1392613940 S %=$$SEMAPHOR(BMXPORT,"UNLOCK") ; destroy 'running flag'
    13927 "RTN","BMXMON",173,0)
    13928  Q
    13929 "RTN","BMXMON",174,0)
    13930  ;
    13931 "RTN","BMXMON",175,0)
     13941"RTN","BMXMON",179,0)
     13942 Q
     13943"RTN","BMXMON",180,0)
     13944 ;
     13945"RTN","BMXMON",181,0)
    1393213946XINETD    ;PEP Directly from xinetd or inetd for GT.M
    13933 "RTN","BMXMON",176,0)
     13947"RTN","BMXMON",182,0)
    1393413948  ;
    13935 "RTN","BMXMON",177,0)
     13949"RTN","BMXMON",183,0)
    1393613950  N XWBDEBUG S XWBDEBUG=$$GET^XPAR("SYS","XWBDEBUG")  ; 0 1 2 or 3; depending on the level of verbosity desired.
    13937 "RTN","BMXMON",178,0)
     13951"RTN","BMXMON",184,0)
    1393813952  D:XWBDEBUG LOGSTART^XWBDLOG("XINETD^BMXMON")  ; Start Log only if logging
    13939 "RTN","BMXMON",179,0)
     13953"RTN","BMXMON",185,0)
    1394013954  ;
    13941 "RTN","BMXMON",180,0)
     13955"RTN","BMXMON",186,0)
    1394213956  N BMXDEV
    13943 "RTN","BMXMON",181,0)
     13957"RTN","BMXMON",187,0)
    1394413958  S U="^",$ETRAP="D ^%ZTER H" ;Set up the error trap
    13945 "RTN","BMXMON",182,0)
     13959"RTN","BMXMON",188,0)
    1394613960  S $ZT="" ;Clear old trap
    13947 "RTN","BMXMON",183,0)
     13961"RTN","BMXMON",189,0)
    1394813962  ;
    13949 "RTN","BMXMON",184,0)
     13963"RTN","BMXMON",190,0)
    1395013964  ; GT.M specific error and device code; get remove ip address
    13951 "RTN","BMXMON",185,0)
     13965"RTN","BMXMON",191,0)
    1395213966  S @("$ZINTERRUPT=""I $$JOBEXAM^ZU($ZPOSITION)""")
    13953 "RTN","BMXMON",186,0)
     13967"RTN","BMXMON",192,0)
    1395413968  S BMXDEV=$P X "U BMXDEV:(nowrap:nodelimiter:ioerror=""^%ZTER H"")"
    13955 "RTN","BMXMON",187,0)
     13969"RTN","BMXMON",193,0)
    1395613970  S %="",@("%=$ZTRNLNM(""REMOTE_HOST"")") S:$L(%) IO("GTM-IP")=%
    13957 "RTN","BMXMON",188,0)
     13971"RTN","BMXMON",194,0)
    1395813972  ;
    13959 "RTN","BMXMON",189,0)
     13973"RTN","BMXMON",195,0)
    1396013974  ; Read message type
    13961 "RTN","BMXMON",190,0)
     13975"RTN","BMXMON",196,0)
    1396213976  N BMXACT,BMXDTIME
    13963 "RTN","BMXMON",191,0)
     13977"RTN","BMXMON",197,0)
    1396413978  S BMXDTIME=10  ; change in 2.2 instead of 9999999 - initial conn timout
    13965 "RTN","BMXMON",192,0)
     13979"RTN","BMXMON",198,0)
    1396613980  R BMXACT#5:BMXDTIME
    13967 "RTN","BMXMON",193,0)
     13981"RTN","BMXMON",199,0)
    1396813982  ;
    13969 "RTN","BMXMON",194,0)
     13983"RTN","BMXMON",200,0)
    1397013984  D LOG("Read: "_BMXACT)
    13971 "RTN","BMXMON",195,0)
     13985"RTN","BMXMON",201,0)
    1397213986  ;
    13973 "RTN","BMXMON",196,0)
     13987"RTN","BMXMON",202,0)
    1397413988  Q:BMXACT'="{BMX}"  ; Not a BMX message - quit.
    13975 "RTN","BMXMON",197,0)
     13989"RTN","BMXMON",203,0)
    1397613990  ; Fall through to below...
    13977 "RTN","BMXMON",198,0)
     13991"RTN","BMXMON",204,0)
    1397813992GTMLNX    ;EP from XWBTCPM for GT.M
    13979 "RTN","BMXMON",199,0)
     13993"RTN","BMXMON",205,0)
    1398013994  ; not implementing NS and integrated authentication
    13981 "RTN","BMXMON",200,0)
     13995"RTN","BMXMON",206,0)
    1398213996  ; Vars: Read timeout, msg len, msg, windows auth, Namespace
    13983 "RTN","BMXMON",201,0)
     13997"RTN","BMXMON",207,0)
    1398413998  N BMXDTIME,BMXLEN,BMXACT,BMXWIN,BMXNS
    13985 "RTN","BMXMON",202,0)
     13999"RTN","BMXMON",208,0)
    1398614000  S BMXNSJ="",BMXWIN=0  ; No NS on GT.M, no Windows Authentication
    13987 "RTN","BMXMON",203,0)
     14001"RTN","BMXMON",209,0)
    1398814002  S BMXDTIME(1)=.5,BMXDTIME=180  ; sign on timeout
    13989 "RTN","BMXMON",204,0)
     14003"RTN","BMXMON",210,0)
    1399014004  R BMXACT#5:BMXDTIME ;Read next 5 chars - message length
    13991 "RTN","BMXMON",205,0)
     14005"RTN","BMXMON",211,0)
    1399214006  ;
    13993 "RTN","BMXMON",206,0)
     14007"RTN","BMXMON",212,0)
    1399414008  D LOG("Read: "_BMXACT)
    13995 "RTN","BMXMON",207,0)
     14009"RTN","BMXMON",213,0)
    1399614010  ;
    13997 "RTN","BMXMON",208,0)
     14011"RTN","BMXMON",214,0)
    1399814012  S BMXLEN=+BMXACT
    13999 "RTN","BMXMON",209,0)
     14013"RTN","BMXMON",215,0)
    1400014014  R BMXACT#BMXLEN:BMXDTIME
    14001 "RTN","BMXMON",210,0)
    14002   ;
    14003 "RTN","BMXMON",211,0)
    14004   D LOG("Read: "_BMXACT)
    14005 "RTN","BMXMON",212,0)
    14006   ;
    14007 "RTN","BMXMON",213,0)
    14008   I $P(BMXACT,"^")="TCPconnect" S ^BMXTMP("CONNECT STATUS",$JOB)="CONNECTION OK" G SESSRES  ; <--WARNING: A GOTO
    14009 "RTN","BMXMON",214,0)
    14010   I $P(BMXACT,"^")="TCPshutdown" W "ack",! Q
    14011 "RTN","BMXMON",215,0)
    14012   QUIT  ; Should't hit this quit, but just in case
    1401314015"RTN","BMXMON",216,0)
    1401414016  ;
    1401514017"RTN","BMXMON",217,0)
     14018  D LOG("Read: "_BMXACT)
     14019"RTN","BMXMON",218,0)
     14020  ;
     14021"RTN","BMXMON",219,0)
     14022  I $P(BMXACT,"^")="TCPconnect" S ^BMXTMP("CONNECT STATUS",$JOB)="CONNECTION OK" G SESSRES  ; <--WARNING: A GOTO
     14023"RTN","BMXMON",220,0)
     14024  I $P(BMXACT,"^")="TCPshutdown" W "ack",! Q
     14025"RTN","BMXMON",221,0)
     14026  QUIT  ; Should't hit this quit, but just in case
     14027"RTN","BMXMON",222,0)
     14028  ;
     14029"RTN","BMXMON",223,0)
    1401614030SESSION(BMXWIN) ;EP
    14017 "RTN","BMXMON",218,0)
     14031"RTN","BMXMON",224,0)
    1401814032 ;Start session monitor
    14019 "RTN","BMXMON",219,0)
     14033"RTN","BMXMON",225,0)
    1402014034 ;BMXWIN = 1: Enable integrated security
    14021 "RTN","BMXMON",220,0)
     14035"RTN","BMXMON",226,0)
    1402214036SESSRES ;EP - reentry point from trap
    14023 "RTN","BMXMON",221,0)
     14037"RTN","BMXMON",227,0)
    1402414038 ; new in 2.2: Use kernel rpc timeout instead of 9999999
    14025 "RTN","BMXMON",222,0)
     14039"RTN","BMXMON",228,0)
    1402614040 S BMXDTIME(1)=.5,BMXDTIME=$$BAT^XUPARAM 
    14027 "RTN","BMXMON",223,0)
    14028  ;
    14029 "RTN","BMXMON",224,0)
     14041"RTN","BMXMON",229,0)
     14042 ;
     14043"RTN","BMXMON",230,0)
    1403014044 ; Change Process Name (new in 2.2 and 2.3)
    14031 "RTN","BMXMON",225,0)
     14045"RTN","BMXMON",231,0)
    1403214046 ; (GT.M doesn't store the IP in $P, but Cache does. We get GT.M
    14033 "RTN","BMXMON",226,0)
     14047"RTN","BMXMON",232,0)
    1403414048 ;   remote process IP from linux env var $REMOTE_HOST)
    14035 "RTN","BMXMON",227,0)
     14049"RTN","BMXMON",233,0)
    1403614050 D:+$G(IO("GTM-IP")) CHPRN("BMX:ip"_$P(IO("GTM-IP"),".",3,4)) ; GT.M
    14037 "RTN","BMXMON",228,0)
     14051"RTN","BMXMON",234,0)
    1403814052 D:+$P CHPRN("BMX:ip_"_$P($P,".",3,4)) ; Cache
    14039 "RTN","BMXMON",229,0)
    14040  ;
    14041 "RTN","BMXMON",230,0)
     14053"RTN","BMXMON",235,0)
     14054 ;
     14055"RTN","BMXMON",236,0)
    1404214056 ;IHS/OIT/HMW SAC Exemption Applied For
    14043 "RTN","BMXMON",231,0)
     14057"RTN","BMXMON",237,0)
    1404414058 N $ESTACK S $ETRAP="D ETRAP^BMXMON"
    14045 "RTN","BMXMON",232,0)
     14059"RTN","BMXMON",238,0)
    1404614060 S DIQUIET=1,U="^" D DT^DICRW
    14047 "RTN","BMXMON",233,0)
     14061"RTN","BMXMON",239,0)
    1404814062 D UNREGALL^BMXMEVN ;Unregister all events for this session
    14049 "RTN","BMXMON",234,0)
     14063"RTN","BMXMON",240,0)
    1405014064 U $P D SESSMAIN
    14051 "RTN","BMXMON",235,0)
     14065"RTN","BMXMON",241,0)
    1405214066 ;Turn off the error trap for the exit
    14053 "RTN","BMXMON",236,0)
     14067"RTN","BMXMON",242,0)
    1405414068 S $ETRAP=""
    14055 "RTN","BMXMON",237,0)
     14069"RTN","BMXMON",243,0)
    1405614070 I $G(DUZ) D LOGOUT^XUSRB
    14057 "RTN","BMXMON",238,0)
     14071"RTN","BMXMON",244,0)
    1405814072 K BMXR,BMXARY
    14059 "RTN","BMXMON",239,0)
     14073"RTN","BMXMON",245,0)
    1406014074 C $P ;IHS/OIT/HMW SAC Exemption Applied For
    14061 "RTN","BMXMON",240,0)
    14062  Q
    14063 "RTN","BMXMON",241,0)
    14064  ;
    14065 "RTN","BMXMON",242,0)
     14075"RTN","BMXMON",246,0)
     14076 Q
     14077"RTN","BMXMON",247,0)
     14078 ;
     14079"RTN","BMXMON",248,0)
    1406614080SESSMAIN ; MAIN LOOP!!!!!!
    14067 "RTN","BMXMON",243,0)
    14068  N BMXTBUF
    14069 "RTN","BMXMON",244,0)
     14081"RTN","BMXMON",249,0)
     14082 N BMXTBUF ; BMX Read Buffer
     14083"RTN","BMXMON",250,0)
     14084    N BMXWBUF S BMXWBUF="" ; BMX Write Buffer
     14085"RTN","BMXMON",251,0)
    1407014086 D SETUP^BMXMSEC(.RET) ;Setup required system vars
    14071 "RTN","BMXMON",245,0)
     14087"RTN","BMXMON",252,0)
    1407214088 S U="^"
    14073 "RTN","BMXMON",246,0)
     14089"RTN","BMXMON",253,0)
    1407414090 U $P
    14075 "RTN","BMXMON",247,0)
     14091"RTN","BMXMON",254,0)
    1407614092 F  D  Q:BMXTBUF="#BYE#"
    14077 "RTN","BMXMON",248,0)
     14093"RTN","BMXMON",255,0)
    1407814094 . R BMXTBUF#11:BMXDTIME IF '$T D TIMEOUT S BMXTBUF="#BYE#" Q  ;IHS/OIT/HMW SAC Exemption Applied For
    14079 "RTN","BMXMON",249,0)
     14095"RTN","BMXMON",256,0)
    1408014096 . ;
    14081 "RTN","BMXMON",250,0)
     14097"RTN","BMXMON",257,0)
    1408214098 . D LOG("Read: "_BMXTBUF)
    14083 "RTN","BMXMON",251,0)
     14099"RTN","BMXMON",258,0)
    1408414100 . ;
    14085 "RTN","BMXMON",252,0)
     14101"RTN","BMXMON",259,0)
    1408614102 . I BMXTBUF="#BYE#" QUIT  ;**QUITTING HERE**
    14087 "RTN","BMXMON",253,0)
     14103"RTN","BMXMON",260,0)
    1408814104 . S BMXHTYPE=$S($E(BMXTBUF,1,5)="{BMX}":1,1:0)  ;check HDR
    14089 "RTN","BMXMON",254,0)
     14105"RTN","BMXMON",261,0)
    1409014106 . I 'BMXHTYPE S BMXTBUF="#BYE#" D  QUIT  ;;***QUITTING HERE***
    14091 "RTN","BMXMON",255,0)
     14107"RTN","BMXMON",262,0)
    1409214108 . . D SNDERR
    14093 "RTN","BMXMON",256,0)
    14094  . . W BMXTBUF,$C(4),!
    14095 "RTN","BMXMON",257,0)
    14096  . . D LOG("Write: "_BMXTBUF_$C(4)_"(flush)")
    14097 "RTN","BMXMON",258,0)
     14109"RTN","BMXMON",263,0)
     14110 . . D WRITE(BMXTBUF_$C(4)),WBF
     14111"RTN","BMXMON",264,0)
    1409814112 . S BMXTLEN=$E(BMXTBUF,6,10),L=$E(BMXTBUF,11,11)
    14099 "RTN","BMXMON",259,0)
     14113"RTN","BMXMON",265,0)
    1410014114 . R BMXTBUF#4:BMXDTIME(1)
    14101 "RTN","BMXMON",260,0)
    14102  . ;
    14103 "RTN","BMXMON",261,0)
    14104  . D LOG("Read: "_BMXTBUF)
    14105 "RTN","BMXMON",262,0)
    14106  . ;
    14107 "RTN","BMXMON",263,0)
    14108  . S BMXTBUF=L_BMXTBUF ;IHS/OIT/HMW SAC Exemption Applied For
    14109 "RTN","BMXMON",264,0)
    14110  . S BMXPLEN=BMXTBUF
    14111 "RTN","BMXMON",265,0)
    14112  . R BMXTBUF#BMXPLEN:BMXDTIME(1) ;IHS/OIT/HMW SAC Exemption Applied For
    1411314115"RTN","BMXMON",266,0)
    1411414116 . ;
     
    1411814120 . ;
    1411914121"RTN","BMXMON",269,0)
     14122 . S BMXTBUF=L_BMXTBUF ;IHS/OIT/HMW SAC Exemption Applied For
     14123"RTN","BMXMON",270,0)
     14124 . S BMXPLEN=BMXTBUF
     14125"RTN","BMXMON",271,0)
     14126 . R BMXTBUF#BMXPLEN:BMXDTIME(1) ;IHS/OIT/HMW SAC Exemption Applied For
     14127"RTN","BMXMON",272,0)
     14128 . ;
     14129"RTN","BMXMON",273,0)
     14130 . D LOG("Read: "_BMXTBUF)
     14131"RTN","BMXMON",274,0)
     14132 . ;
     14133"RTN","BMXMON",275,0)
    1412014134 . I $P(BMXTBUF,U)="TCPconnect" D  QUIT  ;;***QUIT HERE***
    14121 "RTN","BMXMON",270,0)
     14135"RTN","BMXMON",276,0)
    1412214136 . . D SNDERR
    14123 "RTN","BMXMON",271,0)
    14124  . . W "accept",$C(4),!  ;Ack
    14125 "RTN","BMXMON",272,0)
    14126  . . ;
    14127 "RTN","BMXMON",273,0)
    14128  . . D LOG("Write: accept"_$C(4)_"(flush)")
    14129 "RTN","BMXMON",274,0)
    14130  . . ;
    14131 "RTN","BMXMON",275,0)
     14137"RTN","BMXMON",277,0)
     14138 . . D WRITE("accept"_$C(4)),WBF  ;Ack
     14139"RTN","BMXMON",278,0)
    1413214140 . IF BMXHTYPE D
    14133 "RTN","BMXMON",276,0)
     14141"RTN","BMXMON",279,0)
    1413414142 . . K BMXR,BMXARY
    14135 "RTN","BMXMON",277,0)
     14143"RTN","BMXMON",280,0)
    1413614144 . . IF BMXTBUF="#BYE#" D  QUIT
    14137 "RTN","BMXMON",278,0)
     14145"RTN","BMXMON",281,0)
    1413814146 . . . D SNDERR
    14139 "RTN","BMXMON",279,0)
    14140  . . . W "#BYE#",$C(4),!
    14141 "RTN","BMXMON",280,0)
    14142  . . . ;
    14143 "RTN","BMXMON",281,0)
    14144  . . . D LOG("Write: #BYE#\4")
    1414514147"RTN","BMXMON",282,0)
    14146  . . . ;
     14148 . . . D WRITE("#BYE#"_$C(4))
    1414714149"RTN","BMXMON",283,0)
     14150    . . . D WBF
     14151"RTN","BMXMON",284,0)
    1414814152 . . S BMXTLEN=BMXTLEN-15
    14149 "RTN","BMXMON",284,0)
     14153"RTN","BMXMON",285,0)
    1415014154 . . D CALLP^BMXMBRK(.BMXR,BMXTBUF)
    14151 "RTN","BMXMON",285,0)
     14155"RTN","BMXMON",286,0)
    1415214156 . . S BMXPTYPE=$S('$D(BMXPTYPE):1,BMXPTYPE<1:1,BMXPTYPE>6:1,1:BMXPTYPE)
    14153 "RTN","BMXMON",286,0)
     14157"RTN","BMXMON",287,0)
    1415414158 . IF BMXTBUF="#BYE#" Q
    14155 "RTN","BMXMON",287,0)
     14159"RTN","BMXMON",288,0)
    1415614160 . U $P
    14157 "RTN","BMXMON",288,0)
     14161"RTN","BMXMON",289,0)
    1415814162 . D SNDERR ;Clears SNDERR parameters
    14159 "RTN","BMXMON",289,0)
     14163"RTN","BMXMON",290,0)
    1416014164 . D SND
    14161 "RTN","BMXMON",290,0)
    14162  . D WRITE($C(4)) W ! ;send eot and flush buffer
    1416314165"RTN","BMXMON",291,0)
    14164  . ;
     14166 . D WRITE($C(4)) ;send eot
    1416514167"RTN","BMXMON",292,0)
    14166  . D LOG("Write: "_$C(4))
     14168    . D WBF ; Flush Buffer
    1416714169"RTN","BMXMON",293,0)
    14168  . ;
     14170 D UNREGALL^BMXMEVN ;Unregister all events for this session
    1416914171"RTN","BMXMON",294,0)
    14170  D UNREGALL^BMXMEVN ;Unregister all events for this session
     14172 Q  ;End Of Main
    1417114173"RTN","BMXMON",295,0)
    14172  Q  ;End Of Main
     14174 ;
    1417314175"RTN","BMXMON",296,0)
    14174  ;
     14176SNDERR ;send error information
    1417514177"RTN","BMXMON",297,0)
    14176  ;
     14178 ;BMXSEC is the security packet, BMXERROR is application packet
    1417714179"RTN","BMXMON",298,0)
    14178 SNDERR ;send error information
     14180 N X
    1417914181"RTN","BMXMON",299,0)
    14180  ;BMXSEC is the security packet, BMXERROR is application packet
     14182 S X=$E($G(BMXSEC),1,255)
    1418114183"RTN","BMXMON",300,0)
    14182  N X
     14184 D WRITE($C($L(X))_X)
    1418314185"RTN","BMXMON",301,0)
    14184  S X=$E($G(BMXSEC),1,255)
     14186 S X=$E($G(BMXERROR),1,255)
    1418514187"RTN","BMXMON",302,0)
    14186  W $C($L(X))_X W !
     14188 D WRITE($C($L(X))_X)
    1418714189"RTN","BMXMON",303,0)
    14188  D LOG("Write: "_$C($L(X))_X_"(flush)")
     14190 S BMXERROR="",BMXSEC="" ;clears parameters
    1418914191"RTN","BMXMON",304,0)
    14190  S X=$E($G(BMXERROR),1,255)
     14192 Q
    1419114193"RTN","BMXMON",305,0)
    14192  W $C($L(X))_X W !
     14194 ;
    1419314195"RTN","BMXMON",306,0)
    14194  D LOG("Write: "_$C($L(X))_X_"(flush)")
     14196WRITE(BMXSTR) ;Write a data string to the output buffer
    1419514197"RTN","BMXMON",307,0)
    14196  S BMXERROR="",BMXSEC="" ;clears parameters
     14198    F  Q:'$L(BMXSTR)  D
    1419714199"RTN","BMXMON",308,0)
    14198  Q
     14200    . I $L(BMXWBUF)+$L(BMXSTR)>32767 D WBF  ; Maximum String Length on Cache
    1419914201"RTN","BMXMON",309,0)
    14200  ;
     14202    . S BMXWBUF=BMXWBUF_$E(BMXSTR,1,255),BMXSTR=$E(BMXSTR,256,999999)
    1420114203"RTN","BMXMON",310,0)
    14202 WRITE(BMXSTR) ;Write a data string
     14204    QUIT
    1420314205"RTN","BMXMON",311,0)
    14204  ;
     14206    ;
    1420514207"RTN","BMXMON",312,0)
    14206  I $L(BMXSTR)<511 W ! W BMXSTR Q
     14208WBF ;Write Buffer to Network Stream then flush
    1420714209"RTN","BMXMON",313,0)
    14208  ;Handle a long string
     14210    Q:'$L(BMXWBUF)
    1420914211"RTN","BMXMON",314,0)
    14210  W ! ;Flush the buffer
     14212    I $G(XWBDEBUG)>2,$L(BMXWBUF) D LOG^XWBDLOG("wrt ("_$L(BMXWBUF)_"): "_BMXWBUF)
    1421114213"RTN","BMXMON",315,0)
    14212  F  Q:'$L(BMXSTR)  W $E(BMXSTR,1,510),! S BMXSTR=$E(BMXSTR,511,99999)
     14214    W BMXWBUF,!
    1421314215"RTN","BMXMON",316,0)
    14214  Q
     14216    S BMXWBUF=""
    1421514217"RTN","BMXMON",317,0)
     14218    QUIT
     14219"RTN","BMXMON",318,0)
     14220 
     14221"RTN","BMXMON",319,0)
    1421614222SND ; -- send data for all, Let WRITE sort it out
    14217 "RTN","BMXMON",318,0)
     14223"RTN","BMXMON",320,0)
    1421814224 N I,T
    14219 "RTN","BMXMON",319,0)
    14220  ;
    14221 "RTN","BMXMON",320,0)
     14225"RTN","BMXMON",321,0)
     14226 ;
     14227"RTN","BMXMON",322,0)
    1422214228 ; -- error or abort occurred, send null
    14223 "RTN","BMXMON",321,0)
    14224  IF $L(BMXSEC)>0 D WRITE(""),LOG("Write Sting.Empty") Q
    14225 "RTN","BMXMON",322,0)
     14229"RTN","BMXMON",323,0)
     14230 IF $L(BMXSEC)>0 D WRITE("") QUIT
     14231"RTN","BMXMON",324,0)
     14232    ;
     14233"RTN","BMXMON",325,0)
    1422614234 ; -- single value
    14227 "RTN","BMXMON",323,0)
    14228  IF BMXPTYPE=1 S BMXR=$G(BMXR) D WRITE(BMXR),LOG("Write: "_BMXR) Q
    14229 "RTN","BMXMON",324,0)
    14230  ; -- table delimited by CR+LF
    14231 "RTN","BMXMON",325,0)
    14232  IF BMXPTYPE=2 D  Q
    1423314235"RTN","BMXMON",326,0)
    14234  . S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE(BMXR(I)),WRITE($C(13,10)),LOG("Write: "_BMXR(I))
     14236 IF BMXPTYPE=1 S BMXR=$G(BMXR) D WRITE(BMXR) QUIT
    1423514237"RTN","BMXMON",327,0)
     14238 ;
     14239"RTN","BMXMON",328,0)
     14240    ; -- table delimited by CR+LF
     14241"RTN","BMXMON",329,0)
     14242 IF BMXPTYPE=2 D  QUIT
     14243"RTN","BMXMON",330,0)
     14244 . S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE(BMXR(I)),WRITE($C(13,10))
     14245"RTN","BMXMON",331,0)
     14246    ;
     14247"RTN","BMXMON",332,0)
    1423614248 ; -- word processing
    14237 "RTN","BMXMON",328,0)
    14238  IF BMXPTYPE=3 D  Q
    14239 "RTN","BMXMON",329,0)
    14240  . S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE(BMXR(I)),LOG("Write: "_BMXR(I)) D:BMXWRAP WRITE($C(13,10)),LOG("Write: "_$C(13,10))
    14241 "RTN","BMXMON",330,0)
     14249"RTN","BMXMON",333,0)
     14250 IF BMXPTYPE=3 D  QUIT
     14251"RTN","BMXMON",334,0)
     14252 . S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE(BMXR(I)),WRITE($C(13,10)):BMXWRAP
     14253"RTN","BMXMON",335,0)
     14254    ;
     14255"RTN","BMXMON",336,0)
    1424214256 ; -- global array
    14243 "RTN","BMXMON",331,0)
    14244  IF BMXPTYPE=4 D  Q
    14245 "RTN","BMXMON",332,0)
    14246  . S I=$G(BMXR) Q:I=""  S T=$E(I,1,$L(I)-1) D:$D(@I)>10 WRITE(@I),LOG("Write: "_@I)
    14247 "RTN","BMXMON",333,0)
    14248  . F  S I=$Q(@I) Q:I=""!(I'[T)  W ! W @I W:BMXWRAP&(@I'=$C(13,10)) $C(13,10) D LOG("Write: "_@I)
    14249 "RTN","BMXMON",334,0)
     14257"RTN","BMXMON",337,0)
     14258 IF BMXPTYPE=4 D  QUIT
     14259"RTN","BMXMON",338,0)
     14260 . S I=$G(BMXR) Q:I=""  S T=$E(I,1,$L(I)-1) D:$D(@I)>10 WRITE(@I)
     14261"RTN","BMXMON",339,0)
     14262 . F  S I=$Q(@I) Q:I=""!(I'[T)  D WRITE(@I),WRITE($C(13,10)):(BMXWRAP&(@I'=$C(13,10)))
     14263"RTN","BMXMON",340,0)
    1425014264 . IF $D(@BMXR) K @BMXR
    14251 "RTN","BMXMON",335,0)
     14265"RTN","BMXMON",341,0)
     14266    ;
     14267"RTN","BMXMON",342,0)
    1425214268 ; -- global instance
    14253 "RTN","BMXMON",336,0)
    14254  IF BMXPTYPE=5 S BMXR=$G(@BMXR) D WRITE(BMXR),LOG("Write: "_BMXR) Q
    14255 "RTN","BMXMON",337,0)
     14269"RTN","BMXMON",343,0)
     14270 IF BMXPTYPE=5 S BMXR=$G(@BMXR) D WRITE(BMXR) QUIT
     14271"RTN","BMXMON",344,0)
     14272    ;
     14273"RTN","BMXMON",345,0)
    1425614274 ; -- variable length records only good upto 255 char)
    14257 "RTN","BMXMON",338,0)
    14258  IF BMXPTYPE=6 S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE($C($L(BMXR(I)))),WRITE(BMXR(I)),LOG("Write: "_$C($L(BMXR(I)))_BMXR(I))
    14259 "RTN","BMXMON",339,0)
    14260  Q
    14261 "RTN","BMXMON",340,0)
    14262  ;
    14263 "RTN","BMXMON",341,0)
     14275"RTN","BMXMON",346,0)
     14276 IF BMXPTYPE=6 S I="" F  S I=$O(BMXR(I)) Q:I=""  D WRITE($C($L(BMXR(I)))),WRITE(BMXR(I))
     14277"RTN","BMXMON",347,0)
     14278 QUIT
     14279"RTN","BMXMON",348,0)
     14280 ;
     14281"RTN","BMXMON",349,0)
    1426414282TIMEOUT ;Do this on MAIN  loop timeout
    14265 "RTN","BMXMON",342,0)
    14266  I $G(DUZ)>0 D SNDERR,WRITE("#BYE#"_$C(4)) Q
    14267 "RTN","BMXMON",343,0)
     14283"RTN","BMXMON",350,0)
     14284 I $G(DUZ)>0 D SNDERR,WRITE("#BYE#"_$C(4)),WBF QUIT
     14285"RTN","BMXMON",351,0)
    1426814286 ;Sign-on timeout
    14269 "RTN","BMXMON",344,0)
     14287"RTN","BMXMON",352,0)
    1427014288 S BMXR(0)=0,BMXR(1)=1,BMXR(2)="",BMXR(3)="TIME-OUT",BMXPTYPE=2
    14271 "RTN","BMXMON",345,0)
    14272  D SNDERR,SND,WRITE($C(4))
    14273 "RTN","BMXMON",346,0)
    14274  Q
    14275 "RTN","BMXMON",347,0)
    14276  ;
    14277 "RTN","BMXMON",348,0)
     14289"RTN","BMXMON",353,0)
     14290 D SNDERR,SND,WRITE($C(4)),WBF QUIT
     14291"RTN","BMXMON",354,0)
     14292 ;
     14293"RTN","BMXMON",355,0)
    1427814294SEMAPHOR(BMXTSKT,BMXACT) ;Lock/Unlock BMXMON semaphore
    14279 "RTN","BMXMON",349,0)
     14295"RTN","BMXMON",356,0)
    1428014296 N RESULT
    14281 "RTN","BMXMON",350,0)
     14297"RTN","BMXMON",357,0)
    1428214298 S U="^",RESULT=1
    14283 "RTN","BMXMON",351,0)
     14299"RTN","BMXMON",358,0)
    1428414300 D GETENV^%ZOSV ;get Y=UCI^VOL^NODE^BOXLOOKUP of current system
    14285 "RTN","BMXMON",352,0)
     14301"RTN","BMXMON",359,0)
    1428614302 I BMXACT="LOCK" D
    14287 "RTN","BMXMON",353,0)
     14303"RTN","BMXMON",360,0)
    1428814304 . L +^BMXMON("BMXMON",$P(Y,U,2),$P(Y,U),$P(Y,U,4),BMXTSKT):1
    14289 "RTN","BMXMON",354,0)
     14305"RTN","BMXMON",361,0)
    1429014306 . S RESULT=$T
    14291 "RTN","BMXMON",355,0)
     14307"RTN","BMXMON",362,0)
    1429214308 E  L -^BMXMON("BMXMON",$P(Y,U,2),$P(Y,U),$P(Y,U,4),BMXTSKT)
    14293 "RTN","BMXMON",356,0)
     14309"RTN","BMXMON",363,0)
    1429414310 Q RESULT
    14295 "RTN","BMXMON",357,0)
    14296  ;
    14297 "RTN","BMXMON",358,0)
     14311"RTN","BMXMON",364,0)
     14312 ;
     14313"RTN","BMXMON",365,0)
    1429814314CHPRN(N) ;Change process name to N.
    14299 "RTN","BMXMON",359,0)
     14315"RTN","BMXMON",366,0)
    1430014316 D SETNM^%ZOSV($E(N,1,15))
    14301 "RTN","BMXMON",360,0)
    14302  Q
    14303 "RTN","BMXMON",361,0)
     14317"RTN","BMXMON",367,0)
     14318 Q
     14319"RTN","BMXMON",368,0)
    1430414320 ;
    14305 "RTN","BMXMON",362,0)
     14321"RTN","BMXMON",369,0)
    1430614322CKSTAT(OUT,IN) ; EP - RPC: BMX CONNECT STATUS ; CONFIRMS THAT THAT A VALID PROCESS HAS BEEN SPAWNED BY BMXMON
    14307 "RTN","BMXMON",363,0)
     14323"RTN","BMXMON",370,0)
    1430814324 N PORT,STATUS,JOBID
    14309 "RTN","BMXMON",364,0)
     14325"RTN","BMXMON",371,0)
    1431014326 S PORT=+$P($P,"|",3)
    14311 "RTN","BMXMON",365,0)
     14327"RTN","BMXMON",372,0)
    1431214328 S JOBID=$P($J,":",1)
    14313 "RTN","BMXMON",366,0)
     14329"RTN","BMXMON",373,0)
    1431414330 I $G(^BMXTMP("CONNECT STATUS",JOBID))="" HANG 1  ;Wait for job to spawn ZCHILD to be set in MON^
    14315 "RTN","BMXMON",367,0)
     14331"RTN","BMXMON",374,0)
    1431614332 I $G(^BMXTMP("CONNECT STATUS",JOBID))="" HANG 1
    14317 "RTN","BMXMON",368,0)
     14333"RTN","BMXMON",375,0)
    1431814334 I $G(^BMXTMP("CONNECT STATUS",JOBID))="" HANG 1
    14319 "RTN","BMXMON",369,0)
     14335"RTN","BMXMON",376,0)
    1432014336 S STATUS=$G(^BMXTMP("CONNECT STATUS",JOBID))
    14321 "RTN","BMXMON",370,0)
     14337"RTN","BMXMON",377,0)
    1432214338 K ^BMXTMP("CONNECT STATUS",JOBID)
    14323 "RTN","BMXMON",371,0)
     14339"RTN","BMXMON",378,0)
    1432414340 I STATUS="" S STATUS="CONNECTION STATUS UNKNOWN"
    14325 "RTN","BMXMON",372,0)
     14341"RTN","BMXMON",379,0)
    1432614342 S OUT=PORT_"|"_STATUS_"|"_JOBID
    14327 "RTN","BMXMON",373,0)
    14328  Q
    14329 "RTN","BMXMON",374,0)
    14330  ;
    14331 "RTN","BMXMON",375,0)
     14343"RTN","BMXMON",380,0)
     14344 Q
     14345"RTN","BMXMON",381,0)
     14346 ;
     14347"RTN","BMXMON",382,0)
    1433214348MARKER(BMXPORT,BMXMODE) ;Set/Test/Clear Problem Marker, BMXMODE=0 is a function
    14333 "RTN","BMXMON",376,0)
     14349"RTN","BMXMON",383,0)
    1433414350 N IP,Y,%,REF X ^%ZOSF("UCI") S REF=Y,IP="0.0.0.0",%=0
    14335 "RTN","BMXMON",377,0)
     14351"RTN","BMXMON",384,0)
    1433614352 L +^BMX(IP,REF,BMXPORT,"PROBLEM MARKER"):1
    14337 "RTN","BMXMON",378,0)
     14353"RTN","BMXMON",385,0)
    1433814354 I BMXMODE=1 S ^BMX(IP,REF,BMXPORT,"PROBLEM MARKER")=1
    14339 "RTN","BMXMON",379,0)
     14355"RTN","BMXMON",386,0)
    1434014356 I BMXMODE=0 S:$D(^BMX(IP,REF,BMXPORT,"PROBLEM MARKER")) %=1
    14341 "RTN","BMXMON",380,0)
     14357"RTN","BMXMON",387,0)
    1434214358 I BMXMODE=-1 K ^BMX(IP,REF,BMXPORT,"PROBLEM MARKER")
    14343 "RTN","BMXMON",381,0)
     14359"RTN","BMXMON",388,0)
    1434414360 L -^BMX(IP,REF,BMXPORT,"PROBLEM MARKER")
    14345 "RTN","BMXMON",382,0)
     14361"RTN","BMXMON",389,0)
    1434614362 Q:BMXMODE=0 % Q
    14347 "RTN","BMXMON",383,0)
    14348  ;
    14349 "RTN","BMXMON",384,0)
     14363"RTN","BMXMON",390,0)
     14364 ;
     14365"RTN","BMXMON",391,0)
    1435014366ETRAP ; -- on trapped error, send error info to client
    14351 "RTN","BMXMON",385,0)
     14367"RTN","BMXMON",392,0)
    1435214368 ; Error Trap Vars: Code, Error, Last Global Reference
    14353 "RTN","BMXMON",386,0)
    14354  N BMXERC,BMXERR,BMXLGR
    14355 "RTN","BMXMON",387,0)
    14356  ;
    14357 "RTN","BMXMON",388,0)
     14369"RTN","BMXMON",393,0)
     14370 N BMXERC,BMXERROR,BMXLGR
     14371"RTN","BMXMON",394,0)
     14372 ;
     14373"RTN","BMXMON",395,0)
    1435814374 ;Change trapping during trap.
    14359 "RTN","BMXMON",389,0)
     14375"RTN","BMXMON",396,0)
    1436014376 S $ETRAP="D ^%ZTER HALT" ;IHS/OIT/HMW SAC Exemption Applied For
    14361 "RTN","BMXMON",390,0)
    14362  ;
    14363 "RTN","BMXMON",391,0)
     14377"RTN","BMXMON",397,0)
     14378 ;
     14379"RTN","BMXMON",398,0)
    1436414380 ; If the error is simply that we can't write to the TCP device
    14365 "RTN","BMXMON",392,0)
     14381"RTN","BMXMON",399,0)
    1436614382 ; clear and log out
    14367 "RTN","BMXMON",393,0)
     14383"RTN","BMXMON",400,0)
    1436814384 ; GT.M Error Code.
    14369 "RTN","BMXMON",394,0)
     14385"RTN","BMXMON",401,0)
    1437014386 I $ECODE=",Z150376602," S $ECODE="" D:$G(DUZ) LOGOUT^XUSRB HALT
    14371 "RTN","BMXMON",395,0)
     14387"RTN","BMXMON",402,0)
    1437214388 ; Cache Error Codes:
    14373 "RTN","BMXMON",396,0)
     14389"RTN","BMXMON",403,0)
    1437414390 I ($EC["READ")!($EC["WRITE")!($EC["SYSTEM-F") S $ECODE="" D:$G(DUZ) LOGOUT^XUSRB HALT
    14375 "RTN","BMXMON",397,0)
    14376  ;
    14377 "RTN","BMXMON",398,0)
     14391"RTN","BMXMON",404,0)
     14392 ;
     14393"RTN","BMXMON",405,0)
    1437814394 ; Otherwise, log error and send to client
    14379 "RTN","BMXMON",399,0)
     14395"RTN","BMXMON",406,0)
    1438014396 S BMXERC=$$EC^%ZOSV
    14381 "RTN","BMXMON",400,0)
    14382  S BMXERR="M ERROR="_BMXERC_$C(13,10)_"LAST REF="
    14383 "RTN","BMXMON",401,0)
     14397"RTN","BMXMON",407,0)
     14398 S BMXERROR="M ERROR="_BMXERC_$C(13,10)_"LAST REF="
     14399"RTN","BMXMON",408,0)
    1438414400 S BMXLGR=$$LGR^%ZOSV_$C(4)
    14385 "RTN","BMXMON",402,0)
    14386  S BMXERR=BMXERR_BMXLGR
    14387 "RTN","BMXMON",403,0)
    14388  ;
    14389 "RTN","BMXMON",404,0)
     14401"RTN","BMXMON",409,0)
     14402 S BMXERROR=BMXERROR_BMXLGR
     14403"RTN","BMXMON",410,0)
     14404 ;
     14405"RTN","BMXMON",411,0)
    1439014406 D ^%ZTER ;%ZTER clears $ZE and $ECODE
    14391 "RTN","BMXMON",405,0)
    14392  ;
    14393 "RTN","BMXMON",406,0)
     14407"RTN","BMXMON",412,0)
     14408 ;
     14409"RTN","BMXMON",413,0)
    1439414410 U $P
    14395 "RTN","BMXMON",407,0)
    14396  ;
    14397 "RTN","BMXMON",408,0)
    14398  D SNDERR,WRITE(BMXERR) W !
    14399 "RTN","BMXMON",409,0)
    14400  ;
    14401 "RTN","BMXMON",410,0)
     14411"RTN","BMXMON",414,0)
     14412 ;
     14413"RTN","BMXMON",415,0)
     14414 D SNDERR,WRITE(BMXERROR),WBF
     14415"RTN","BMXMON",416,0)
     14416 ;
     14417"RTN","BMXMON",417,0)
    1440214418 S $ETRAP="Q:($ESTACK&'$QUIT)  Q:$ESTACK -9 S $ECODE="""" G SESSRES^BMXMON",$ECODE=",U99," ;IHS/OIT/HMW SAC Exemption Applied For
    14403 "RTN","BMXMON",411,0)
     14419"RTN","BMXMON",418,0)
    1440414420 QUIT
    14405 "RTN","BMXMON",412,0)
    14406  ;
    14407 "RTN","BMXMON",413,0)
     14421"RTN","BMXMON",419,0)
     14422 ;
     14423"RTN","BMXMON",420,0)
    1440814424LOG(STR) ; EP - Log stuff in Broker log only if XWBDLOG is defined
    14409 "RTN","BMXMON",414,0)
     14425"RTN","BMXMON",421,0)
    1441014426 D:XWBDEBUG LOG^XWBDLOG(STR)
    14411 "RTN","BMXMON",415,0)
     14427"RTN","BMXMON",422,0)
    1441214428 QUIT
    14413 "RTN","BMXMON",416,0)
    14414  ;
    14415 "RTN","BMXMON",417,0)
     14429"RTN","BMXMON",423,0)
     14430 ;
     14431"RTN","BMXMON",424,0)
    1441614432MENU ;EP - ENTRY ACTION FROM BMXMENU OPTION
    14417 "RTN","BMXMON",418,0)
    14418  ;
    14419 "RTN","BMXMON",419,0)
     14433"RTN","BMXMON",425,0)
     14434 ;
     14435"RTN","BMXMON",426,0)
    1442014436 N BMX,BMXVER
    14421 "RTN","BMXMON",420,0)
     14437"RTN","BMXMON",427,0)
    1442214438 ;VERSION
    14423 "RTN","BMXMON",421,0)
     14439"RTN","BMXMON",428,0)
    1442414440 D
    14425 "RTN","BMXMON",422,0)
     14441"RTN","BMXMON",429,0)
    1442614442 . S BMXN="BMXNET ADO.NET DATA PROVIDER" I $D(^DIC(9.4,"B",BMXN)) Q
    14427 "RTN","BMXMON",423,0)
     14443"RTN","BMXMON",430,0)
    1442814444 . S BMXN="BMXNET RPMS .NET UTILITIES" I $D(^DIC(9.4,"B",BMXN)) Q
    14429 "RTN","BMXMON",424,0)
     14445"RTN","BMXMON",431,0)
    1443014446 . S BMXN=""
    14431 "RTN","BMXMON",425,0)
     14447"RTN","BMXMON",432,0)
    1443214448 . Q
    14433 "RTN","BMXMON",426,0)
    14434  ;
    14435 "RTN","BMXMON",427,0)
     14449"RTN","BMXMON",433,0)
     14450 ;
     14451"RTN","BMXMON",434,0)
    1443614452 S BMXVER=""
    14437 "RTN","BMXMON",428,0)
     14453"RTN","BMXMON",435,0)
    1443814454 I BMXN]"",$D(^DIC(9.4,"B",BMXN)) D
    14439 "RTN","BMXMON",429,0)
     14455"RTN","BMXMON",436,0)
    1444014456 . S BMX=$O(^DIC(9.4,"B",BMXN,0))
    14441 "RTN","BMXMON",430,0)
     14457"RTN","BMXMON",437,0)
    1444214458 . I $D(^DIC(9.4,BMX,"VERSION")) S BMXVER=$P(^DIC(9.4,BMX,"VERSION"),"^")
    14443 "RTN","BMXMON",431,0)
     14459"RTN","BMXMON",438,0)
    1444414460 . E  S BMXVER="VERSION NOT FOUND"
    14445 "RTN","BMXMON",432,0)
     14461"RTN","BMXMON",439,0)
    1444614462 S:BMXVER="" BMXVER="VERSION NOT FOUND"
    14447 "RTN","BMXMON",433,0)
    14448  ;
    14449 "RTN","BMXMON",434,0)
     14463"RTN","BMXMON",440,0)
     14464 ;
     14465"RTN","BMXMON",441,0)
    1445014466 ;LOCATION
    14451 "RTN","BMXMON",435,0)
     14467"RTN","BMXMON",442,0)
    1445214468 N BMXLOC
    14453 "RTN","BMXMON",436,0)
     14469"RTN","BMXMON",443,0)
    1445414470 S BMXLOC=""
    14455 "RTN","BMXMON",437,0)
     14471"RTN","BMXMON",444,0)
    1445614472 I $G(DUZ(2)),$D(^DIC(4,DUZ(2),0)) S BMXLOC=$P(^DIC(4,DUZ(2),0),"^")
    14457 "RTN","BMXMON",438,0)
     14473"RTN","BMXMON",445,0)
    1445814474 S:BMXLOC="" BMXLOC="LOCATION NOT FOUND"
    14459 "RTN","BMXMON",439,0)
    14460  ;
    14461 "RTN","BMXMON",440,0)
     14475"RTN","BMXMON",446,0)
     14476 ;
     14477"RTN","BMXMON",447,0)
    1446214478 ;WRITE
    14463 "RTN","BMXMON",441,0)
     14479"RTN","BMXMON",448,0)
    1446414480 W !
    14465 "RTN","BMXMON",442,0)
     14481"RTN","BMXMON",449,0)
    1446614482 W !,"BMXNet Version: ",BMXVER
    14467 "RTN","BMXMON",443,0)
     14483"RTN","BMXMON",450,0)
    1446814484 W !,"Location: ",BMXLOC
    14469 "RTN","BMXMON",444,0)
     14485"RTN","BMXMON",451,0)
    1447014486 Q
    1447114487"RTN","BMXMSEC")
     
    1447414490BMXMSEC ; IHS/OIT/HMW - BMXNet MONITOR ; 4/6/11 4:41pm
    1447514491"RTN","BMXMSEC",2,0)
    14476  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     14492 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1447714493"RTN","BMXMSEC",3,0)
    1447814494 ;;
     
    1467014686BMXNTEG ;INTEGRITY CHECKER;JUN 28, 2010
    1467114687"RTN","BMXNTEG",2,0)
    14672  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     14688 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1467314689"RTN","BMXNTEG",3,0)
    1467414690 ;
     
    1483214848BMXPO ; IHS/CMI/MAW - Populate appcontext with all namespaced RPC's ;
    1483314849"RTN","BMXPO",2,0)
    14834  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     14850 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1483514851"RTN","BMXPO",3,0)
    1483614852 ;
     
    1497614992BMXPRS ; IHS/OIT/HMW - BMX WINDOWS UTILS ;
    1497714993"RTN","BMXPRS",2,0)
    14978  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     14994 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1497914995"RTN","BMXPRS",3,0)
    1498014996 ;
     
    1518615202BMXRPC ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ; 4/7/11 2:06pm
    1518715203"RTN","BMXRPC",2,0)
    15188  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     15204 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1518915205"RTN","BMXRPC",3,0)
    1519015206 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    1554415560BMXRPC1 ; IHS/OIT/HMW - UTIL: REMOTE PROCEDURE CALLS ;
    1554515561"RTN","BMXRPC1",2,0)
    15546  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     15562 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1554715563"RTN","BMXRPC1",3,0)
    1554815564 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    1601816034 Q
    1601916035"RTN","BMXRPC10")
    16020 0^62^B93587525
     160360^62^B102094048
    1602116037"RTN","BMXRPC10",1,0)
    16022 BMXRPC10 ; IHS/OIT/GIS - RPC CALL FOR EXTENDED BROKER FUNCTIONALITY ; 08 Jun 2010  8:47 AM
     16038BMXRPC10 ; IHS/OIT/GIS - RPC CALL FOR EXTENDED BROKER FUNCTIONALITY ; 5/11/11 4:35pm
    1602316039"RTN","BMXRPC10",2,0)
    16024  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     16040 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1602516041"RTN","BMXRPC10",3,0)
    1602616042 ;; LOGIN RPCS TO RETURN PATIENTS, VISITS AND FACILITIES.  SUPPORTS MULTI-INDEX PATIENT LOOKUP (DOB, NAME, CHART#, ETC)
    1602716043"RTN","BMXRPC10",4,0)
    16028  ;
     16044    ;
    1602916045"RTN","BMXRPC10",5,0)
     16046    ; Changes in v 4.1000 to support GT.M
     16047"RTN","BMXRPC10",6,0)
     16048    ; - In BMXCCXT, there are several lines that rely on the
     16049"RTN","BMXRPC10",7,0)
     16050    ;   settings in BMX MONITOR file. We don't use that on GT.M
     16051"RTN","BMXRPC10",8,0)
     16052    ;   as xinetd handles all connection issues.
     16053"RTN","BMXRPC10",9,0)
     16054    ;   Also, at this point, we don't have integrated windows authentication
     16055"RTN","BMXRPC10",10,0)
     16056    ;   See below for the specific details.
     16057"RTN","BMXRPC10",11,0)
     16058 ;
     16059"RTN","BMXRPC10",12,0)
    1603016060GETFCRS(BMXFACS,BMXDUZ) ; EP - Gets all facilities for a user - returns RECORDSET
    16031 "RTN","BMXRPC10",6,0)
    16032  ;
    16033 "RTN","BMXRPC10",7,0)
     16061"RTN","BMXRPC10",13,0)
     16062 ;
     16063"RTN","BMXRPC10",14,0)
    1603416064 ;S BMXFACS="T00030FACILITY_NAME^T00030FACILITY_IEN^T00002MOST_RECENT_LOOKUP"_$C(30)
    16035 "RTN","BMXRPC10",8,0)
     16065"RTN","BMXRPC10",15,0)
    1603616066 N BMXI
    16037 "RTN","BMXRPC10",9,0)
     16067"RTN","BMXRPC10",16,0)
    1603816068 S BMXI=0,BMXFACS=$NA(^TMP("BMX FIND",$J)) K @BMXFACS
    16039 "RTN","BMXRPC10",10,0)
     16069"RTN","BMXRPC10",17,0)
    1604016070 S ^TMP("BMX FIND",$J,0)="T00030FACILITY_NAME^T00030FACILITY_IEN^T00002MOST_RECENT_LOOKUP"_$C(30)
    16041 "RTN","BMXRPC10",11,0)
     16071"RTN","BMXRPC10",18,0)
    1604216072 I $G(BMXDUZ)="" G XFRCS
    16043 "RTN","BMXRPC10",12,0)
     16073"RTN","BMXRPC10",19,0)
    1604416074 N BMXFN,BMXN,BMXSUB,BMXRCNT,CREF,OREF,SITE,LAST,DFLT
    16045 "RTN","BMXRPC10",13,0)
     16075"RTN","BMXRPC10",20,0)
    1604616076 S BMXDUZ=$TR(BMXDUZ,$C(13),"")
    16047 "RTN","BMXRPC10",14,0)
     16077"RTN","BMXRPC10",21,0)
    1604816078 S BMXDUZ=$TR(BMXDUZ,$C(10),"")
    16049 "RTN","BMXRPC10",15,0)
     16079"RTN","BMXRPC10",22,0)
    1605016080 S BMXDUZ=$TR(BMXDUZ,$C(9),"")
    16051 "RTN","BMXRPC10",16,0)
     16081"RTN","BMXRPC10",23,0)
    1605216082 S BMXFN=0
    16053 "RTN","BMXRPC10",17,0)
     16083"RTN","BMXRPC10",24,0)
    1605416084 S CREF=$NA(^VA(200,BMXDUZ,2))
    16055 "RTN","BMXRPC10",18,0)
     16085"RTN","BMXRPC10",25,0)
    1605616086 I '$O(@CREF@(0)) D  G XFRCS ; GIS/OIT JAN 22, 2010 ; Ensure at least one site returned
    16057 "RTN","BMXRPC10",19,0)
     16087"RTN","BMXRPC10",26,0)
    1605816088 . S BMXFN=$P(^AUTTSITE(1,0),U,1)
    16059 "RTN","BMXRPC10",20,0)
     16089"RTN","BMXRPC10",27,0)
    1606016090 . S SITE=$P($G(^DIC(4,BMXFN,0)),U,1)
    16061 "RTN","BMXRPC10",21,0)
     16091"RTN","BMXRPC10",28,0)
    1606216092 . S DFLT=0
    16063 "RTN","BMXRPC10",22,0)
     16093"RTN","BMXRPC10",29,0)
    1606416094 . S BMXI=BMXI+1
    16065 "RTN","BMXRPC10",23,0)
     16095"RTN","BMXRPC10",30,0)
    1606616096 . S ^TMP("BMX FIND",$J,BMXI)=SITE_U_BMXFN_U_DFLT_$C(30)
    16067 "RTN","BMXRPC10",24,0)
     16097"RTN","BMXRPC10",31,0)
    1606816098 . Q
    16069 "RTN","BMXRPC10",25,0)
     16099"RTN","BMXRPC10",32,0)
    1607016100 S OREF="^VA(200,"_BMXDUZ_",2,"
    16071 "RTN","BMXRPC10",26,0)
     16101"RTN","BMXRPC10",33,0)
    1607216102 S LAST=$G(^DISV(BMXDUZ,OREF))
    16073 "RTN","BMXRPC10",27,0)
     16103"RTN","BMXRPC10",34,0)
    1607416104 I LAST="" D
    16075 "RTN","BMXRPC10",28,0)
     16105"RTN","BMXRPC10",35,0)
    1607616106 . S BMXFN=0
    16077 "RTN","BMXRPC10",29,0)
     16107"RTN","BMXRPC10",36,0)
    1607816108 . F  Q:LAST  S BMXFN=$O(VA(200,BMXDUZ,2,BMXFN)) Q:'BMXFN  D  I LAST Q
    16079 "RTN","BMXRPC10",30,0)
     16109"RTN","BMXRPC10",37,0)
    1608016110 .. I $P($G(^VA(200,BMXDUZ,2,BMXFN,0)),U,2) S LAST=BMXFN
    16081 "RTN","BMXRPC10",31,0)
     16111"RTN","BMXRPC10",38,0)
    1608216112 .. Q
    16083 "RTN","BMXRPC10",32,0)
     16113"RTN","BMXRPC10",39,0)
    1608416114 . Q
    16085 "RTN","BMXRPC10",33,0)
     16115"RTN","BMXRPC10",40,0)
    1608616116 I LAST="" S LAST=$O(^VA(200,BMXDUZ,2,0)) ; IF LAST UNDEFINED, DEFAULT TO 1 ENTRY FOR THAT USER IN THE DIVISION SUBFILE
    16087 "RTN","BMXRPC10",34,0)
     16117"RTN","BMXRPC10",41,0)
    1608816118 I LAST="" S LAST=$P($G(^XTV(8989.3,1,"XUS")),U,17) ; IF LAST UNDEFINED, GET VALUE FROM KERNEL SYSTEM PARAMETERS FILE
    16089 "RTN","BMXRPC10",35,0)
     16119"RTN","BMXRPC10",42,0)
    1609016120 S BMXFN=0,STG=""
    16091 "RTN","BMXRPC10",36,0)
     16121"RTN","BMXRPC10",43,0)
    1609216122 F  S BMXFN=$O(@CREF@(BMXFN)) Q:'BMXFN  D
    16093 "RTN","BMXRPC10",37,0)
     16123"RTN","BMXRPC10",44,0)
    1609416124 . S SITE=$P($G(^DIC(4,BMXFN,0)),U,1) I SITE="" Q
    16095 "RTN","BMXRPC10",38,0)
     16125"RTN","BMXRPC10",45,0)
    1609616126 . S DFLT=(LAST=BMXFN)
    16097 "RTN","BMXRPC10",39,0)
     16127"RTN","BMXRPC10",46,0)
    1609816128 . S BMXI=BMXI+1
    16099 "RTN","BMXRPC10",40,0)
     16129"RTN","BMXRPC10",47,0)
    1610016130 . S ^TMP("BMX FIND",$J,BMXI)=SITE_U_BMXFN_U_DFLT_$C(30)
    16101 "RTN","BMXRPC10",41,0)
     16131"RTN","BMXRPC10",48,0)
    1610216132 . Q
    16103 "RTN","BMXRPC10",42,0)
     16133"RTN","BMXRPC10",49,0)
    1610416134XFRCS S BMXI=BMXI+1
    16105 "RTN","BMXRPC10",43,0)
     16135"RTN","BMXRPC10",50,0)
    1610616136 S ^TMP("BMX FIND",$J,BMXI)=$C(31)
    16107 "RTN","BMXRPC10",44,0)
    16108  Q
    16109 "RTN","BMXRPC10",45,0)
    16110  ;
    16111 "RTN","BMXRPC10",46,0)
     16137"RTN","BMXRPC10",51,0)
     16138 Q
     16139"RTN","BMXRPC10",52,0)
     16140 ;
     16141"RTN","BMXRPC10",53,0)
    1611216142GETVIS(OUT,STG) ; EP - RETURN SPECIFIED # OF VALID VISITS FOR THE PATIENT
    16113 "RTN","BMXRPC10",47,0)
     16143"RTN","BMXRPC10",54,0)
    1611416144 S OUT="T00010VISIT_IEN^T00030PATIENT_IEN^T00021TIMESTAMP^T00030VISIT_TYPE^T00030LOCATION^T00010SERVICE CATEGORY^T00030CLINIC^T00030PRIMARY_PROVIDER^T00030PRIMARY_POV"_$C(30)
    16115 "RTN","BMXRPC10",48,0)
     16145"RTN","BMXRPC10",55,0)
    1611616146 I $L($G(STG))
    16117 "RTN","BMXRPC10",49,0)
     16147"RTN","BMXRPC10",56,0)
    1611816148 E  G VOUT
    16119 "RTN","BMXRPC10",50,0)
     16149"RTN","BMXRPC10",57,0)
    1612016150 N X,Y,Z,%,HDR,LINE,DFN,MAX,IDT,VIEN,CNT,STOP,TS,VIEN,TYPE,LOC,SCAT,CLIN,PPRV,PPOV,BDT,VDT,DATA
    16121 "RTN","BMXRPC10",51,0)
     16151"RTN","BMXRPC10",58,0)
    1612216152 S DFN=+STG I '$D(^DPT(DFN,0)) G VOUT
    16123 "RTN","BMXRPC10",52,0)
     16153"RTN","BMXRPC10",59,0)
    1612416154 S MAX=$P(STG,"|",2) I 'MAX S MAX=9
    16125 "RTN","BMXRPC10",53,0)
     16155"RTN","BMXRPC10",60,0)
    1612616156 I '$O(^AUPNVSIT("AA",+$G(DFN),0)) G VOUT
    16127 "RTN","BMXRPC10",54,0)
     16157"RTN","BMXRPC10",61,0)
    1612816158 S IDT=0,CNT=0,STOP=0,DATA=""
    16129 "RTN","BMXRPC10",55,0)
     16159"RTN","BMXRPC10",62,0)
    1613016160 S BDT=$$FMADD^XLFDT(DT,-2)
    16131 "RTN","BMXRPC10",56,0)
     16161"RTN","BMXRPC10",63,0)
    1613216162 F  Q:STOP  S IDT=$O(^AUPNVSIT("AA",DFN,IDT)) Q:'IDT  S VIEN=999999999999 F  Q:STOP  S VIEN=$O(^AUPNVSIT("AA",DFN,IDT,VIEN),-1) Q:'VIEN  D  Q
    16133 "RTN","BMXRPC10",57,0)
     16163"RTN","BMXRPC10",64,0)
    1613416164 . S X=$G(^AUPNVSIT(VIEN,0)) I '$L(X) Q  ; VISIT DATA MUST EXIST
    16135 "RTN","BMXRPC10",58,0)
     16165"RTN","BMXRPC10",65,0)
    1613616166 . S VDT=+X I 'VDT Q
    16137 "RTN","BMXRPC10",59,0)
     16167"RTN","BMXRPC10",66,0)
    1613816168 . I $P(X,U,11) Q  ; MUST BE AN 'ACTIVE' VISIT - NOT 'DELETED'
    16139 "RTN","BMXRPC10",60,0)
     16169"RTN","BMXRPC10",67,0)
    1614016170 . I $P(X,U,5)'=DFN Q  ; INVALID PATIENT IEN
    16141 "RTN","BMXRPC10",61,0)
     16171"RTN","BMXRPC10",68,0)
    1614216172 . I $P(X,U,3)="" Q  ; VISIT MUST HAVE A TYPE
    16143 "RTN","BMXRPC10",62,0)
     16173"RTN","BMXRPC10",69,0)
    1614416174 . I '$P(X,U,6) Q  ; MUST HAVE A VALID ENCOUNTER LOCATION
    16145 "RTN","BMXRPC10",63,0)
     16175"RTN","BMXRPC10",70,0)
    1614616176 . I $P(X,U,7)="" Q  ; VISIT MUST HAVE A CATEGORY
    16147 "RTN","BMXRPC10",64,0)
     16177"RTN","BMXRPC10",71,0)
    1614816178 . I $P(X,U,8)="" Q  ; VISIT MUST HAVE A VALID CLINIC STOP
    16149 "RTN","BMXRPC10",65,0)
     16179"RTN","BMXRPC10",72,0)
    1615016180 . I VDT<BDT,'$D(^AUPNVPOV("AD",VIEN)) Q  ; MUST HAVE A POV ; PATCHED BY GIS 4/27/2009
    16151 "RTN","BMXRPC10",66,0)
     16181"RTN","BMXRPC10",73,0)
    1615216182 . I VDT<BDT,'$D(^AUPNVPRV("AD",VIEN)) Q  ; MUST HAVE A PROVIDER
    16153 "RTN","BMXRPC10",67,0)
     16183"RTN","BMXRPC10",74,0)
    1615416184 . D VIS(VIEN,DFN,.DATA)
    16155 "RTN","BMXRPC10",68,0)
     16185"RTN","BMXRPC10",75,0)
    1615616186 . S CNT=CNT+1
    16157 "RTN","BMXRPC10",69,0)
     16187"RTN","BMXRPC10",76,0)
    1615816188 . I CNT=MAX S STOP=1
    16159 "RTN","BMXRPC10",70,0)
     16189"RTN","BMXRPC10",77,0)
    1616016190 . Q
    16161 "RTN","BMXRPC10",71,0)
     16191"RTN","BMXRPC10",78,0)
    1616216192VOUT S OUT=OUT_$G(DATA)_$C(31)
    16163 "RTN","BMXRPC10",72,0)
    16164  Q
    16165 "RTN","BMXRPC10",73,0)
    16166  ;
    16167 "RTN","BMXRPC10",74,0)
     16193"RTN","BMXRPC10",79,0)
     16194 Q
     16195"RTN","BMXRPC10",80,0)
     16196 ;
     16197"RTN","BMXRPC10",81,0)
    1616816198VIS(VIEN,DFN,DATA) ; EP - APPEND VISIT DATA STRING
    16169 "RTN","BMXRPC10",75,0)
     16199"RTN","BMXRPC10",82,0)
    1617016200 I $G(VIEN),$G(DFN)
    16171 "RTN","BMXRPC10",76,0)
     16201"RTN","BMXRPC10",83,0)
    1617216202 E  Q
    16173 "RTN","BMXRPC10",77,0)
     16203"RTN","BMXRPC10",84,0)
    1617416204 N TYPE,LOC,SCAT,CLIN,PPRV,PPOV,VDT,FIEN,IENS,FLD,TYPE
    16175 "RTN","BMXRPC10",78,0)
     16205"RTN","BMXRPC10",85,0)
    1617616206 S FIEN=9000010,IENS=VIEN_","
    16177 "RTN","BMXRPC10",79,0)
     16207"RTN","BMXRPC10",86,0)
    1617816208 S TS=$$GET1^DIQ(FIEN,IENS,.01) I TS="" Q
    16179 "RTN","BMXRPC10",80,0)
     16209"RTN","BMXRPC10",87,0)
    1618016210 S TYPE=$$GET1^DIQ(FIEN,IENS,.03)
    16181 "RTN","BMXRPC10",81,0)
     16211"RTN","BMXRPC10",88,0)
    1618216212 S LOC=$$GET1^DIQ(FIEN,IENS,.06)
    16183 "RTN","BMXRPC10",82,0)
     16213"RTN","BMXRPC10",89,0)
    1618416214 S SCAT=$$GET1^DIQ(FIEN,IENS,.07)
    16185 "RTN","BMXRPC10",83,0)
     16215"RTN","BMXRPC10",90,0)
    1618616216 S CLIN=$$GET1^DIQ(FIEN,IENS,.08)
    16187 "RTN","BMXRPC10",84,0)
     16217"RTN","BMXRPC10",91,0)
    1618816218 S PPRV=$$PPRV(VIEN)
    16189 "RTN","BMXRPC10",85,0)
     16219"RTN","BMXRPC10",92,0)
    1619016220 S PPOV=$$PPOV(VIEN)
    16191 "RTN","BMXRPC10",86,0)
     16221"RTN","BMXRPC10",93,0)
    1619216222 S DATA=DATA_VIEN_U_DFN_U_TS_U_LOC_U_SCAT_U_CLIN_U_PPRV_U_PPOV_$C(30)
    16193 "RTN","BMXRPC10",87,0)
    16194  Q
    16195 "RTN","BMXRPC10",88,0)
     16223"RTN","BMXRPC10",94,0)
     16224 Q
     16225"RTN","BMXRPC10",95,0)
    1619616226 ;
    16197 "RTN","BMXRPC10",89,0)
     16227"RTN","BMXRPC10",96,0)
    1619816228PPRV(VIEN) ; EP - GIVEN A VISIT IEN, RETURN THE PRIMARY PROVIDER NAME
    16199 "RTN","BMXRPC10",90,0)
     16229"RTN","BMXRPC10",97,0)
    1620016230 ; CALLED BY THE BMX SCHEMA
    16201 "RTN","BMXRPC10",91,0)
     16231"RTN","BMXRPC10",98,0)
    1620216232 I '$D(^AUPNVPRV("AD",+$G(VIEN))) Q ""
    16203 "RTN","BMXRPC10",92,0)
     16233"RTN","BMXRPC10",99,0)
    1620416234 N NAME,PIEN,VPIEN,X,Y,Z,%
    16205 "RTN","BMXRPC10",93,0)
     16235"RTN","BMXRPC10",100,0)
    1620616236 S VPIEN=0,PIEN=""
    16207 "RTN","BMXRPC10",94,0)
     16237"RTN","BMXRPC10",101,0)
    1620816238 F  S VPIEN=$O(^AUPNVPRV("AD",VIEN,VPIEN)) Q:'VPIEN  D  I PIEN Q
    16209 "RTN","BMXRPC10",95,0)
     16239"RTN","BMXRPC10",102,0)
    1621016240 . S X=$G(^AUPNVPRV(VPIEN,0)) I X="" Q
    16211 "RTN","BMXRPC10",96,0)
     16241"RTN","BMXRPC10",103,0)
    1621216242 . S TYPE=$P(X,U,4)
    16213 "RTN","BMXRPC10",97,0)
     16243"RTN","BMXRPC10",104,0)
    1621416244 . I TYPE="P" S PIEN=+X
    16215 "RTN","BMXRPC10",98,0)
     16245"RTN","BMXRPC10",105,0)
    1621616246 . Q
    16217 "RTN","BMXRPC10",99,0)
     16247"RTN","BMXRPC10",106,0)
    1621816248 I 'PIEN S VPIEN=$O(^AUPNVPRV("AD",VIEN,0)) I VPIEN S PIEN=+$G(^AUPNVPRV(VPIEN,0))
    16219 "RTN","BMXRPC10",100,0)
     16249"RTN","BMXRPC10",107,0)
    1622016250 I 'PIEN Q ""
    16221 "RTN","BMXRPC10",101,0)
     16251"RTN","BMXRPC10",108,0)
    1622216252 S PIEN=$$PRV^VENPCCU(PIEN)
    16223 "RTN","BMXRPC10",102,0)
     16253"RTN","BMXRPC10",109,0)
    1622416254 S NAME=$P($G(^VA(200,PIEN,0)),U)
    16225 "RTN","BMXRPC10",103,0)
     16255"RTN","BMXRPC10",110,0)
    1622616256 Q NAME
    16227 "RTN","BMXRPC10",104,0)
    16228  ;
    16229 "RTN","BMXRPC10",105,0)
     16257"RTN","BMXRPC10",111,0)
     16258 ;
     16259"RTN","BMXRPC10",112,0)
    1623016260PPOV(VIEN) ; EP - GIVEN A VISIT IEN, RETURN THE PRIMARY PURPOSE OF VISIT ICD CODE (NARRATIVE)
    16231 "RTN","BMXRPC10",106,0)
     16261"RTN","BMXRPC10",113,0)
    1623216262 ; CALLED BY BMX SCHEMA
    16233 "RTN","BMXRPC10",107,0)
     16263"RTN","BMXRPC10",114,0)
    1623416264 I '$D(^AUPNVPOV("AD",+$G(VIEN))) Q ""
    16235 "RTN","BMXRPC10",108,0)
     16265"RTN","BMXRPC10",115,0)
    1623616266 N TXT,IIEN,VPIEN,X,Y,Z,%,ICD,NIEN,DX
    16237 "RTN","BMXRPC10",109,0)
     16267"RTN","BMXRPC10",116,0)
    1623816268 S VPIEN=0,IIEN=""
    16239 "RTN","BMXRPC10",110,0)
     16269"RTN","BMXRPC10",117,0)
    1624016270 F  S VPIEN=$O(^AUPNVPOV("AD",VIEN,VPIEN)) Q:'VPIEN  D  I IIEN Q
    16241 "RTN","BMXRPC10",111,0)
     16271"RTN","BMXRPC10",118,0)
    1624216272 . S X=$G(^AUPNVPOV(VPIEN,0)) I X="" Q
    16243 "RTN","BMXRPC10",112,0)
     16273"RTN","BMXRPC10",119,0)
    1624416274 . S TYPE=$P(X,U,12)
    16245 "RTN","BMXRPC10",113,0)
     16275"RTN","BMXRPC10",120,0)
    1624616276 . I TYPE="P" S IIEN=+X
    16247 "RTN","BMXRPC10",114,0)
     16277"RTN","BMXRPC10",121,0)
    1624816278 . Q
    16249 "RTN","BMXRPC10",115,0)
     16279"RTN","BMXRPC10",122,0)
    1625016280 I 'IIEN S VPIEN=$O(^AUPNVPOV("AD",VIEN,0)) I VPIEN S IIEN=+$G(^AUPNVPOV(VPIEN,0))
    16251 "RTN","BMXRPC10",116,0)
     16281"RTN","BMXRPC10",123,0)
    1625216282 I IIEN,VPIEN
    16253 "RTN","BMXRPC10",117,0)
     16283"RTN","BMXRPC10",124,0)
    1625416284 E  Q ""
    16255 "RTN","BMXRPC10",118,0)
     16285"RTN","BMXRPC10",125,0)
    1625616286 I $L($T(ICDDX^ICDCODE)) S ICD=$P($$ICDDX^ICDCODE(IIEN),U,2) I 1
    16257 "RTN","BMXRPC10",119,0)
     16287"RTN","BMXRPC10",126,0)
    1625816288 E  S ICD=$P($G(^ICD9(IIEN,0)),U)
    16259 "RTN","BMXRPC10",120,0)
     16289"RTN","BMXRPC10",127,0)
    1626016290 I '$L(ICD) Q ""
    16261 "RTN","BMXRPC10",121,0)
     16291"RTN","BMXRPC10",128,0)
    1626216292 S NIEN=$P($G(^AUPNVPOV(VPIEN,0)),U,4) I 'NIEN Q ""
    16263 "RTN","BMXRPC10",122,0)
     16293"RTN","BMXRPC10",129,0)
    1626416294 S TXT=$P($G(^AUTNPOV(NIEN,0)),U) I TXT="" Q ""
    16265 "RTN","BMXRPC10",123,0)
     16295"RTN","BMXRPC10",130,0)
    1626616296 I $L(TXT)>20 S TXT=$E(TXT,1,17)_"..."
    16267 "RTN","BMXRPC10",124,0)
     16297"RTN","BMXRPC10",131,0)
    1626816298 S DX=ICD_" ("_TXT_")"
    16269 "RTN","BMXRPC10",125,0)
     16299"RTN","BMXRPC10",132,0)
    1627016300 Q DX
    16271 "RTN","BMXRPC10",126,0)
     16301"RTN","BMXRPC10",133,0)
    1627216302 ;
    16273 "RTN","BMXRPC10",127,0)
     16303"RTN","BMXRPC10",134,0)
    1627416304GETPAT(BMXRET,BMXSTR) ; EP - -- return patient in ADO table
    16275 "RTN","BMXRPC10",128,0)
     16305"RTN","BMXRPC10",135,0)
    1627616306 ; S X="MERR^BMXGU",@^%ZOSF("TRAP") ; m error trap
    16277 "RTN","BMXRPC10",129,0)
     16307"RTN","BMXRPC10",136,0)
    1627816308 N BMXI,BMXERR,BMXUIEN,P,X,Y,Z,%,%DT
    16279 "RTN","BMXRPC10",130,0)
     16309"RTN","BMXRPC10",137,0)
    1628016310 S P="|"
    16281 "RTN","BMXRPC10",131,0)
     16311"RTN","BMXRPC10",138,0)
    1628216312 K ^BMXTMP($J)
    16283 "RTN","BMXRPC10",132,0)
     16313"RTN","BMXRPC10",139,0)
    1628416314 S BMXI=0
    16285 "RTN","BMXRPC10",133,0)
     16315"RTN","BMXRPC10",140,0)
    1628616316 S BMXERR=""
    16287 "RTN","BMXRPC10",134,0)
     16317"RTN","BMXRPC10",141,0)
    1628816318 S BMXRET="T00010IEN^T00030PATIENTNAME^T00015DOB^T00001SEX^T00007CHART^T00009SSN^T00010REG^T00030LASTUPDATE^T00030CLASSBEN^T00010AGE"_$C(30)
    16289 "RTN","BMXRPC10",135,0)
     16319"RTN","BMXRPC10",142,0)
    1629016320 S BMXPAT=$P(BMXSTR,P,1)
    16291 "RTN","BMXRPC10",136,0)
     16321"RTN","BMXRPC10",143,0)
    1629216322 S BMXMT=$P(BMXSTR,P,2)
    16293 "RTN","BMXRPC10",137,0)
     16323"RTN","BMXRPC10",144,0)
    1629416324 ; S BMXNPAT=$P(BMXSTR,P,4)
    16295 "RTN","BMXRPC10",138,0)
     16325"RTN","BMXRPC10",145,0)
    1629616326 I BMXMT="ALL"!(BMXMT="") S BMXMT=9999999
    16297 "RTN","BMXRPC10",139,0)
     16327"RTN","BMXRPC10",146,0)
    1629816328 S BMXMT=(BMXMT-1)
    16299 "RTN","BMXRPC10",140,0)
     16329"RTN","BMXRPC10",147,0)
    1630016330 S BMXPIEN=""
    16301 "RTN","BMXRPC10",141,0)
     16331"RTN","BMXRPC10",148,0)
    1630216332 S X=BMXPAT D ^%DT
    16303 "RTN","BMXRPC10",142,0)
     16333"RTN","BMXRPC10",149,0)
    1630416334 S Y=Y\1
    16305 "RTN","BMXRPC10",143,0)
     16335"RTN","BMXRPC10",150,0)
    1630616336 I $E(Y,4,5)="00" G GETADO
    16307 "RTN","BMXRPC10",144,0)
     16337"RTN","BMXRPC10",151,0)
    1630816338 I $E(Y,6,7)="00" G GETADO
    16309 "RTN","BMXRPC10",145,0)
     16339"RTN","BMXRPC10",152,0)
    1631016340 I Y?7N D  G GETADO
    16311 "RTN","BMXRPC10",146,0)
     16341"RTN","BMXRPC10",153,0)
    1631216342 . S BMXPAT=Y
    16313 "RTN","BMXRPC10",147,0)
     16343"RTN","BMXRPC10",154,0)
    1631416344 . S BMXPATE=$$PATDOB(.BMXPIEN,BMXPAT)
    16315 "RTN","BMXRPC10",148,0)
     16345"RTN","BMXRPC10",155,0)
    1631616346 S X=$TR($P(BMXPAT," "),",","")
    16317 "RTN","BMXRPC10",149,0)
     16347"RTN","BMXRPC10",156,0)
    1631816348 I X?1.30U S BMXPATE=$$PATNAM(.BMXPIEN,BMXPAT,"") G GETADO
    16319 "RTN","BMXRPC10",150,0)
     16349"RTN","BMXRPC10",157,0)
    1632016350 I BMXPAT?9N D  G GETADO
    16321 "RTN","BMXRPC10",151,0)
     16351"RTN","BMXRPC10",158,0)
    1632216352 . S BMXPIEN=$$PATSSN(BMXPAT)
    16323 "RTN","BMXRPC10",152,0)
     16353"RTN","BMXRPC10",159,0)
    1632416354 I BMXPAT?1.6N D  G GETADO
    16325 "RTN","BMXRPC10",153,0)
     16355"RTN","BMXRPC10",160,0)
    1632616356 . S BMXPIEN=$$PATCHT(.BMXPIEN,BMXPAT)
    16327 "RTN","BMXRPC10",154,0)
     16357"RTN","BMXRPC10",161,0)
    1632816358GETADO I $G(BMXPIEN),'$G(BMXPATS) D PATADO(.BMXPIEN)
    16329 "RTN","BMXRPC10",155,0)
     16359"RTN","BMXRPC10",162,0)
    1633016360 S BMXRET=BMXRET_$C(31)_$G(BMXERR)
    16331 "RTN","BMXRPC10",156,0)
     16361"RTN","BMXRPC10",163,0)
    1633216362 K BMXPAT,BMXPIEN,BMXCNT,BMXDA,BMXIEN,BMXPATE,BMXNM,BMXDB,BMXSX,BMXCT,BMXSSN
    16333 "RTN","BMXRPC10",157,0)
     16363"RTN","BMXRPC10",164,0)
    1633416364 K BMXPATS
    16335 "RTN","BMXRPC10",158,0)
    16336  Q
    16337 "RTN","BMXRPC10",159,0)
    16338  ;
    16339 "RTN","BMXRPC10",160,0)
     16365"RTN","BMXRPC10",165,0)
     16366 Q
     16367"RTN","BMXRPC10",166,0)
     16368 ;
     16369"RTN","BMXRPC10",167,0)
    1634016370PATSSN(PAT) ;-- look up by ssn
    16341 "RTN","BMXRPC10",161,0)
     16371"RTN","BMXRPC10",168,0)
    1634216372 S BMXPIEN=$O(^DPT("SSN",PAT,0))
    16343 "RTN","BMXRPC10",162,0)
     16373"RTN","BMXRPC10",169,0)
    1634416374 S BMXPIEN(1)=BMXPIEN
    16345 "RTN","BMXRPC10",163,0)
     16375"RTN","BMXRPC10",170,0)
    1634616376 Q $G(BMXPIEN)
    16347 "RTN","BMXRPC10",164,0)
    16348  ;
    16349 "RTN","BMXRPC10",165,0)
     16377"RTN","BMXRPC10",171,0)
     16378 ;
     16379"RTN","BMXRPC10",172,0)
    1635016380PATCHT(BMXPIEN,HRN) ;-- lookup by chart
    16351 "RTN","BMXRPC10",166,0)
     16381"RTN","BMXRPC10",173,0)
    1635216382 N BMXCNT
    16353 "RTN","BMXRPC10",167,0)
     16383"RTN","BMXRPC10",174,0)
    1635416384 S BMXCNT=0,BMXPATE=0,BMXMCNT=0,BMXPIEN=""
    16355 "RTN","BMXRPC10",168,0)
     16385"RTN","BMXRPC10",175,0)
    1635616386 S BMXIEN=0 F  S BMXIEN=$O(^AUPNPAT("D",HRN,BMXIEN)) Q:'BMXIEN  D  I BMXPIEN Q
    16357 "RTN","BMXRPC10",169,0)
     16387"RTN","BMXRPC10",176,0)
    1635816388 . I '$D(^AUPNPAT("D",HRN,BMXIEN,DUZ(2))) Q
    16359 "RTN","BMXRPC10",170,0)
     16389"RTN","BMXRPC10",177,0)
    1636016390 . S %=$O(^AUPNPAT("D",HRN,BMXIEN)) I %,$D(^AUPNPAT("D",HRN,%,DUZ(2))) S BMXIEN=999999999 Q  ; MORE THAN ONE PAT WITH THIS CHART NUMBER!
    16361 "RTN","BMXRPC10",171,0)
     16391"RTN","BMXRPC10",178,0)
    1636216392 . S BMXPIEN=BMXIEN
    16363 "RTN","BMXRPC10",172,0)
     16393"RTN","BMXRPC10",179,0)
    1636416394 . S BMXCNT=BMXCNT+1
    16365 "RTN","BMXRPC10",173,0)
     16395"RTN","BMXRPC10",180,0)
    1636616396 . S:'$D(BMXPIEN(BMXCNT)) BMXPIEN(BMXCNT)=0
    16367 "RTN","BMXRPC10",174,0)
     16397"RTN","BMXRPC10",181,0)
    1636816398 . S BMXPIEN(BMXCNT)=BMXPIEN
    16369 "RTN","BMXRPC10",175,0)
     16399"RTN","BMXRPC10",182,0)
    1637016400 . Q
    16371 "RTN","BMXRPC10",176,0)
     16401"RTN","BMXRPC10",183,0)
    1637216402 Q BMXPIEN
    16373 "RTN","BMXRPC10",177,0)
    16374  ;
    16375 "RTN","BMXRPC10",178,0)
     16403"RTN","BMXRPC10",184,0)
     16404 ;
     16405"RTN","BMXRPC10",185,0)
    1637616406PATDOB(BMXPATE,PAT) ;-- lookup by DOB
    16377 "RTN","BMXRPC10",179,0)
     16407"RTN","BMXRPC10",186,0)
    1637816408 N BMXCNT
    16379 "RTN","BMXRPC10",180,0)
     16409"RTN","BMXRPC10",187,0)
    1638016410 S BMXCNT=0,BMXPATE=0
    16381 "RTN","BMXRPC10",181,0)
     16411"RTN","BMXRPC10",188,0)
    1638216412 S BMXIEN=0
    16383 "RTN","BMXRPC10",182,0)
     16413"RTN","BMXRPC10",189,0)
    1638416414 F  S BMXIEN=$O(^DPT("ADOB",PAT,BMXIEN)) Q:'BMXIEN  D
    16385 "RTN","BMXRPC10",183,0)
     16415"RTN","BMXRPC10",190,0)
    1638616416 . S:'$D(BMXPATE(BMXCNT)) BMXPATE(BMXCNT)=0
    16387 "RTN","BMXRPC10",184,0)
     16417"RTN","BMXRPC10",191,0)
    1638816418 . S BMXCNT=BMXCNT+1,BMXPATE=1
    16389 "RTN","BMXRPC10",185,0)
     16419"RTN","BMXRPC10",192,0)
    1639016420 . S BMXPATE(BMXCNT)=BMXIEN
    16391 "RTN","BMXRPC10",186,0)
     16421"RTN","BMXRPC10",193,0)
    1639216422 . Q
    16393 "RTN","BMXRPC10",187,0)
     16423"RTN","BMXRPC10",194,0)
    1639416424 S BMXPATE=BMXCNT
    16395 "RTN","BMXRPC10",188,0)
     16425"RTN","BMXRPC10",195,0)
    1639616426 Q $G(BMXPATE)
    16397 "RTN","BMXRPC10",189,0)
    16398  ;
    16399 "RTN","BMXRPC10",190,0)
     16427"RTN","BMXRPC10",196,0)
     16428 ;
     16429"RTN","BMXRPC10",197,0)
    1640016430PATNAM(BMXPATE,PAT,NPAT) ;lookup by name
    16401 "RTN","BMXRPC10",191,0)
     16431"RTN","BMXRPC10",198,0)
    1640216432 S BMXCNT=0,BMXPATE=0
    16403 "RTN","BMXRPC10",192,0)
     16433"RTN","BMXRPC10",199,0)
    1640416434 N BMXLEN
    16405 "RTN","BMXRPC10",193,0)
     16435"RTN","BMXRPC10",200,0)
    1640616436 S BMXLEN=$L(PAT)
    16407 "RTN","BMXRPC10",194,0)
     16437"RTN","BMXRPC10",201,0)
    1640816438 S BMXNAM=PAT
    16409 "RTN","BMXRPC10",195,0)
     16439"RTN","BMXRPC10",202,0)
    1641016440 S BMXNAM=$$BEGIN(PAT)
    16411 "RTN","BMXRPC10",196,0)
     16441"RTN","BMXRPC10",203,0)
    1641216442 I $G(NPAT)]"" S BMXNAM=NPAT
    16413 "RTN","BMXRPC10",197,0)
     16443"RTN","BMXRPC10",204,0)
    1641416444 F  S BMXNAM=$O(^DPT("B",BMXNAM)) Q:BMXNAM=""!($E(BMXNAM,1,BMXLEN)'=PAT)!(BMXCNT>BMXMT)  D
    16415 "RTN","BMXRPC10",198,0)
     16445"RTN","BMXRPC10",205,0)
    1641616446 . S BMXIEN=0 F  S BMXIEN=$O(^DPT("B",BMXNAM,BMXIEN)) Q:'BMXIEN  D
    16417 "RTN","BMXRPC10",199,0)
     16447"RTN","BMXRPC10",206,0)
    1641816448 .. Q:$O(^DPT("B",BMXNAM,BMXIEN,0))  ;cmi/maw 4/25/2005 don't get aliases
    16419 "RTN","BMXRPC10",200,0)
     16449"RTN","BMXRPC10",207,0)
    1642016450 .. S BMXCNT=BMXCNT+1
    16421 "RTN","BMXRPC10",201,0)
     16451"RTN","BMXRPC10",208,0)
    1642216452 .. S:'$D(BMXPATE(BMXCNT)) BMXPATE(BMXCNT)=0
    16423 "RTN","BMXRPC10",202,0)
     16453"RTN","BMXRPC10",209,0)
    1642416454 .. S BMXPATE(BMXCNT)=BMXIEN
    16425 "RTN","BMXRPC10",203,0)
     16455"RTN","BMXRPC10",210,0)
    1642616456 S BMXPATE=BMXCNT
    16427 "RTN","BMXRPC10",204,0)
     16457"RTN","BMXRPC10",211,0)
    1642816458 Q $G(BMXPATE)
    16429 "RTN","BMXRPC10",205,0)
    16430  ;
    16431 "RTN","BMXRPC10",206,0)
     16459"RTN","BMXRPC10",212,0)
     16460 ;
     16461"RTN","BMXRPC10",213,0)
    1643216462BEGIN(PT) ;-- get begin point
    16433 "RTN","BMXRPC10",207,0)
     16463"RTN","BMXRPC10",214,0)
    1643416464 N BMXPDA,BMXPIEN,BMXPCNT
    16435 "RTN","BMXRPC10",208,0)
     16465"RTN","BMXRPC10",215,0)
    1643616466 S BMXPCNT=0
    16437 "RTN","BMXRPC10",209,0)
     16467"RTN","BMXRPC10",216,0)
    1643816468 S BMXPDA=PT
    16439 "RTN","BMXRPC10",210,0)
     16469"RTN","BMXRPC10",217,0)
    1644016470 I $O(^DPT("B",BMXPDA,0)) D
    16441 "RTN","BMXRPC10",211,0)
     16471"RTN","BMXRPC10",218,0)
    1644216472 . S BMXPDA=$O(^DPT("B",BMXPDA),-1)
    16443 "RTN","BMXRPC10",212,0)
     16473"RTN","BMXRPC10",219,0)
    1644416474 F  S BMXPDA=$O(^DPT("B",BMXPDA)) Q
    16445 "RTN","BMXRPC10",213,0)
     16475"RTN","BMXRPC10",220,0)
    1644616476 I $G(BMXPDA)="" Q ""
    16447 "RTN","BMXRPC10",214,0)
     16477"RTN","BMXRPC10",221,0)
    1644816478 Q $O(^DPT("B",BMXPDA),-1)
    16449 "RTN","BMXRPC10",215,0)
    16450  ;
    16451 "RTN","BMXRPC10",216,0)
     16479"RTN","BMXRPC10",222,0)
     16480 ;
     16481"RTN","BMXRPC10",223,0)
    1645216482PATADO(PIEN) ;-- ado return
    16453 "RTN","BMXRPC10",217,0)
     16483"RTN","BMXRPC10",224,0)
    1645416484 I '$G(DUZ(2)) Q  ; DIVISION
    16455 "RTN","BMXRPC10",218,0)
     16485"RTN","BMXRPC10",225,0)
    1645616486 S BMXCNTR=0
    16457 "RTN","BMXRPC10",219,0)
     16487"RTN","BMXRPC10",226,0)
    1645816488 S BMXDA=0 F  S BMXDA=$O(PIEN(BMXDA)) Q:'BMXDA  D
    16459 "RTN","BMXRPC10",220,0)
     16489"RTN","BMXRPC10",227,0)
    1646016490 . S BMXCNTR=BMXCNTR+1
    16461 "RTN","BMXRPC10",221,0)
     16491"RTN","BMXRPC10",228,0)
    1646216492 . S BMXPI=$G(PIEN(BMXDA))
    16463 "RTN","BMXRPC10",222,0)
     16493"RTN","BMXRPC10",229,0)
    1646416494 . I '$D(^AUPNPAT(BMXPI,41,DUZ(2),0)) Q  ; PATIENT NOT REGISTERED IN THE CURRENT DIVISION
    16465 "RTN","BMXRPC10",223,0)
     16495"RTN","BMXRPC10",230,0)
    1646616496 . S BMXNM=$P($G(^DPT(BMXPI,0)),U)
    16467 "RTN","BMXRPC10",224,0)
     16497"RTN","BMXRPC10",231,0)
    1646816498 . S BMXDB=$$FMTE^XLFDT($P($G(^DPT(BMXPI,0)),U,3))
    16469 "RTN","BMXRPC10",225,0)
     16499"RTN","BMXRPC10",232,0)
    1647016500 . S BMXSX=$P($G(^DPT(BMXPI,0)),U,2)
    16471 "RTN","BMXRPC10",226,0)
     16501"RTN","BMXRPC10",233,0)
    1647216502 . S BMXCT=$$HRN^AUPNPAT(BMXPI,DUZ(2))
    16473 "RTN","BMXRPC10",227,0)
     16503"RTN","BMXRPC10",234,0)
    1647416504 . S BMXSSN=$P($G(^DPT(BMXPI,0)),U,9)
    16475 "RTN","BMXRPC10",228,0)
     16505"RTN","BMXRPC10",235,0)
    1647616506 . S BMXUPD=$P($G(^AUPNPAT(BMXPI,0)),U,3)
    16477 "RTN","BMXRPC10",229,0)
     16507"RTN","BMXRPC10",236,0)
    1647816508 . S BMXELG=$$GET1^DIQ(9000001,BMXPI,1111) ;cmi/maw 5/17/2007 added class/ben for status bar
    16479 "RTN","BMXRPC10",230,0)
     16509"RTN","BMXRPC10",237,0)
    1648016510 . S BMXAGE=$$AGE^AUPNPAT(BMXPI,DT)
    16481 "RTN","BMXRPC10",231,0)
     16511"RTN","BMXRPC10",238,0)
    1648216512 . S BMXI=BMXI+1
    16483 "RTN","BMXRPC10",232,0)
     16513"RTN","BMXRPC10",239,0)
    1648416514 . S BMXRET=BMXRET_BMXPI_U_BMXNM_U_BMXDB_U_BMXSX_U_BMXCT_U_BMXSSN_U_$G(BMXHD)_U_BMXUPD_U_BMXELG_U_BMXAGE_$C(30)
    16485 "RTN","BMXRPC10",233,0)
    16486  Q
    16487 "RTN","BMXRPC10",234,0)
    16488  ;
    16489 "RTN","BMXRPC10",235,0)
     16515"RTN","BMXRPC10",240,0)
     16516 Q
     16517"RTN","BMXRPC10",241,0)
     16518 ;
     16519"RTN","BMXRPC10",242,0)
    1649016520BMXCCXT(RESULT,XOPTION) ;creates context for the passed in option
    16491 "RTN","BMXRPC10",236,0)
     16521"RTN","BMXRPC10",243,0)
    1649216522 N XWB1,%,IEN,SIEN,OK,OPTION
    16493 "RTN","BMXRPC10",237,0)
     16523"RTN","BMXRPC10",244,0)
    1649416524 S RESULT=0
    16495 "RTN","BMXRPC10",238,0)
     16525"RTN","BMXRPC10",245,0)
    1649616526 S OPTION=$$DECRYP^XUSRB1(XOPTION) ;S:OPTION="" OPTION="\"
    16497 "RTN","BMXRPC10",239,0)
     16527"RTN","BMXRPC10",246,0)
    1649816528 I $E(OPTION,1,3)="BMX" S RESULT=1 Q  ; NO RESTRICTIONS FOR BMX CONTEXT FOR THIS PORT
    16499 "RTN","BMXRPC10",240,0)
     16529"RTN","BMXRPC10",247,0)
    1650016530 K XQY0,XQY
    16501 "RTN","BMXRPC10",241,0)
    16502  I OPTION="" S XQY=0,XQY0="" Q  ;delete context if "" passed in N PORT
    16503 "RTN","BMXRPC10",242,0)
    16504  S PORT=+$P($P,"|",3) I 'PORT Q
    16505 "RTN","BMXRPC10",243,0)
    16506  S IEN=$O(^BMXMON("B",PORT,0)) I 'IEN Q
    16507 "RTN","BMXRPC10",244,0)
    16508  I '$O(^BMXMON(IEN,1,0)) G BC1  ; NO RESTRICTIONS ON CONTEXT FOR THIS PORT
    16509 "RTN","BMXRPC10",245,0)
    16510  S OK=0,CIEN=0
    16511 "RTN","BMXRPC10",246,0)
    16512  F  S CIEN=$O(^BMXMON(IEN,1,CIEN)) Q:'CIEN  D  I OK Q
    16513 "RTN","BMXRPC10",247,0)
    16514  . S %=$P($G(^BMXMON(IEN,1,CIEN,0)),U) I '% Q
    1651516531"RTN","BMXRPC10",248,0)
    16516  . S %=$P($G(^DIC(19,%,0)),U) I %="" Q
     16532    I OPTION="" S XQY=0,XQY0="" Q  ;delete context if "" passed in N PORT
    1651716533"RTN","BMXRPC10",249,0)
    16518  . I %=OPTION S OK=1
     16534    ;
    1651916535"RTN","BMXRPC10",250,0)
    16520  . Q
     16536    ; Following lines are addition for 4.1000; GT.M does not use BMXMON
    1652116537"RTN","BMXRPC10",251,0)
    16522  I 'OK S (XWBSEC,RESULT)="The context '"_OPTION_"' is not registered with port "_PORT_"." Q
     16538    D:^%ZOSF("OS")["OpenM"  ; Doesn't apply to GT.M; Only Cache
    1652316539"RTN","BMXRPC10",252,0)
     16540    . S PORT=+$P($P,"|",3) I 'PORT Q
     16541"RTN","BMXRPC10",253,0)
     16542 . S IEN=$O(^BMXMON("B",PORT,0)) I 'IEN Q
     16543"RTN","BMXRPC10",254,0)
     16544 . I '$O(^BMXMON(IEN,1,0)) G BC1  ; NO RESTRICTIONS ON CONTEXT FOR THIS PORT
     16545"RTN","BMXRPC10",255,0)
     16546 . S OK=0,CIEN=0
     16547"RTN","BMXRPC10",256,0)
     16548 . F  S CIEN=$O(^BMXMON(IEN,1,CIEN)) Q:'CIEN  D  I OK Q
     16549"RTN","BMXRPC10",257,0)
     16550 . . S %=$P($G(^BMXMON(IEN,1,CIEN,0)),U) I '% Q
     16551"RTN","BMXRPC10",258,0)
     16552 . . S %=$P($G(^DIC(19,%,0)),U) I %="" Q
     16553"RTN","BMXRPC10",259,0)
     16554 . . I %=OPTION S OK=1
     16555"RTN","BMXRPC10",260,0)
     16556 . . Q
     16557"RTN","BMXRPC10",261,0)
     16558 . I 'OK S (XWBSEC,RESULT)="The context '"_OPTION_"' is not registered with port "_PORT_"." Q
     16559"RTN","BMXRPC10",262,0)
    1652416560BC1 S XWB1=$$OPTLK^XQCS(OPTION)
    16525 "RTN","BMXRPC10",253,0)
     16561"RTN","BMXRPC10",263,0)
    1652616562 I XWB1="" S (XWBSEC,RESULT)="The context '"_OPTION_"' does not exist on server." Q  ;P10
    16527 "RTN","BMXRPC10",254,0)
     16563"RTN","BMXRPC10",264,0)
    1652816564 S RESULT=$$CHK^XQCS(DUZ,XWB1)
    16529 "RTN","BMXRPC10",255,0)
     16565"RTN","BMXRPC10",265,0)
    1653016566 ;Access or programmer
    16531 "RTN","BMXRPC10",256,0)
     16567"RTN","BMXRPC10",266,0)
    1653216568BC2 I RESULT!$$KCHK^XUSRB("XUPROGMODE") S XQY0=OPTION,XQY=XWB1,RESULT=1 Q
    16533 "RTN","BMXRPC10",257,0)
     16569"RTN","BMXRPC10",267,0)
    1653416570 S XWBSEC=RESULT
    16535 "RTN","BMXRPC10",258,0)
    16536  Q
    16537 "RTN","BMXRPC10",259,0)
     16571"RTN","BMXRPC10",268,0)
     16572 Q
     16573"RTN","BMXRPC10",269,0)
    1653816574 ;
    16539 "RTN","BMXRPC10",260,0)
     16575"RTN","BMXRPC10",270,0)
    1654016576CVC(OUT,IN) ; EP - RPC: BMX CVC ; CHECK VERIFY CODE (SEE CVC^XUSRB)
    16541 "RTN","BMXRPC10",261,0)
     16577"RTN","BMXRPC10",271,0)
    1654216578 S OUT(0)=99,OUT(1)="INVALID PARAMETERS"
    16543 "RTN","BMXRPC10",262,0)
     16579"RTN","BMXRPC10",272,0)
    1654416580 I $L(IN)
    16545 "RTN","BMXRPC10",263,0)
     16581"RTN","BMXRPC10",273,0)
    1654616582 E  Q
    16547 "RTN","BMXRPC10",264,0)
     16583"RTN","BMXRPC10",274,0)
    1654816584 N AV,EAC,EOVC,ENVC,USER,AC,OVC,NVC,EVC,NVC,X,Y,Z,%,RET,U
    16549 "RTN","BMXRPC10",265,0)
     16585"RTN","BMXRPC10",275,0)
    1655016586 S U="^",RET(0)="",RET(1)=""
    16551 "RTN","BMXRPC10",266,0)
     16587"RTN","BMXRPC10",276,0)
    1655216588 S AV=$$DECRYP^XUSRB1(IN) I AV="" Q
    16553 "RTN","BMXRPC10",267,0)
     16589"RTN","BMXRPC10",277,0)
    1655416590 S AC=$P(AV,";")
    16555 "RTN","BMXRPC10",268,0)
     16591"RTN","BMXRPC10",278,0)
    1655616592 S X=$$EN^XUSHSH(AC)
    16557 "RTN","BMXRPC10",269,0)
     16593"RTN","BMXRPC10",279,0)
    1655816594 S USER=$O(^VA(200,"A",X,0)) I 'USER Q
    16559 "RTN","BMXRPC10",270,0)
     16595"RTN","BMXRPC10",280,0)
    1656016596 S @$C(68,85,90)=USER
    16561 "RTN","BMXRPC10",271,0)
     16597"RTN","BMXRPC10",281,0)
    1656216598 S OVC=$P(AV,";",2) I OVC="" Q
    16563 "RTN","BMXRPC10",272,0)
     16599"RTN","BMXRPC10",282,0)
    1656416600 S NVC=$P(AV,";",3) I NVC="" Q
    16565 "RTN","BMXRPC10",273,0)
     16601"RTN","BMXRPC10",283,0)
    1656616602 S EOVC=$$ENCRYP^XUSRB1(OVC)
    16567 "RTN","BMXRPC10",274,0)
     16603"RTN","BMXRPC10",284,0)
    1656816604 S ENVC=$$ENCRYP^XUSRB1(NVC)
    16569 "RTN","BMXRPC10",275,0)
     16605"RTN","BMXRPC10",285,0)
    1657016606 D CVC^XUSRB(.RET,(ENVC_U_EOVC))
    16571 "RTN","BMXRPC10",276,0)
     16607"RTN","BMXRPC10",286,0)
    1657216608 M OUT=RET
    16573 "RTN","BMXRPC10",277,0)
    16574  Q
    16575 "RTN","BMXRPC10",278,0)
    16576  ;
    16577 "RTN","BMXRPC10",279,0)
     16609"RTN","BMXRPC10",287,0)
     16610 Q
     16611"RTN","BMXRPC10",288,0)
     16612 ;
     16613"RTN","BMXRPC10",289,0)
    1657816614TEST ; TEST CVC
    16579 "RTN","BMXRPC10",280,0)
     16615"RTN","BMXRPC10",290,0)
    1658016616 N DUZ,IN
    16581 "RTN","BMXRPC10",281,0)
     16617"RTN","BMXRPC10",291,0)
    1658216618 S IN=$$ENCRYP^XUSRB1("GREG4330;IRA-1727;IRA-1727")
    16583 "RTN","BMXRPC10",282,0)
     16619"RTN","BMXRPC10",292,0)
    1658416620 D CVC^BMXRPC10(.OUT,IN) W !,$G(OUT(0))," - ",$G(OUT(1))
    16585 "RTN","BMXRPC10",283,0)
    16586  Q
    16587 "RTN","BMXRPC10",284,0)
     16621"RTN","BMXRPC10",293,0)
     16622 Q
     16623"RTN","BMXRPC10",294,0)
    1658816624 ;
    1658916625"RTN","BMXRPC2")
     
    1659216628BMXRPC2 ; IHS/OIT/HMW - FIELD LIST ;
    1659316629"RTN","BMXRPC2",2,0)
    16594  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     16630 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1659516631"RTN","BMXRPC2",3,0)
    1659616632 ;
     
    1681416850 Q
    1681516851"RTN","BMXRPC3")
    16816 0^39^B38590311
     168520^39^B38580443
    1681716853"RTN","BMXRPC3",1,0)
    16818 BMXRPC3 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ; 4/6/11 4:56pm
     16854BMXRPC3 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ; 5/11/11 4:33pm
    1681916855"RTN","BMXRPC3",2,0)
    16820  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     16856 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1682116857"RTN","BMXRPC3",3,0)
     16858   ;
     16859"RTN","BMXRPC3",4,0)
     16860   ; Changed for .1000 by WV/SMH on April 6 2011
     16861"RTN","BMXRPC3",5,0)
     16862   ; - References to ^AUTTSITE in GETFC & GETFCRS removed, as VISTA doesn't use this file
     16863"RTN","BMXRPC3",6,0)
     16864   ; -
     16865"RTN","BMXRPC3",7,0)
     16866   ;
     16867"RTN","BMXRPC3",8,0)
    1682216868    ;
    16823 "RTN","BMXRPC3",4,0)
    16824     ; Changed for .1000 by WV/SMH on April 6 2011
    16825 "RTN","BMXRPC3",5,0)
    16826     ; - References to ^AUTTSITE in GETFC & GETFCRS removed, as VISTA doesn't use this file
    16827 "RTN","BMXRPC3",6,0)
    16828     ; -
    16829 "RTN","BMXRPC3",7,0)
    16830     ;
    16831 "RTN","BMXRPC3",8,0)
    16832  ;
    1683316869"RTN","BMXRPC3",9,0)
    1683416870 ;
     
    1729417330BMXRPC4 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1729517331"RTN","BMXRPC4",2,0)
    17296  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     17332 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1729717333"RTN","BMXRPC4",3,0)
    1729817334 ;
     
    1759217628BMXRPC5 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1759317629"RTN","BMXRPC5",2,0)
    17594  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     17630 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1759517631"RTN","BMXRPC5",3,0)
    1759617632 ;
     
    1784217878BMXRPC6 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1784317879"RTN","BMXRPC6",2,0)
    17844  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     17880 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1784517881"RTN","BMXRPC6",3,0)
    1784617882 ;
     
    1806818104BMXRPC7 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1806918105"RTN","BMXRPC7",2,0)
    18070  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     18106 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1807118107"RTN","BMXRPC7",3,0)
    1807218108 ;
     
    1834018376BMXRPC8 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1834118377"RTN","BMXRPC8",2,0)
    18342  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     18378 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1834318379"RTN","BMXRPC8",3,0)
    1834418380 ;
     
    1852018556BMXRPC9 ; IHS/OIT/HMW - RPC CALL FOR EXTENDED BROKER FUNCTIONALITY ;
    1852118557"RTN","BMXRPC9",2,0)
    18522  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     18558 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1852318559"RTN","BMXRPC9",3,0)
    1852418560 ; UPDATE FILEMAN WITH AN ADO RECORD SET FROM A WINDOWS APPLICATION
     
    1891618952BMXSQL ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1891718953"RTN","BMXSQL",2,0)
    18918  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     18954 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1891918955"RTN","BMXSQL",3,0)
    1892018956 ;
     
    1973019766BMXSQL1 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    1973119767"RTN","BMXSQL1",2,0)
    19732  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     19768 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    1973319769"RTN","BMXSQL1",3,0)
    1973419770 ;
     
    2040420440BMXSQL2 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2040520441"RTN","BMXSQL2",2,0)
    20406  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     20442 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2040720443"RTN","BMXSQL2",3,0)
    2040820444 ;
     
    2060020636BMXSQL3 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2060120637"RTN","BMXSQL3",2,0)
    20602  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     20638 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2060320639"RTN","BMXSQL3",3,0)
    2060420640 ;
     
    2126221298BMXSQL4 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2126321299"RTN","BMXSQL4",2,0)
    21264  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     21300 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2126521301"RTN","BMXSQL4",3,0)
    2126621302 ;
     
    2133021366BMXSQL5 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2133121367"RTN","BMXSQL5",2,0)
    21332  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     21368 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2133321369"RTN","BMXSQL5",3,0)
    2133421370 ;
     
    2169421730BMXSQL6 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ; 2/5/11 10:03pm
    2169521731"RTN","BMXSQL6",2,0)
    21696  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     21732 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2169721733"RTN","BMXSQL6",3,0)
    2169821734 ;
     
    2238822424BMXSQL7 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2238922425"RTN","BMXSQL7",2,0)
    22390  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     22426 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2239122427"RTN","BMXSQL7",3,0)
    2239222428 ;
     
    2285422890BMXSQL91 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ;
    2285522891"RTN","BMXSQL91",2,0)
    22856  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     22892 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2285722893"RTN","BMXSQL91",3,0)
    2285822894 ;
     
    2313823174BMXTABLE ; IHS/OIT/HMW - BMX RETURN ENTIRE TABLE ;
    2313923175"RTN","BMXTABLE",2,0)
    23140  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     23176 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2314123177"RTN","BMXTABLE",3,0)
    2314223178 ;
     
    2315423190BMXTRS ; IHS/OIT/HMW - UPPERCASE-LOWERCASE ;
    2315523191"RTN","BMXTRS",2,0)
    23156  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     23192 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2315723193"RTN","BMXTRS",3,0)
    2315823194 ;
     
    2324023276BMXUTL1 ; IHS/OIT/HMW - UTIL: PATIENT DEMOGRAPHICS ;
    2324123277"RTN","BMXUTL1",2,0)
    23242  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     23278 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2324323279"RTN","BMXUTL1",3,0)
    2324423280 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    2390223938BMXUTL2 ; IHS/OIT/HMW - UTIL: PATIENT INFO ;
    2390323939"RTN","BMXUTL2",2,0)
    23904  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     23940 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2390523941"RTN","BMXUTL2",3,0)
    2390623942 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    2396824004BMXUTL5 ; IHS/OIT/HMW - DATE FORMAT ;
    2396924005"RTN","BMXUTL5",2,0)
    23970  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     24006 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2397124007"RTN","BMXUTL5",3,0)
    2397224008 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
     
    2440424440BMXUTL6 ; IHS/OIT/HMW - BMXNET INSTALLATION CALLS ;
    2440524441"RTN","BMXUTL6",2,0)
    24406  ;;4.1000;BMX;;Apr 17, 2011;Build 1
     24442 ;;4.1000;BMX;;Apr 17, 2011;Build 2
    2440724443"RTN","BMXUTL6",3,0)
    2440824444 ;
Note: See TracChangeset for help on using the changeset viewer.