Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (15 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
49 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCS.m

    r628 r636  
    1 HLCS ;ALB/RJS,MTC,JRP - COMMUNICATIONS SERVER - ;10/04/2007  14:34
    2  ;;1.6;HEALTH LEVEL SEVEN;**2,9,14,19,43,57,109,132,122**;Oct 13, 1995;Build 14
     1HLCS ;ALB/RJS,MTC,JRP - COMMUNICATIONS SERVER - ;10/31/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**2,9,14,19,43,57,109,132**;Oct 13, 1995;Build 6
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    4848 .N I,EXCLUDE
    4949 .S (EXCLUDE,I)=0
    50  . ;
    51  . ; patch HL*1.6*122
    52  . ; F  S I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I  I $G(HLP("EXCLUDE SUBSCRIBER",I))=HLEIDS S EXCLUDE=1 Q
    53  . F  S I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I  D  Q:EXCLUDE
    54  .. N TEMP
    55  .. S TEMP=HLP("EXCLUDE SUBSCRIBER",I)
    56  .. I 'TEMP,TEMP]"" S TEMP=$O(^ORD(101,"B",TEMP,0))
    57  .. I TEMP=HLEIDS S EXCLUDE=1
    58  . ; patch HL*1.6*122
    59  . ;
     50 .F  S I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I  I $G(HLP("EXCLUDE SUBSCRIBER",I))=HLEIDS S EXCLUDE=1 Q
    6051 .Q:EXCLUDE
    6152 .;** 132 end **
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCS2.m

    r628 r636  
    1 HLCS2 ;SF/JC - More Communication Server utilities ; 10/04/2007  14:31
    2  ;;1.6;HEALTH LEVEL SEVEN;**14,40,43,49,57,58,82,84,109,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCS2 ;SF/JC - More Communication Server utilities ; 12/31/2003  17:50
     2 ;;1.6;HEALTH LEVEL SEVEN;**14,40,43,49,57,58,82,84,109**;Oct 13, 1995
    43FWD ; Add supplemental clients from HLL("LINKS") to HLSUP array
    54 ;This enhancement also supports distribution of a message to
     
    109 . S PTR=$P(HLL("LINKS",CNT),"^"),LNK=$P(HLL("LINKS",CNT),"^",2)
    1110 . Q:PTR=""  I +PTR<1 S PTR=$O(^ORD(101,"B",PTR,0)) Q:PTR<1
    12  . ;
    13  . ; patch HL*1.6*122: excluding subscribers defined in
    14  . ; HLP("EXCLUDE SUBSCRIBER",I) = ien of subscriber
    15  . N I,EXCLUDE
    16  . S (EXCLUDE,I)=0
    17  . F  S I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I  D  Q:EXCLUDE
    18  .. N TEMP
    19  .. S TEMP=HLP("EXCLUDE SUBSCRIBER",I)
    20  .. I 'TEMP,TEMP]"" S TEMP=$O(^ORD(101,"B",TEMP,0))
    21  .. I TEMP=PTR S EXCLUDE=1
    22  . Q:EXCLUDE
    23  . ;
    2411 . Q:LNK=""  I +LNK<1 S LNK=$O(^HLCS(870,"B",LNK,0)) Q:LNK<1
    2512 . Q:'$D(^HLCS(870,LNK))
    2613 . S CLIAP=$$PTR^HLUTIL2(PTR)
    27  . ; patch HL*1.6*122: add the 3rd component as receiving facility
    28  . ; S HLSUP("S",PTR,+LNK)=CLIAP_$S(CLIAP<1:U_HLL("LINKS",CNT),1:"")
    29  . S HLSUP("S",PTR,+LNK)=CLIAP_U_$S(CLIAP<1:HLL("LINKS",CNT),1:$P(HLL("LINKS",CNT),"^",3))
     14 . S HLSUP("S",PTR,+LNK)=CLIAP_$S(CLIAP<1:U_HLL("LINKS",CNT),1:"")
    3015 Q
    3116ADD ;Deliver message to supplemental client list.
     
    3924 ..S ZLCLIENT=+HLSUP("S",ZHLEIDS,ZLOGLINK)
    4025 ..I ZLCLIENT<1 S:$G(HLERROR)="" HLERROR="15^Invalid Subscriber Protocol in HLL('LINKS'): "_$P(HLSUP("S",ZHLEIDS,ZLOGLINK),U,2,9) Q
    41  .. ; patch HL*1.6*122 start
    42  .. ; S HLOGLINK=ZLOGLINK D SEND^HLMA2(ZHLEIDS,HLMTIEN,ZLCLIENT,"D",.ZMTIENS,ZLOGLINK),STATUS^HLTF0(+ZMTIENS,1)
    43  .. S HLOGLINK=ZLOGLINK
    44  .. ; 3rd component for receiving facility
    45  .. S ZMTIENS("REC-FACILITY")=$P(HLSUP("S",ZHLEIDS,ZLOGLINK),U,3)
    46  .. D SEND^HLMA2(ZHLEIDS,HLMTIEN,ZLCLIENT,"D",.ZMTIENS,ZLOGLINK)
    47  .. D STATUS^HLTF0(+ZMTIENS,1)
    48  .. ; patch HL*1.6*122 end
    49  .. ;
     26 ..S HLOGLINK=ZLOGLINK D SEND^HLMA2(ZHLEIDS,HLMTIEN,ZLCLIENT,"D",.ZMTIENS,ZLOGLINK),STATUS^HLTF0(+ZMTIENS,1)
    5027 K HLL("LINKS"),HLSUP
    5128 Q
     
    9572 . I 'ALL&('$P(HLDP0,U,6)) Q
    9673 . S HLPARM4=$G(^HLCS(870,HLDP,400))
    97  . ; patch HL*1.6*122
    98  . ; TCP Multi listener: quit if TCP service as GT.M, DSM,
    99  . ; or Cache/VMS
     74 . ;TCP Multi listener for non-Cache uses UCX
    10075 . I $P(HLPARM4,U,3)="M" Q:^%ZOSF("OS")'["OpenM"  Q:$$OS^%ZOSV["VMS"
    101  . ;
    10276 . ;4=status,10=Time Stopped,9=Time Started,11=Task Number,3=Device Type,14=shutdown?
    103  . S X="HLJ(870,"""_HLDP_","")",@X@(10)=$$NOW^XLFDT,(@X@(11),@X@(9))="@",@X@(14)=1
    104  . I "Shutdown,SHUTDOWN"'[$P(HLDP0,U,5) S @X@(4)="Halting"
     77 . S X="HLJ(870,"""_HLDP_","")",@X@(4)="Halting",@X@(10)=$$NOW^XLFDT,(@X@(11),@X@(9))="@",@X@(14)=1
    10578 . I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)),'$P(HLDP0,U,12) S @X@(4)="Shutdown"
    10679 . D FILE^HLDIE("","HLJ","","LLP","HLCS2") ;HL*1.6*109
     80 . ;Cache system, need to open TCP port to release job
    10781 . I ^%ZOSF("OS")["OpenM",($P(HLPARM4,U,3)="M"!($P(HLPARM4,U,3)="S")) D
    108  .. ; pass task number to stop listener
     82 .. ;pass task number to stop listener
    10983 .. S:$P(HLDP0,U,12) X=$$ASKSTOP^%ZTLOAD(+$P(HLDP0,U,12))
    110  ; patch HL*1.6*122 start
    111  ; .. D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
    112  ; .. I POP D HOME^%ZIS Q
    113  ; .. D CLOSE^%ZISTCP
    114  ; patch HL*1.6*122 end
     84 .. D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
     85 .. I POP D HOME^%ZIS Q
     86 .. D CLOSE^%ZISTCP
    11587 Q
    11688STRT ;Start Links
     
    12698 . Q:'HLTYPTR!(HLBGR="")
    12799 . I HLENV'="" K HLQUIT X HLENV Q:$D(HLQUIT)
    128  . ; patch HL*1.6*122
    129  . ; TCP Multi listener: quit if TCP service as GT.M, DSM,
    130  . ; or Cache/VMS
     100 . ;TCP Multi listener for non-Cache uses UCX
    131101 . I $P(HLPARM4,U,3)="M" Q:^%ZOSF("OS")'["OpenM"  Q:$$OS^%ZOSV["VMS"
    132  . ;
    133102 . I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)) D  Q
    134103 .. ;4=status 9=Time Started, 10=Time Stopped, 11=Task Number
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSGTM.m

    r628 r636  
    11HLCSGTM ;OIFO-O/RWF - (TCP/IP) GT.M Linux ;08/13/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**122**;Oct 13, 1995;Build 14
     2 ;;1.6;HEALTH LEVEL SEVEN;**122**;Oct 13, 1995;Build 4;WorldVistA 30-Jan-08
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    77 ;    number.
    88 ; 2. find the ien of #870(logical link file) for the multi-listener
     9 ;Modified from FOIA VISTA,
     10 ;Copyright 2008 WorldVistA.  Licensed under the terms of the GNU
     11 ;General Public License See attached copy of the License.
     12 ;
     13 ;This program is free software; you can redistribute it and/or modify
     14 ;it under the terms of the GNU General Public License as published by
     15 ;the Free Software Foundation; either version 2 of the License, or
     16 ;(at your option) any later version.
     17 ;
     18 ;This program is distributed in the hope that it will be useful,
     19 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     20 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21 ;GNU General Public License for more details.
     22 ;
     23 ;You should have received a copy of the GNU General Public License along
     24 ;with this program; if not, write to the Free Software Foundation, Inc.,
     25 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    926 Q
    1027 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSHDR1.m

    r628 r636  
    1 HLCSHDR1 ;SFIRMFO/RSD - Make HL7 header for TCP ;04/17/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,57,59,72,80,93,120,133,122**;Oct 13, 1995;Build 14
     1HLCSHDR1 ;SFIRMFO/RSD - Make HL7 header for TCP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,57,59,72,80,93,120,133**;Oct 13, 1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44HEADER(IEN,CLIENT,HLERROR) ; Create an HL7 MSH segment
     
    147147 S:'ACKTO MSGTYPE=$P(PROT,U,2),EVNTYPE=$P(PROT,U,3),MSGEVN=$P(PROT,U,4)
    148148 S ACCACK=$P(PROT,U,7),APPACK=$P(PROT,U,8)
    149  ;
    150  ; patch HL*1.6*122
    151  ; setting the MSH-15 and MSH-16 from subscriber protocol
    152  I HLPROTS,$P($G(^ORD(101,HLPROTS,773)),"^",5) D
    153  . S ACCACK=$P(PROTS,U,7)
    154  . S APPACK=$P(PROTS,U,8)
    155  ;
    156149PID ;Processing ID
    157150 ;I PID not 'debug' get from site params
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSHDR4.m

    r628 r636  
    1 HLCSHDR4 ;SFIRMFO/LJA - Reset MSH Segment Fields ;10/09/2007 15:05
    2  ;;1.6;HEALTH LEVEL SEVEN;**93,108,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified
     1HLCSHDR4 ;SFIRMFO/LJA - Reset MSH Segment Fields ;3/24/2004 14:27
     2 ;;1.6;HEALTH LEVEL SEVEN;**93,108**;Oct 13, 1995
    43 ;
    54DEBUG(STORE) ; If HLP set up for debugging, capture VIEW...
     
    112111 ; Change was made, but not by M code.  Must be by array...
    113112 S $P(HLMSH91,U,PCE)=PRE,$P(HLMSH91,U,PCE+1)="A"
    114  ;
    115  ; patch HL*1.6*122: for "^" as component separater
    116  S $P(HLMSH91,U,PCE+2,999)=""
    117113 ;
    118114 ; Upgrade ^HLMA(#,0)...
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSIN.m

    r628 r636  
    1 HLCSIN ;ALB/JRP - INCOMING FILER;01-MAY-95 ;10/17/2007  14:58
    2  ;;1.6;HEALTH LEVEL SEVEN;**2,30,14,19,62,109,115,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCSIN ;ALB/JRP - INCOMING FILER;01-MAY-95 ;11/15/2000  09:37
     2 ;;1.6;HEALTH LEVEL SEVEN;**2,30,14,19,62,109,115**;Oct 13, 1995
    43STARTIN ;Main entry point for incoming background filer
    54 ;Create/find entry denoting this filer in the INCOMING FILER TASK
    65 ; NUMBER multiple (field #20) of the HL COMMUNICATION SERVER PARAMETER
    76 ; file (#869.3)
     7 ;N HLOGLINK,HLNODE,HLPARENT,HLST1,TMP ; These vbls aren't used!
    88 N HLFLG,HLEXIT,HLPTRFLR
    9  ;
    10  ; patch HL*1.6*122
    11  ;; N HLDUZ,DUZ  ; patch HL*1.6*122 TEST v2: DUZ code removed
    12  N HLDUZ
    13  S HLDUZ=+$G(DUZ)
    14  ;
    159 S HLPTRFLR=+$$CRTFLR^HLCSUTL1(ZTSK,"IN")
    1610 ;Loop through Logical Links and check for incoming messages
    1711 S HLEXIT=0
    18  ; patch HL*1.6*122 TEST v2: DUZ code removed
    19  ; patch HL*1.6*122, set DUZ for application proxy user
    20  ;; D PROXY^HLCSTCP4
    21  S HLPTRFLR("$J")=$J
    2212 F  D  Q:HLEXIT
    2313 . S HLFLG=0
     
    2818 . . S HLPTRFLR("LASTDEL")=$H    ; maintain queue sizes
    2919 . . D DELQUE(.HLPTRFLR,.HLEXIT) ; no more than once an hour.
    30  . ; patch HL*1.6*122
    31  . ; H 5
    32  . H 1
     20 . H 5
    3321 . D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
    3422 S ZTSTOP=1 ;Asked to stop
     
    4028 S HLXX=0
    4129 F  S HLXX=$O(^HLMA("AC","I",HLXX)) Q:'HLXX  D  Q:HLEXIT
    42  . ; HL*1.6*122, check the in-queue stop flag
    43  . Q:$P($G(^HLCS(870,HLXX,0)),"^",9)
    4430 . D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
    45  . ; patch HL*1.6*109: Does another filer have this?
    46  . ; L +^HLMA("AC","I",HLXX):0 Q:'$T
    47  . L +^HLMA("AC","I",HLXX):2 Q:'$T  ; patch HL*1.6*122
     31 . ; HL*1.6*109
     32 . L +^HLMA("AC","I",HLXX):0 Q:'$T  ;*109*Does another filer have this?
    4833 . S HLD0=0,HLFLG=1
    4934 . ; HL*1.6*109 changes in for loop below, and post-quit code placed
     
    5338 . I ($$HDIFF^XLFDT($H,$G(^XTMP("HL7-AC","I",HLXX)),2)<2) L -^HLMA("AC","I",HLXX) Q
    5439 . F  S HLD0=$O(^HLMA("AC","I",HLXX,HLD0)) Q:'HLD0!(HLEXIT)  D
    55  .. ; patch HL*1.6*122 start
    56  .. ; patch HL*1.6*122 TEST v2: DUZ code removed
    57  .. ; DUZ comparison/reset for application proxy user
    58  .. ;; D HLDUZ^HLCSTCP4
    59  .. D HLDUZ2^HLCSTCP4
    60  .. ; protect HLDUZ
    61  .. N HLDUZ
    62  .. S HLPCT=HLPCT+1
    63  .. I '(HLPCT#100) D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
    64  .. ; L +^HLMA(HLD0):0 Q:'$T
    65  .. F  L +^HLMA(HLD0):30 Q:$T  H 1
    66  .. I '$$CHECKAC("I",HLXX,HLD0) L -^HLMA(HLD0) Q  ;-> Quit if not a valid AC xref
    67  .. D DEFACK^HLTP3(HLXX,HLD0)
    68  .. D DEQUE^HLCSREP(HLXX,"I",HLD0)
    69  .. L -^HLMA(HLD0)
    70  . ; patch HL*1.6*122 end
     40 . . S HLPCT=HLPCT+1
     41 . . I '(HLPCT#100) D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
     42 . . L +^HLMA(HLD0):0 Q:'$T
     43 . . I '$$CHECKAC("I",HLXX,HLD0) L -^HLMA(HLD0) Q  ;-> Quit if not a valid AC xref
     44 . . D DEFACK^HLTP3(HLXX,HLD0)
     45 . . D DEQUE^HLCSREP(HLXX,"I",HLD0)
     46 . . L -^HLMA(HLD0)
    7147 . ;**109 -add dt/tm stamp to time queue last processed
    7248 . S ^XTMP("HL7-AC","I",HLXX)=$H
     
    8965 S HLXX=0
    9066 F  S HLXX=$O(^HLCS(870,"AISTAT","P",HLXX)) Q:'HLXX  D  Q:HLEXIT
    91  . ; HL*1.6*122, check the in-queue stop flag
    92  . Q:$P($G(^HLCS(870,HLXX,0)),"^",9)
    9367 . D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
    94  . ; HL*1.6*109: Does another filer have this?
    95  . ; L +^HLCS(870,HLXX,"INFILER"):0 Q:'$T
    96  . L +^HLCS(870,HLXX,"INFILER"):2 Q:'$T  ; patch HL*1.6*122
     68 .; HL*1.6*109
     69 . L +^HLCS(870,HLXX,"INFILER"):0 Q:'$T  ;Does another filer have this?
    9770 . F  D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT  S HLD0=$$DEQUEUE^HLCSQUE(HLXX,"IN") Q:+HLD0<0  D
    98  .. ;
    99  .. ; patch HL*1.6*122 start
    100  .. ; clean variables except Kernel related variables
    101  .. D
    102  ... ; protect variables defined in STARTIN^HLCSIN
    103  ... N HLFLG,HLEXIT,HLPTRFLR
    104  ... N HLDUZ
    105  ... ; protect variables defined in ACKNOW^HLCSIN
    106  ... N HLXX,HLD0,HLD1
    107  ... D KILL^XUSCLEAN
    108  .. ;
    109  .. ; patch HL*1.6*122 TEST v2: DUZ code removed
    110  .. ; DUZ comparison/reset for application proxy user
    111  .. ;; D HLDUZ^HLCSTCP4
    112  .. D HLDUZ2^HLCSTCP4
    113  .. ; protect HLDUZ
    114  .. N HLDUZ
    115  .. ;Make sure message is ready to be received
    116  .. S HLFLG=1
    117  .. S HLD1=$P(HLD0,"^",2)
    118  .. S HLD0=+HLD0 ; At this point, HLD0=HLXX
    119  .. I $P($G(^HLCS(870,HLD0,1,HLD1,0)),"^",3)'="A" D  Q
    120  ... D MONITOR^HLCSDR2("D",2,HLD0,HLD1,"IN") ;Set status to DONE
    121  .. D RECEIVE^HLMA0(HLD0,HLD1) ;Process received message
    122  .. D MONITOR^HLCSDR2("D",2,HLD0,HLD1,"IN") ;Set status to DONE
    123  . ; patch HL*1.6*122 end
     71 . . ;Make sure message is ready to be received
     72 . . S HLFLG=1
     73 . . S HLD1=$P(HLD0,"^",2)
     74 . . S HLD0=+HLD0 ; At this point, HLD0=HLXX
     75 . . I $P($G(^HLCS(870,HLD0,1,HLD1,0)),"^",3)'="A" D  Q
     76 . . . D MONITOR^HLCSDR2("D",2,HLD0,HLD1,"IN") ;Set status to DONE
     77 . . D RECEIVE^HLMA0(HLD0,HLD1) ;Process received message
     78 . . D MONITOR^HLCSDR2("D",2,HLD0,HLD1,"IN") ;Set status to DONE
    12479 . I HLD0<0,$D(^HLCS(870,"AISTAT","P",HLXX)) D
    12580 . . S HLD1=0 ; Make sure there aren't any loose xrefs hanging around.
     
    13489 F  S HLXX=$O(^HLCS(870,HLXX)) Q:'HLXX  D  Q:HLEXIT
    13590 . D CHKUPD(.HLPTRFLR,.HLEXIT) Q:HLEXIT
    136  . ; patch HL*1.6*122, comment out, no need to lock
    137  . ; L +^HLCS(870,HLXX,"IN QUEUE FRONT POINTER"):0 Q:'$T
     91 . L +^HLCS(870,HLXX,"IN QUEUE FRONT POINTER"):0 Q:'$T
    13892 . S HLFRONT=$G(^HLCS(870,HLXX,"IN QUEUE FRONT POINTER"))
    139  . ; patch HL*1.6*122, comment out
    140  . ; L -^HLCS(870,HLXX,"IN QUEUE FRONT POINTER")
     93 . L -^HLCS(870,HLXX,"IN QUEUE FRONT POINTER")
    14194 . D DELETE^HLCSQUE1(HLXX,HLDIR,HLFRONT)
    14295 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSLNCH.m

    r628 r636  
    1 HLCSLNCH ;ALB/MTC/JC - START AND STOP THE LLP ;07/26/2007  17:10
    2  ;;1.6;HEALTH LEVEL SEVEN;**6,19,43,49,57,75,84,109,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCSLNCH ;ALB/MTC/JC - START AND STOP THE LLP ;12/31/2003  17:37
     2 ;;1.6;HEALTH LEVEL SEVEN;**6,19,43,49,57,75,84,109**;Oct 13, 1995
    43 ;
    54 ;This program is callable from a menu
     
    2423 W !,"appropriate device.  Please select the node with which you want"
    2524 W !,"to communicate",!
    26  ; patch HL*1.6*122
    27  S POP=0
    2825 S DIC="^HLCS(870,",DIC(0)="QEAMZ" D ^DIC G:Y<0 STARTQ
    2926 S HLDP=+Y,HLDAPP=Y(0,0),HLTYPTR=+$P(Y(0),U,3),HLPARM0=Y(0)
    3027 ;-- check if parameter have been setup
    3128 ;-- check for LLP type
    32  I 'HLTYPTR W !!,$C(7),"A Lower Layer Protocol must be selected before start-up can occur." G STARTQ
     29 I 'HLTYPTR W !,$C(7),"A Lower Layer Protocol must be selected before start-up can occur." G STARTQ
    3330 ;-- get TCP information
    3431 S HLPARM4=$G(^HLCS(870,HLDP,400))
     
    3835 S HLENV=$G(^HLCS(869.1,HLTYPTR,200))
    3936 ;
    40  I HLBGR="" W !!,$C(7),"No routine has been specified for this LLP." G STARTQ
     37 I HLBGR="" W !,$C(7),"No routine has been specified for this LLP." G STARTQ
    4138 ;
    4239 ;-- execute environment check routine if HLQUIT is defined then terminate
    4340 I HLENV'="" X HLENV G:$D(HLQUIT) STARTQ
    44  ; patch HL*1.6*122 start
    45  ; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
    46  ; by the external service
     41 ;Multi-Servers, only enable the link if not OpenM
    4742 I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D  G STARTQ
    4843 . W !,$C(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to start this LLP."
    4944 . Q
    50  ; patch HL*1.6*122 end
    5145 ;
    5246 I $P(HLPARM0,U,10) W !,$C(7),"The LLP was last started on ",$$DAT2^HLUTIL1($P(HLPARM0,U,10)),"." G STP1:$P(HLPARM0,U,5)'="Error"
    5347 I $P(HLPARM0,U,11) W !,"The LLP was last shutdown on ",$$DAT2^HLUTIL1($P(HLPARM0,U,11)),"."
    54  ; patch HL*1.6*122 start
    55  ; comment out-should be taken care of by the code 2 line above
    56  ; I $P(HLPARM0,U,5)'="Error",'($P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4))),$P(HLPARM0,U,10)]""&($P(HLPARM0,U,11)=""),$P(HLPARM0,U,12) W !,"The LLP appears to be online already !"
    57  ; I $$TASK^HLUTIL1($P(HLPARM0,U,12)) D  G STARTQ
    58  ; . W !,$C(7),"NOTE: The lower level protocol for this application is already running."
    59  N HLTEMP
    60  S HLTEMP=0
    61  I $P(HLPARM0,U,12) D  G:HLTEMP STARTQ
    62  . N ZTSK
    63  . S ZTSK=$P(HLPARM0,U,12)
    64  . D STAT^%ZTLOAD
    65  . I "12"[ZTSK(1) D
    66  .. W !,$C(7),"NOTE: The lower level protocol for this application is already running."
    67  .. I '$P(^HLCS(870,HLDP,0),"^",10) S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
    68  .. S HLTEMP=1
    69  ; patch HL*1.6*122 end
     48 I $P(HLPARM0,U,5)'="Error",'($P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4))),$P(HLPARM0,U,10)]""&($P(HLPARM0,U,11)=""),$P(HLPARM0,U,12) W !,"The LLP appears to be online already !"
     49 I $$TASK^HLUTIL1($P(HLPARM0,U,12)) D  G STARTQ
     50 . W !,$C(7),"NOTE: The lower level protocol for this application is already running."
    7051 I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)) D  G STARTQ
    71  .;4=status 9=Time Started, 10=Time Stopped, 11=Task Number
     52 .;4=status 9=Time Started, 10=Time Stopped, 11=Task Number 
    7253 .;14=Shutdown LLP, 3=Device Type, 18=Gross Errors
    7354 .N HLJ,X
    74  . ; patch HL*1.6*122-comment out
    75  . ; I $P(HLPARM0,U,15)=0 W !,"This LLP is already enabled!" Q
     55 .I $P(HLPARM0,U,15)=0 W !,"This LLP is already enabled!" Q
    7656 .L +^HLCS(870,HLDP,0):2
    7757 .E  W !,$C(7),"Unable to enable this LLP !" Q
     
    8464 I $P(HLPARM4,U,6),$D(^%ZIS(14.7,+$P(HLPARM4,U,6),0)) S ZTCPU=$P(^(0),U) W !,"This LLP will start on node ",ZTCPU," if it is run in the Background.",!
    8565 ;
    86  ; patch HL*1.6*122 start, for tcp link
    87  I HLTYPTR=4 D  Q
    88  . S Y="B"
    89  . D STARTJOB
    90  ; patch HL*1.6*122 end
    91  ;
    9266 W ! S DIR(0)="SM^F:FOREGROUND;B:BACKGROUND;Q:QUIT"
    9367 S DIR("A")="Method for running the receiver"
     
    9973 Q:(Y=U)!(Y="Q")
    10074 ;
    101 STARTJOB ;
    10275 S HLX=$G(^HLCS(870,HLDP,0))
    10376 ;-- foreground
    10477 I Y="F" S HLTRACE=1 D  G STARTQ
    105  . S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
    106  . D MON^HLCSTCP("Start")
    10778 . X HLBGR
    10879 ;-- background
     
    11182 . S ZTDESC=HLDAPP_" Low Level Protocol",ZTSAVE("HLDP")=""
    11283 . D ^%ZTLOAD
    113  . ; patch HL*1.6*122 start
    114  . I $D(ZTSK) D
    115  .. K HLTRACE
    116  .. D MON^HLCSTCP("Tasked")
    117  .. S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
    118  . ; patch HL*1.6*122 end
    11984 . W !,$S($D(ZTSK):"Job was queued as "_ZTSK_".",1:"Unable to queue job.")
    12085 ;
    12186 Q
     87 ;
    12288 ;
    12389STARTQ ;
     
    13298 S DIC="^HLCS(870,",DIC(0)="QEAMZ" D ^DIC K DIC Q:Y<0
    13399 S HLDP=+Y,HLDAPP=Y(0,0),HLPARM0=Y(0),HLPARM4=$G(^HLCS(870,HLDP,400))
    134  ; patch HL*1.6*122
    135  ; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
    136  ; by the external service
    137100 I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D  Q
    138  . W !,$C(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to disable this LLP."
     101 . W !,$C(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. UCX. You must use the external service to disable this LLP."
    139102 . Q
    140103 ;
     
    150113 I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)),'$P(HLPARM0,U,12) S @X@(4)="Shutdown"
    151114 D FILE^HLDIE("","HLJ","","STOP","HLCSLNCH") ; HL*1.6*109
    152  ; patch HL*1.6*122 start
    153  ; I ^%ZOSF("OS")["OpenM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
    154  ; I ^%ZOSF("OS")'["DSM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
    155  I ($P(HLPARM4,U,3)="S")!(($P(HLPARM4,U,3)="M")&($S(^%ZOSF("OS")'["OpenM":0,1:$$OS^%ZOSV'["VMS"))) D
     115 I ^%ZOSF("OS")["OpenM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
    156116 . ;pass task number to stop listener
    157117 . S:$P(HLPARM0,U,12) X=$$ASKSTOP^%ZTLOAD(+$P(HLPARM0,U,12))
    158  . ; D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
    159  . ; I POP D HOME^%ZIS U IO W !,"Unable to shutdown logical link!!!",$C(7),$C(7) Q
    160  . ; U IO W "**STOP**"
    161  . ; W !
    162  . ; D CLOSE^%ZISTCP
    163  . ; patch HL*1.6*122 end
     118 . D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
     119 . I POP D HOME^%ZIS U IO W !,"Unable to shutdown logical link!!!",$C(7),$C(7) Q
     120 . U IO W "**STOP**"
     121 . W !
     122 . D CLOSE^%ZISTCP
    164123 L -^HLCS(870,HLDP,0)
    165124 W !,"The job for the "_HLDAPP_" Lower Level Protocol will be shut down."
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSMON.m

    r628 r636  
    1 HLCSMON ;SF-DISPLAY DRIVER PROGRAM  ;12/11/2007  17:07
    2  ;;1.6;HEALTH LEVEL SEVEN;**34,40,48,49,65,66,73,109,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCSMON ;SF-DISPLAY DRIVER PROGRAM  ;07/10/2000  12:18
     2 ;;1.6;HEALTH LEVEL SEVEN;**34,40,48,49,65,66,73,109**;Oct 13, 1995
    43 ;
    54 ;This Program drives a real-time display monitor for the HL7
     
    1817 N HLPARAM,HLPROC,HLPROD,HLSEND,HLSENT,HLSITE
    1918 N HLI,HLREC,HLRUNCNT,HLSTAT,HLTMSTAT,HLLMSTAT,HLVIEW,HLXX,HLYY,X,Y,DX,DY
    20  ;
    21  ; patch HL*1.6*122 start
    22  D HOME^%ZIS
    23  W @IOF
    24  ; patch HL*1.6*122 end
    2519 ;
    2620 D ^HLCSTERM ;Sets up variables to control display attributes
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSMON1.m

    r628 r636  
    1 HLCSMON1 ;SF-Utilities for Driver Program  ;07/17/2007  17:05
    2  ;;1.6;HEALTH LEVEL SEVEN;**15,40,49,65,109,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCSMON1 ;SF-Utilities for Driver Program  ;02/04/2004  10:25
     2 ;;1.6;HEALTH LEVEL SEVEN;**15,40,49,65,109**;Oct 13, 1995
    43 ;
    54 ;This routine contains several entry points called from HLCSMON
     
    1211 F  S HLXX=$O(HLARYD(HLXX)) Q:(HLXX'>0)  D WLINE(HLXX)
    1312 ;DISPLAY INCOMING FILER STATUS
    14  ; patch HL*1.6*122
    15  S HLXX=$P(HLRUNCNT,"^",1)
    16  ; S HLXX=$$CNTFLR^HLCSUTL2("IN")
    17  I (+HLXX)=-1 S HLXX=$$CNTFLR^HLCSUTL2("IN")
    18  ;
     13 S HLXX=$$CNTFLR^HLCSUTL2("IN")
    1914 ;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
    2015 I (HLXX'=+HLRUNCNT) D
     
    2419 .S $P(HLRUNCNT,"^",1)=HLXX
    2520 ;DISPLAY OUTGOING FILER STATUS
    26  ; patch HL*1.6*122
    27  S HLXX=$P(HLRUNCNT,"^",2)
    28  ; S HLXX=$$CNTFLR^HLCSUTL2("OUT")
    29  I (+HLXX)=-1 S HLXX=$$CNTFLR^HLCSUTL2("OUT")
    30  ;
     21 S HLXX=$$CNTFLR^HLCSUTL2("OUT")
    3122 ;ONLY UPDATE SCREEN IF COUNT HAS CHANGED
    3223 I (HLXX'=+$P(HLRUNCNT,"^",2)) D
     
    5647 I HLARYD(HLXX)]"",HLARYD(HLXX)=$G(HLARYO(HLXX)) Q
    5748 S HLARYO(HLXX)=HLARYD(HLXX),HLERR=$P(HLARYD(HLXX),U,8),DX=1
    58  ; patch HL*1.6*122
    59  ; F X=1:1:7 S @$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_"        ",1,8)
    60  F X=1,7 S @$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_"        ",1,10)
    61  F X=2:1:5 S @$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_"        ",1,8)
    62  S X=6,@$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_"        ",1,7)
    63  ;
     49 F X=1:1:7 S @$P("HLNODE^HLREC^HLPROC^HLSEND^HLSENT^HLDEV^HLSTAT",U,X)=$E($P(HLARYD(HLXX),U,X)_"        ",1,8)
    6450 ;if link is in error, write node in rev. video
    6551 I HLERR]"" D WDATA(5,HLXX,IOBON_IORVON,IOBOFF_IORVOFF,HLNODE,8) S DX=14
    6652 ;Turn off terminal line wrap & inform O/S where cursor is located
    6753 S DY=HLXX X IOXY,^%ZOSF("XY")
    68  ; patch HL*1.6*122
    69  W:HLERR="" ?4,HLNODE
    70  W ?16,HLREC,?26,HLPROC,?37,HLSEND,?47,HLSENT,?58,HLDEV,?63,HLSTAT
    71  ;
     54 W:HLERR="" ?5,HLNODE
     55 W ?16,HLREC,?26,HLPROC,?37,HLSEND,?47,HLSENT,?58,HLDEV,?64,HLSTAT
    7256 Q
    7357 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSREP.m

    r628 r636  
    1 HLCSREP ;ALB/MFK - HL7 QUEUE MANAGEMENT ;10/17/2007  08:56
    2  ;;1.6;HEALTH LEVEL SEVEN;**109,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     1HLCSREP ;ALB/MFK - HL7 QUEUE MANAGEMENT - 10/4/94 1pm
     2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
    53REPMSG ;Duplicate messages on a queue
    64 ; INPUT:  MSG   - Array which contains the queue and the
     
    3634 I DIR'="I",DIR'="O" Q
    3735 Q:'$G(IEN773)
    38  ;
    39  ; patch HL*1.6*122: MPI-client/server
    40  F  L +^HLMA("AC",DIR,LINK,IEN773):10 Q:$T  H 1
    4136 S ^HLMA("AC",DIR,LINK,IEN773)=""
    42  L -^HLMA("AC",DIR,LINK,IEN773)
    43  ;
    4437 S $P(^HLMA(+IEN773,0),U,17)=+LINK ; HL*1.6*109 - lja
    4538 I DIR="O" D LLCNT^HLCSTCP(LINK,3)
     
    5649 I DIR'="I",DIR'="O" Q
    5750 Q:'$G(IEN773)
    58  ;
    59  ; patch HL*1.6*122: MPI-client/server
    60  F  L +^HLMA("AC",DIR,LINK,IEN773):10 Q:$T  H 1
    6151 K ^HLMA("AC",DIR,LINK,IEN773)
    62  L -^HLMA("AC",DIR,LINK,IEN773)
    63  ;
    6452 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP.m

    r628 r636  
    1 HLCSTCP ;SFIRMFO/TNV-ALB/JFP,PKE - (TCP/IP) MLLP ;09/19/2007  10:21
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,58,64,84,109,133,122**;Oct 13, 1995;Build 14
     1HLCSTCP ;SFIRMFO/TNV-ALB/JFP,PKE - (TCP/IP) MLLP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,58,64,84,109,133**;Oct 13, 1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     4 ; 
    55 ; This is an implementation of the HL7 Minimal Lower Layer Protocol
    6  ; taskman entry/startup option, HLDP defined in menu entry.
    7  ;
     6 ;
     7 ;taskman entry/startup option, HLDP defined in menu entry,
    88 Q:'$D(HLDP)
    9  ; patch HL*1.6*122 start
    10  L +^HLCS("HLTCPLINK",HLDP):5 I '$T D  Q
    11  . D MON^HLCSTCP("TskLcked")
    12  N HLCSOUT,HLDBACK,HLDBSIZE,HLDREAD,HLDRETR,HLRETRA,HLDWAIT,HLOS,HLTCPADD,HLTCPCS,HLTCPLNK,HLTCPORT,HLTCPRET
    13  N HLZRULE
     9 N HLCSOUT,HLDBACK,HLDBSIZE,HLDREAD,HLDRETR,HLRETRA,HLDWAIT,HLOS,HLTCPADD,HLTCPCS,HLTCPLNK,HLTCPORT,HLTCPRET,HLCSFAIL
    1410 ;HLCSOUT= 1-error
    1511 I '$$INIT D EXITS("Init Error") Q
    16  S HLDP("$J")=$J
    17  S HLDP("$J",0,"LENGTH")=$L(HLDP("$J"))
    1812 ; Start the client
    1913 I $G(HLTCPCS)="C" D  Q
    20  . S HLDP("$J",0,"START")=HLDP("$J",0,"LENGTH")-8+$L(HLTCPORT)+$L(HLDP)
    21  . I HLDP("$J",0,"START")<1 S HLDP("$J",0,"START")=1
    22  . S HLDP("$J",0)=$E(HLDP("$J"),HLDP("$J",0,"START"),HLDP("$J",0,"LENGTH"))
    2314 . ; identify process for ^%SY
    24  . ; D SETNM^%ZOSV($E("HLClnt:"_HLDP,1,15))
    25  . D SETNM^%ZOSV($E("HLc:"_HLTCPORT_"-"_HLDP_"-"_HLDP("$J",0),1,15))
    26  . K HLDP("$J",0)
     15 . D SETNM^%ZOSV($E("HLClnt:"_HLDP,1,15))
    2716 . D ST1
    2817 . F  D ^HLCSTCP2 Q:$$STOP!$G(HLCSOUT)
    29  . ; I $G(HLCSOUT)=1 D MON("Error") H 1 Q
    30  . I $G(HLCSOUT)=1 D  Q
    31  .. D MON("Error") H 1
    32  .. L -^HLCS("HLTCPLINK",HLDP)
     18 . I $G(HLCSOUT)=1 D MON("Error") H 1 Q
    3319 . I $G(HLCSOUT)=2 D EXITS("Inactive") Q
    3420 . D EXITS("Shutdown")
    3521 ;
    36  S HLDP("$J",0,"START")=HLDP("$J",0,"LENGTH")-9+$L(HLTCPORT)
    37  I HLDP("$J",0,"START")<1 S HLDP("$J",0,"START")=1
    38  S HLDP("$J",0)=$E(HLDP("$J"),HLDP("$J",0,"START"),HLDP("$J",0,"LENGTH"))
    3922 ; identify process for ^%SY
    40  ; D SETNM^%ZOSV($E("HLSrv:"_HLDP,1,15))
    41  D SETNM^%ZOSV($E("HLs:"_HLTCPORT_"-"_HLDP("$J",0),1,15))
    42  K HLDP("$J",0)
    43  ; to stop the listener via updated Kernel API, need to pass the
    44  ; listener logical link (HLDP)
    45  S HLZRULE="S HLDP="_HLDP_" S ZISQUIT=$$STOP^HLCSTCP"
     23 D SETNM^%ZOSV($E("HLSrv:"_HLDP,1,15))
     24 ;HLCSFAIL=1 port failed to open
     25 S HLCSFAIL=1
    4626 ;single threaded listener
    4727 I $G(HLTCPCS)="S" D  Q
    48  . D ST1,MON("Listen"),LISTEN^%ZISTCP(HLTCPORT,"SERVER^HLCSTCP("""_HLDP_""")",HLZRULE)
    49  . I $$STOP D EXITS("Shutdown") Q
    50  . D EXITS("Openfail")
    51  ;
    52  ;multi-threaded listener (for OpenM/NT)
    53  I ($G(HLTCPCS)'="M")!(^%ZOSF("OS")'["OpenM") D  Q
    54  . L -^HLCS("HLTCPLINK",HLDP)
    55  I $$OS^%ZOSV["VMS" L -^HLCS("HLTCPLINK",HLDP) Q
    56  D ST1,MON("Listen"),LISTEN^%ZISTCPS(HLTCPORT,"SERVERS^HLCSTCP("""_HLDP_""")",HLZRULE)
    57  ; update status of listener
    58  I $$STOP D EXITS("Shutdown") Q
    59  D EXITS("Openfail")
    60  ; HL*1.6*122 end
     28 . D ST1,MON("Listen"),LISTEN^%ZISTCP(HLTCPORT,"SERVER^HLCSTCP("""_HLDP_""")")
     29 . ;couldn't open listener port
     30 . I HLCSFAIL D EXITS("Openfail") Q
     31 ;
     32 ;multi-threaded listener (OpenM)
     33 I $G(HLTCPCS)="M",^%ZOSF("OS")["OpenM" D  Q
     34 . D ST1,MON("Listen"),LISTEN^%ZISTCPS(HLTCPORT,"SERVERS^HLCSTCP("""_HLDP_""")")
    6135 Q
    6236 ;
    6337SERVER(HLDP) ; single server using Taskman
     38 S HLCSFAIL=0
    6439 I '$$INIT D EXITS("Init error") Q
    6540 D ^HLCSTCP1
     
    8055 G LISTEN
    8156 ;
     57CACHEVMS(%) ;Cache'/VMS tcpip/ucx entry point, called from HLSEVEN.COM file,
     58 ;listener,  % = HLDP
     59 I $G(%)="" D ^%ZTER Q
     60 S IO="SYS$NET",HLDP=%
     61 S IO(0)="_NLA0:" O IO(0) ;Setup null device
     62 ; **Cache'/VMS specific code**
     63 O IO::5 E  D MON("Openfail") Q
     64 X "U IO:(::""-M"")" ;Packet mode like DSM
     65 D LISTEN C IO Q
     66 ;
     67EN ;vms ucx entry point, called from HLSEVEN.COM file,
     68 ;listener,  % = device^HLDP
     69 I $G(%)="" D ^%ZTER Q
     70 S IO="SYS$NET",U="^",HLDP=$P(%,U,2)
     71 S IO(0)="_NLA0:" O IO(0) ;Setup null device
     72 ; **VMS specific code, need to share device**
     73 O IO:(TCPDEV):60 E  D MON("Openfail") Q
    8274LISTEN ;
    83  N HLLSTN,HLCSOUT,HLDBACK,HLDBSIZE,HLDREAD,HLDRETR,HLRETRA,HLDWAIT,HLOS,HLTCPADD,HLTCPCS,HLTCPLNK,HLTCPORT,HLTCPRET
     75 N HLLSTN,HLCSOUT,HLDBACK,HLDBSIZE,HLDREAD,HLDRETR,HLRETRA,HLDWAIT,HLOS,HLTCPADD,HLTCPCS,HLTCPLNK,HLTCPORT,HLTCPRET,HLCSFAIL
    8476 I '$$INIT D ^%ZTER Q
    85  ; patch HL*1.6*122 start
    86  S HLDP("$J")=$J
    87  S HLDP("$J",0,"LENGTH")=$L(HLDP("$J"))
    88  S HLDP("$J",0,"START")=HLDP("$J",0,"LENGTH")-9+$L(HLTCPORT)
    89  I HLDP("$J",0,"START")<1 S HLDP("$J",0,"START")=1
    90  S HLDP("$J",0)=$E(HLDP("$J"),HLDP("$J",0,"START"),HLDP("$J",0,"LENGTH"))
    9177 ; identify process for ^%SY
    92  ; D SETNM^%ZOSV($E("HLSrv:"_HLDP,1,15))
    93  D SETNM^%ZOSV($E("HLs:"_HLTCPORT_"-"_HLDP("$J",0),1,15))
    94  K HLDP("$J",0)
    95  ; patch HL*1.6*122 end
     78 D SETNM^%ZOSV($E("HLSrv:"_HLDP,1,15))
    9679 ;HLLSTN used to identify a listener to tag MON
    9780 S HLLSTN=1
     
    11093 S HLOS=$P($G(^%ZOSF("OS")),"^")
    11194 N DA,DIQUIET,DR,TMP,X,Y
    112  S IOF=$$FLUSHCHR^%ZISTCP ; HL*1.6*122 set device flush character
    11395 S DIQUIET=1
    11496 D DT^DICRW
    11597 I 'HLDP S HLDP=$O(^HLCS(870,"B",HLDP,0)) I 'HLDP Q 0
    11698 S DA=HLDP
    117  ; patch HL*1.6*122 for field 400.09
    118  S DR="200.02;200.021;200.022;200.03;200.04;200.05;200.09;400.01;400.02;400.03;400.04;400.05;400.09"
     99 S DR="200.02;200.021;200.022;200.03;200.04;200.05;200.09;400.01;400.02;400.03;400.04;400.05"
    119100 D GETS^DIQ(870,DA,DR,"IN","TMP","TMP")
    120101 ;
     
    144125 S HLTCPRET=$G(TMP(870,DA_",",400.05,"I"))
    145126 ;
    146  ; patch HL*1.6*122 for field 400.09
    147  ; -- tcp/ip openfail timeout
    148  S HLTCPLNK("TIMEOUT")=$G(TMP(870,DA_",",400.09,"I"))
    149  ;
    150127 ; -- set defaults in case something's not set
    151128 S:HLDREAD=0 HLDREAD=10
    152129 S:HLDBACK=0 HLDBACK=60
    153  ; patch HL*1.6*122
    154  ; S:HLDBSIZE=0 HLDBSIZE=245
    155  S:HLDBSIZE<245 HLDBSIZE=245
     130 S:HLDBSIZE=0 HLDBSIZE=245
    156131 S:HLDRETR=0 HLDRETR=5
    157132 S:HLTCPRET="" X=$P($$PARAM^HLCS2,U,12),HLTCPRET=$S(X:X,1:15)
    158  ;
    159  ; patch HL*1.6*122 for field 400.09
    160  S:HLTCPLNK("TIMEOUT")=0 HLTCPLNK("TIMEOUT")=5
    161133 ;
    162134 Q 1
     
    166138 ;14=Shutdown LLP, 3=LLP Online, 18=Gross Errors
    167139 N HLJ,X
    168  ; HL*1.6*122 remove unnecessary locks
    169  ;F  L +^HLCS(870,HLDP,0):2 Q:$T
     140 F  L +^HLCS(870,HLDP,0):2 Q:$T
    170141 S X="HLJ(870,"""_HLDP_","")"
    171142 S @X@(4)="Init",(@X@(10),@X@(18))="@",@X@(14)=0
     
    175146 S:$G(ZTSK) @X@(11)=ZTSK
    176147 D FILE^HLDIE("","HLJ","","ST1","HLCSTCP") ;HL*1.6*109
    177  ;L -^HLCS(870,HLDP,0)
     148 L -^HLCS(870,HLDP,0)
    178149 Q
    179150 ;
     
    181152 ;don't display for multiple server
    182153 Q:$G(HLLSTN)
    183  ; HL*1.6*122 remove unnecessary locks
    184  ;F  L +^HLCS(870,HLDP,0):2 Q:$T
     154 F  L +^HLCS(870,HLDP,0):2 Q:$T
    185155 S $P(^HLCS(870,HLDP,0),U,5)=Y
    186  ;L -^HLCS(870,HLDP,0)
     156 L -^HLCS(870,HLDP,0)
    187157 Q:'$D(HLTRACE)
    188158 N X U IO(0)
    189159 W !,"IN State: ",Y
    190160 I '$$STOP D
    191  . ; patch HL*1.6*122
    192  . ; R !,"Type Q to Quit: ",X#1:1
    193  . R !,"Type Q to Quit: ",X:1
    194  . ; I $L(X),"Qq"[X S $P(^HLCS(870,HLDP,0),U,15)=1
    195  . I $L(X),"Qq"[$E(X) S $P(^HLCS(870,HLDP,0),U,15)=1
    196  . ; patch HL*1.6*122 end
     161 . R !,"Type Q to Quit: ",X#1:1
     162 . I $L(X),"Qq"[X S $P(^HLCS(870,HLDP,0),U,15)=1
    197163 U IO
    198164 Q
    199165UPDT(Y) ;update job count for multiple servers,X=1 increment
    200166 N HLJ,X
    201  ;
    202  ; HL*1.6*122 start
    203  ; F  L +^HLCS(870,HLDP,0):2 Q:$T
    204  Q:'$G(HLDP)
    205  Q:'$D(^HLCS(870,"E","M",HLDP))
    206  F  L +^HLCS(870,HLDP,0):10 Q:$T  H 1
    207  ; S X=+$P(^HLCS(870,HLDP,0),U,5),$P(^(0),U,5)=$S(Y:X+1,1:X-1)_" server"
    208  S X=+$P(^HLCS(870,HLDP,0),U,5)
    209  I X<0 S X=0
    210  S $P(^HLCS(870,HLDP,0),U,5)=$S(Y:(X+1),X<1:0,1:X-1)_" server"
     167 F  L +^HLCS(870,HLDP,0):2 Q:$T
     168 S X=+$P(^HLCS(870,HLDP,0),U,5),$P(^(0),U,5)=$S(Y:X+1,1:X-1)_" server"
    211169 ;if incrementing, set the Device Type field to Multi-Server
    212  ; I X S HLJ(870,HLDP_",",3)="MS" D FILE^HLDIE("","HLJ","","UPDT","HLCSTCP")
    213  I $P(^HLCS(870,HLDP,0),"^",4)']"" S $P(^HLCS(870,HLDP,0),"^",4)="MS"
    214  ; HL*1.6*122 end
    215  ;
     170 I X S HLJ(870,HLDP_",",3)="MS" D FILE^HLDIE("","HLJ","","UPDT","HLCSTCP") ;HL*1.6*109
    216171 L -^HLCS(870,HLDP,0)
    217172 Q
     
    230185 N P,X
    231186 S P=$S(Y<3:"IN",1:"OUT")_" QUEUE "_$S(Y#2:"BACK",1:"FRONT")_" POINTER"
    232  ; patch HL*1.6*122 start
    233  ; F  L +^HLCS(870,DP,P):2 Q:$T
    234  ; S X=+$G(^HLCS(870,DP,P)),^(P)=X+$S($G(Z):-1,1:1)
    235  I '$L($G(OS)) N OS S OS=$G(^%ZOSF("OS"))
    236  I OS'["DSM",OS'["OpenM" D
    237  . F  L +^HLCS(870,DP,P):10 Q:$T  H 1
    238  . S X=+$G(^HLCS(870,DP,P)),^(P)=X+$S($G(Z):-1,1:1)
    239  . L -^HLCS(870,DP,P)
    240  E  D
    241  . S X=$I(^HLCS(870,DP,P),$S($G(Z):-1,1:1))
    242  ; L -^HLCS(870,DP,P)
    243  ; patch HL*1.6*122 end
     187 F  L +^HLCS(870,DP,P):2 Q:$T
     188 S X=+$G(^HLCS(870,DP,P)),^(P)=X+$S($G(Z):-1,1:1)
     189 L -^HLCS(870,DP,P)
    244190 Q
    245191SDFLD ; set Shutdown? field to yes
    246192 Q:'$G(HLDP)
    247  ; HL*1.6*122 remove unnecessary lock and call to FM
    248  S $P(^HLCS(870,HLDP,0),U,15)=1
    249  ;N HLJ,X
    250  ;F  L +^HLCS(870,HLDP,0):2 Q:$T
     193 N HLJ,X
     194 F  L +^HLCS(870,HLDP,0):2 Q:$T
    251195 ;14=Shutdown LLP?
    252  ;S HLJ(870,HLDP_",",14)=1
    253  ;D FILE^HLDIE("","HLJ","","SDFLD","HLCSTCP") ;HL*1.6*109
    254  ;L -^HLCS(870,HLDP,0)
    255  Q
    256  ;
    257 EXITS(Y) ; shutdown and clean up the listener process for either
    258  ; single-threaded or multi-threaded
     196 S HLJ(870,HLDP_",",14)=1
     197 D FILE^HLDIE("","HLJ","","SDFLD","HLCSTCP") ;HL*1.6*109
     198 L -^HLCS(870,HLDP,0)
     199 Q
     200 ;
     201EXITS(Y) ; Single service shutdown and cleans up
    259202 N HLJ,X
    260203 F  L +^HLCS(870,HLDP,0):2 Q:$T
     
    266209 L -^HLCS(870,HLDP,0)
    267210 I $D(ZTQUEUED) S ZTREQ="@"
    268  ; HL*1.6*122
    269  L -^HLCS("HLTCPLINK",HLDP)
    270211 Q
    271212 ;
    272213EXITM ;Multiple service shutdown and clean up
    273  ; shutdown and clean up a connection spawned by the listener
    274  ; process for a multi-threaded listener
    275214 D UPDT(0)
    276215 I $D(ZTQUEUED) S ZTREQ="@"
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP1.m

    r628 r636  
    1 HLCSTCP1 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;10/17/2007  12:59
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,64,71,133,132,122**;OCT 13,1995;Build 14
     1HLCSTCP1 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;7/28/07  08:58
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,64,71,133,132,122**;OCT 13,1995;Build 4
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;Receiver
     
    1212 ; variable to replace ^TMP
    1313 N HLTMBUF
    14  ;
    1514 ; for HL7 application proxy user
    16  ;; N HLDUZ,DUZ  ; patch HL*1.6*122 TEST v2: DUZ code removed
    17  N HLDUZ
    18  S HLDUZ=+$G(DUZ)
    19  ;
     15 N HLDUZ,DUZ
    2016 D MON^HLCSTCP("Open")
    2117 ; K ^TMP("HLCSTCP",$J,0)
    2218 S HLMIEN=0,HLASTMSG=""
    23  ;
    24  ; patch HL*1.6*122 TEST v2: DUZ code removed
    2519 ; set DUZ for application proxy user
    26  ;; D PROXY^HLCSTCP4
    27  ;
     20 D PROXY^HLCSTCP4
    2821 F  D  Q:$$STOP^HLCSTCP  I 'HLMIEN D MON^HLCSTCP("Idle") H 3
    2922 . ; clean variables
     
    3124 . S HLMIEN=$$READ
    3225 . Q:'HLMIEN
    33  . ;
    34  . ; patch HL*1.6*122 TEST v2: DUZ code removed
    3526 . ; DUZ comparison/reset for application proxy user
    36  . ;; D HLDUZ^HLCSTCP4
    37  . D HLDUZ2^HLCSTCP4
     27 . D HLDUZ^HLCSTCP4
    3828 . ; protect HLDUZ
    3929 . N HLDUZ
     
    112102 . I HLBUFF[HLDEND,(HLBUFF("END")=0) S HLBUFF("END")=1
    113103 ; detect disconnect for GT.M
    114  I $G(^%ZOSF("OS"))["GT.M",$DEVICE S $ECODE=",UREAD,"
     104 I $G(^%ZOSF("OS"))["GT.M",$DEVICE S $ECODE=""
    115105 ; timedout, <clean up>, quit
    116106 ;I '$T,X="",HLX="" S HLACKWT=HLACKWT-HLDREAD D:HLACKWT<0&'HLHDR CLEAN Q
     
    244234SAVE(SRC,DEST) ;save into global & set top node
    245235 ;SRC=source array (passed by ref.), DEST=destination global
    246  ;
    247  ; patch HL*1.6*122: MPI-client/server
    248  I DEST["HLMA" D
    249  . F  L +^HLMA(+HLIND1):10 Q:$T  H 1
    250  E  D
    251  . F  L +^HL(772,+$P(HLIND1,U,2)):10 Q:$T  H 1
    252  ;
    253236 M @DEST=SRC
    254237 S @DEST@(0)="^^"_HLINE_"^"_HLINE_"^"_DT_"^"
    255  ;
    256  I DEST["HLMA" L -^HLMA(+HLIND1)
    257  E  L -^HL(772,+$P(HLIND1,U,2))
    258  ;
    259238 Q
    260239 ;
     
    277256 ;
    278257ERROR ; Error trap for disconnect error and return back to the read loop.
    279  ; patch HL*1.6*122
    280  ; move to routine HLCSTCP4 (splitted-size over 10000)
    281  D ERROR1^HLCSTCP4
     258 S $ETRAP="D UNWIND^%ZTER"
     259 I $$EC^%ZOSV["IOEOF" D UNWIND^%ZTER Q  ;VOE change for GT.M
     260 I $$EC^%ZOSV["READ"!($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D UNWIND^%ZTER Q
     261 I $$EC^%ZOSV["WRITE" D CC("Wr-err") D UNWIND^%ZTER Q
     262 I $ECODE["UREAD" D UNWIND^%ZTER Q  ; HL*1.6*122 GT.M
     263 S HLCSOUT=1 D ^%ZTER,CC("Error")
     264 D UNWIND^%ZTER
    282265 Q
    283266 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP2.m

    r628 r636  
    1 HLCSTCP2 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;10/17/2007  09:37
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,63,64,66,67,76,77,87,109,133,122**;Oct 13,1995;Build 14
     1HLCSTCP2 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,63,64,66,67,76,77,87,109,133**;Oct 13,1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;Sender
     
    1111 S HLTCPO=HLDP,HLMSG="",(HLRETRY,HLRETMG)=0
    1212 ;
    13  ; patch 122
    14  ; patch 133
    15  ; set IO(0) to the null device
    16  I $G(^%ZOSF("OS"))]"",^%ZOSF("OS")'["GT.M" D
    17  . S IO(0)=$S(^%ZOSF("OS")["OpenM":$S($$OS^%ZOSV()["VMS":"_NLA0:",$$OS^%ZOSV()["UNIX":"/dev/null",1:$P),^%ZOSF("OS")["DSM":"_NLA0:",1:$P)
    18  . O IO(0) U IO(0)
     13 ;set IO(0) to the null device
     14 S IO(0)=$S(^%ZOSF("OS")["OpenM":$S($$OS^%ZOSV()["VMS":"_NLA0:",$$OS^%ZOSV()["UNIX":"/dev/null",1:$P),^%ZOSF("OS")["DSM":"_NLA0:",1:$P)
     15 O IO(0) U IO(0)
    1916 ;
    2017 ;persistent conection, open connection first, HLPORT=open port
     
    3936 ; and then check the link if it open or not
    4037 N HL,HLN,HLARR,HLHDR,HLI,HLJ,HLMSA,HLRESP,HLRESLT,HLRETRM,HLTCP,HLTCPI,X,Z,HLREREAD
    41  N HLTMBUF
    42  D MON^HLCSTCP("CheckOut")
     38 D MON^HLCSTCP("Check out")
    4339 ;HLMSG=next msg, set at tag DONE
    4440 I 'HLMSG S HLMSG=+$O(^HLMA("AC","O",HLDP,0)),HLRETRY=0 Q:'HLMSG
    4541 ;
     42 ;**109**
     43 ;Temporarily lock ^HLMA to flush buffer and ensure edits are complete
     44 ;L +^HLMA(HLMSG):1 I '$T S HLMSG=0 Q
     45 ;L -^HLMA(HLMSG)
     46 ;
    4647 S HLI=+$G(^HLMA(HLMSG,0)),HLJ=$O(^("MSH",0)),HLTCP=""
    4748 ;don't have message text or MSH, kill x-ref and decrement 'to send'
    48  ;
    49  ; patch HL*1.6*122: MPI-client/server
    50  ; I 'HLI!'HLJ K ^HLMA("AC","O",HLDP,HLMSG) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
    51  I 'HLI!'HLJ D  Q
    52  . F  L +^HLMA("AC","O",HLDP,HLMSG):10 Q:$T  H 1
    53  . K ^HLMA("AC","O",HLDP,HLMSG)
    54  . L -^HLMA("AC","O",HLDP,HLMSG)
    55  . D LLCNT^HLCSTCP(HLDP,3,1)
    56  . S HLMSG=0
    57  ;
     49 I 'HLI!'HLJ K ^HLMA("AC","O",HLDP,HLMSG) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
    5850 ;update msg status to 'being transmitted'; if cancelled decrement link and quit
    5951 I '$$CHKMSG(1.5) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
     
    153145 ; Set up error trap
    154146 N $ETRAP,$ESTACK S $ETRAP="D ERROR^HLCSTCP2"
    155  ; patch HL*1.6*122
    156  N HLTMBUF
    157147 ;override ack timeout
    158148 I $G(HLP("ACKTIME")) N HLDBACK S HLDBACK=HLP("ACKTIME")
     
    179169 D STATUS^HLTF0(HLMSG,ST,$G(ERR),$G(ERRMSG),1)
    180170 ;
     171 ;**109**
    181172 D DEQUE^HLCSREP(HLDP,"O",HLMSG)
    182173 ;
     
    189180 ;returns 1=msg was updated, 0=msg has been canceled
    190181 N X
     182 ;
     183 ;**109**
     184 ;F  L +^HLMA(HLMSG,"P"):1 Q:$T  H 1
     185 ;
    191186 ;
    192187 ; New HL*1.6*77 code starting here...
     
    195190 .  D STATUS^HLTF0(HLMSG,4,$P(HLERROR,U),$P(HLERROR,U,2),1)
    196191 .;
     192 .;**109**
    197193 . D DEQUE^HLCSREP(HLDP,"O",HLMSG)
    198  ;
    199  ; End of HL*1.6*77
     194 .;L -^HLMA(HLMSG,"P")
     195 ;**end 109**
     196 ;
     197 ; End of HL*1.6*77 modifications
    200198 ;
    201199 ;get status, quit if msg was cancelled
    202200 ;
     201 ;**109**
     202 ;S X=+^HLMA(HLMSG,"P") I X=3 L -^HLMA(HLMSG,"P") Q 0
    203203 S X=+^HLMA(HLMSG,"P") Q:X=3 0
    204204 ;
    205205 ;update status if it is different
    206206 I $G(HLI),HLI'=X D STATUS^HLTF0(HLMSG,HLI)
     207 ;
     208 ;**109**
     209 ;L -^HLMA(HLMSG,"P")
    207210 ;
    208211 Q 1
     
    216219 ;           -1 - Unsuccessful
    217220 ;
    218  N HLDA2,HLAR,HLI,LINENO,X,CRCOUNT
    219  S CRCOUNT=0
     221 N HLDA2,HLAR,HLI,LINENO,X
    220222 ;set error trap, used when called from HLTP3
    221223 ;
     
    235237 .. ;first line, need start block char.
    236238 .. S:LINENO=1 X=$C(11)_X
    237  .. ; HL*1.6*122
    238  .. ; I X]"" W X,!
    239  .. N LENGTH
    240  .. S LENGTH=$L(X)
    241  .. ; buffer should be limited to 512
    242  .. I LENGTH>512 D
    243  ... N X1
    244  ... F  Q:LENGTH<512  D
    245  .... S X1=$E(X,1,512),X=$E(X,513,999999)
    246  .... S LENGTH=$L(X)
    247  .... W X1,@IOF
    248  .. ;
    249  .. ; @IOF (! or #) for flush character
    250  .. I X]"" W X,@IOF S CRCOUNT=0
    251  .. ;send CR
    252  .. I X="" W $C(13) S CRCOUNT=CRCOUNT+1
    253  .. ; prevent from maxstring error
    254  .. I CRCOUNT>200 W @IOF S CRCOUNT=0
     239 .. I X]"" W X,!
     240 .. ;send CR for blank lines
     241 .. I X="" W $C(13)
    255242 .. S LINENO=LINENO+1
    256243 ; Sends end block for this message
    257244 S X=$C(28)_$C(13)
    258  ; U IO W X,!
    259  U IO W X,@IOF
    260  ;switch to null device
    261  I $G(IO(0))'="",$G(IO(0))'=IO U IO(0)
     245 U IO W X,!
     246 I $G(IO(0))'="",$G(IO(0))'=IO U IO(0) ;switch to null device if opened to prevent 'leakage'
    262247 Q 1
    263248 ;
     
    271256 G OPENA^HLCSTCP3
    272257 ;
    273 RDERR D RDERR^HLCSTCP4 Q
    274 ERROR D ERROR^HLCSTCP4 Q
     258RDERR D RDERR^HLCSTCP4 Q  ; Exceeded 10,000 bytes, so split on 12/2/03-LJA
     259ERROR D ERROR^HLCSTCP4 Q  ; Exceeded 10,000 bytes, so split on 12/2/03-LJA
    275260 ;
    276261CC(X) ;cleanup and close
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP3.m

    r628 r636  
    1 HLCSTCP3 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ; 09/13/2006  15:36
    2  ;;1.6;HEALTH LEVEL SEVEN;**76,77,133,122**;OCT 13, 1995;Build 14
     1HLCSTCP3 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**76,77,133**;OCT 13, 1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
    5 OPENA ;
    6  ; called from $$OPEN^HLCSTCP2 and this sub-routine OPENA
    7  ;
    8  I $G(HLMSG),$D(^HLMA(HLMSG,"P")) S HLPORTA=+$P(^("P"),U,6)
     5OPENA I $G(HLMSG),$D(^HLMA(HLMSG,"P")) S HLPORTA=+$P(^("P"),U,6)
     6 D MON^HLCSTCP("Open")
    97 S POP=1
    10  ;
    11  ; patch HL*1.6*122 start
    12  ; variable HLDRETR=re-transmit attemps (#870,200.02)
    13  ; variable HLTCPLNK("TIMEOUT")=timeout for 3rd parameter of CALL^%ZISTCP()
    14  ; defined in HLCSTCP routine
    15  ;
    16  I '$G(HLDRETR("COUNT")) S HLDRETR("COUNT")=1
    17  I '$G(HLTCPLNK("TIMEOUT")) S HLTCPLNK("TIMEOUT")=5
    18  S HLDRETR("COUNT-2")=HLDRETR("COUNT")+HLDRETR
    19  ; patch 133
    20  ; I $G(HLDIRECT("OPEN TIMEOUT")) D
    21  ; .S HLI=1
    22  ; .D CALL^%ZISTCP(HLTCPADD,HLTCPORT,HLDIRECT("OPEN TIMEOUT"))
    23  ; E  D
    24  ; .F HLI=1:1:HLDRETR D CALL^%ZISTCP(HLTCPADD,HLTCPORT) Q:'POP
    258 I $G(HLDIRECT("OPEN TIMEOUT")) D
    26  . D MON^HLCSTCP("Open")
    27  . D CALL^%ZISTCP(HLTCPADD,HLTCPORT,HLDIRECT("OPEN TIMEOUT"))
    28  . ; give site one more chance to override the application setup
    29  . I $G(POP),(HLTCPLNK("TIMEOUT")>HLDIRECT("OPEN TIMEOUT")) D
    30  .. D CALL^%ZISTCP(HLTCPADD,HLTCPORT,HLTCPLNK("TIMEOUT"))
     9 .S HLI=1
     10 .D CALL^%ZISTCP(HLTCPADD,HLTCPORT,HLDIRECT("OPEN TIMEOUT"))
    3111 E  D
    32  . N COUNT
    33  . ; try to connect HLDRETR times
    34  . F HLDRETR("COUNT")=HLDRETR("COUNT"):1:HLDRETR("COUNT-2") D  Q:('POP)!($$STOP^HLCSTCP)
    35  .. D MON^HLCSTCP("Open")
    36  .. ; D CALL^%ZISTCP(HLTCPADD,HLTCPORT)
    37  .. D CALL^%ZISTCP(HLTCPADD,HLTCPORT,HLTCPLNK("TIMEOUT"))
    38  .. ;open error
    39  .. I POP D
    40  ... D CC^HLCSTCP2("Openfail")
    41  ... H $S(HLDRETR("COUNT")=1:0,HLDRETR("COUNT")<10:1,1:8)
    42  ... I '$D(^XTMP("HL7-Openfail",$J)) D
    43  .... S ^XTMP("HL7-Openfail",0)=$$FMADD^XLFDT($$NOW^XLFDT,3)_"^"_$$NOW^XLFDT
    44  .... S ^XTMP("HL7-Openfail",$J,"COUNT","FIRST")=HLDRETR("COUNT")_"^"_$$NOW^XLFDT
    45  ... S COUNT=$P($G(^XTMP("HL7-Openfail",$J,"COUNT","LAST")),"^")+1
    46  ... S ^XTMP("HL7-Openfail",$J,"COUNT","LAST")=COUNT_"^"_$$NOW^XLFDT
    47  ;
     12 .F HLI=1:1:HLDRETR D CALL^%ZISTCP(HLTCPADD,HLTCPORT) Q:'POP
    4813 ;set # of opens back in msg
    49  ; I $G(HLMSG),$D(^HLMA(HLMSG,"P")) S $P(^("P"),U,6)=HLPORTA+HLI
    50  I $G(HLMSG),$D(^HLMA(HLMSG,"P")) S $P(^("P"),U,6)=HLDRETR("COUNT")
    51  ; patch HL*1.6*122 end
    52  ;
     14 I $G(HLMSG),$D(^HLMA(HLMSG,"P")) S $P(^("P"),U,6)=HLPORTA+HLI
    5315 ;device open
    5416 I 'POP S HLPORT=IO D  Q $S($G(HLERROR)]"":0,1:1)
     
    6123 . U IO W "HELO "_$$KSP^XUPARAM("WHERE"),! R X:1
    6224 ;openfail-try DNS lookup
    63  ;
    64  ; patch HL*1.6*122 start
    65  ;I '$D(HLDOM) S HLDOM=+$P(^HLCS(870,HLDP,0),U,7),HLDOM=$P($G(^DIC(4.2,HLDOM,0)),U) D:HLDOM]"" DNS
    66  I '$D(HLDOM) D
    67  . S HLDOM=+$P(^HLCS(870,HLDP,0),U,7),HLDOM=$P($G(^DIC(4.2,HLDOM,0)),U)
    68  . S HLDOM("DNS")=$P($G(^HLCS(870,+$G(HLDP),0)),"^",8)
    69  . D:HLDOM]""!($L(HLDOM("DNS"),".")>2) DNS
    70  ;
    71  Q:$$STOP^HLCSTCP 0
     25 I '$D(HLDOM) S HLDOM=+$P(^HLCS(870,HLDP,0),U,7),HLDOM=$P($G(^DIC(4.2,HLDOM,0)),U) D:HLDOM]"" DNS
    7226 ;HLIP=ip add. from DNS call, get first one and try open again
    7327 I $D(HLIP) S HLTCPADD=$P(HLIP,","),HLIP=$P(HLIP,",",2,99) G:HLTCPADD OPENA
    74  ; open error
    75  ;cleanup and close
    76  ; patch 133
     28 ;open error
    7729 I $G(HLDIRECT("OPEN TIMEOUT")) D
    78  . D MON^HLCSTCP("Openfail")
    79  . I $D(HLPORT) D CLOSE^%ZISTCP K HLPORT
     30 .D MON^HLCSTCP("Openfail")
     31 .I $D(HLPORT) D CLOSE^%ZISTCP K HLPORT
    8032 E  D
    81  . D CC^HLCSTCP2("Openfail")
     33 .D CC^HLCSTCP2("Openfail") H 3
    8234 Q 0
    83  ; patch HL*1.6*122 end
    84  ;
    8535 ;
    8636 ;following code was removed, site's complained of to many alerts
     
    10757 I HLTCPORT=5000 S HLDOM="HL7."_HLDOM
    10858 I HLTCPORT=5500 S HLDOM="MPI."_HLDOM
    109  ;
    110  ; patch HL*1.6*122 start
    111  I $L($G(HLDOM("DNS")),".")>2 D
    112  . S HLDOM=HLDOM("DNS")
    113  ; patch HL*1.6*122 end
    114  ;
    11559 S HLIP=$$ADDRESS^XLFNSLK(HLDOM)
    11660 K:HLIP="" HLIP
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP4.m

    r628 r636  
    1 HLCSTCP4 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;10/18/2007  09:56
    2  ;;1.6;HEALTH LEVEL SEVEN;**109,122**;Oct 13,1995;Build 14
     1HLCSTCP4 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;11/03/2006  13:31
     2 ;;1.6;HEALTH LEVEL SEVEN;**109,122**;Oct 13,1995;Build 4
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    1515 ;I $G(HLMSG) L -^HLMA(HLMSG)
    1616 ;
    17  ; patch HL*1.6*122 start
    18  N STOP
    19  S STOP=0
    20  I $G(HLDP) S STOP=$$STOP^HLCSTCP
    2117 S $ETRAP="D UNWIND^%ZTER"
    22  S HLTCP("$ZA\8192#2")=""
    23  I (^%ZOSF("OS")["OpenM") D
    24  . S HLTCP("$ZA")=$ZA
    25  . ; For TCP devices $ZA\8192#2: the device is currently in the
    26  . ; Connected state talking to a remote host.
    27  . S HLTCP("$ZA\8192#2")=$ZA\8192#2
    28  ;
     18 ; patch HL*1.6*122
     19 S HLTCPERR("$P")=$P
    2920 S HLTCPERR("ERR-$ZE")=$$EC^%ZOSV
    3021 ; I $$EC^%ZOSV["OPENERR"!($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D CC^HLCSTCP2("Op-err") S:$G(HLPRIO)="I" HLERROR="15^Open Related Error" D UNWIND^%ZTER Q
    31  I $$EC^%ZOSV["OPENERR"!($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D  G:STOP H2^XUSCLEAN Q
    32  . D CC^HLCSTCP2("Op-err") H 1
     22 I $$EC^%ZOSV["OPENERR"!($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D  Q
     23 . D CC^HLCSTCP2("Op-err")
    3324 . S:$G(HLPRIO)="I" HLERROR="15^Open Related Error"
    34  . I STOP D  Q
    35  .. D CC^HLCSTCP2("Shutdown: (with 'Op-err')")
    36  . I 'STOP D UNWIND^%ZTER
    37  I $$EC^%ZOSV["WRITE" D  G:STOP!(HLTCP("$ZA\8192#2")=0) H2^XUSCLEAN Q
    38  . D CC^HLCSTCP2("Wr-err") H 1
    39  . S:$G(HLPRIO)="I" HLERROR="108^Write Error"
    40  . I STOP D  Q
    41  .. D CC^HLCSTCP2("Shutdown: (with 'Wr-err')")
    42  . I HLTCP("$ZA\8192#2")=0 D  Q
    43  .. D CC^HLCSTCP2("Halt (Wr): (Disconnected with 'Wr-err')")
    44  . I 'STOP,HLTCP("$ZA\8192#2") D UNWIND^%ZTER
     25 . D UNWIND^%ZTER
     26 I $$EC^%ZOSV["WRITE" D  Q  ;HL*1.6*77 modifications start here
     27 .  D CC^HLCSTCP2("Wr-err")
     28 .  S:$G(HLPRIO)="I" HLERROR="108^Write Error"
     29 .  D UNWIND^%ZTER ;HL*1.6*77 modifications end here
    4530 ; I $$EC^%ZOSV["READ" D CC^HLCSTCP2("Rd-err") S:$G(HLPRIO)="I" HLERROR="108^Read Error" D UNWIND^%ZTER Q
    46  I $$EC^%ZOSV["READ" D  G:STOP!(HLTCP("$ZA\8192#2")=0) H2^XUSCLEAN Q
    47  . D CC^HLCSTCP2("Rd-err") H 1
     31 I $$EC^%ZOSV["READ" D  Q
     32 . D CC^HLCSTCP2("Rd-err")
    4833 . S:$G(HLPRIO)="I" HLERROR="108^Read Error"
    49  . I STOP D  Q
    50  .. D CC^HLCSTCP2("Shutdown: (with 'Rd-err')")
    51  . I HLTCP("$ZA\8192#2")=0 D  Q
    52  .. D CC^HLCSTCP2("Halt (Rd): (Disconnected with 'Rd-err')")
    53  . I 'STOP,HLTCP("$ZA\8192#2") D UNWIND^%ZTER
     34 . D UNWIND^%ZTER
    5435 S HLCSOUT=1 D ^%ZTER,CC^HLCSTCP2("Error"),SDFLD^HLCSTCP
    5536 S:$G(HLPRIO)="I" HLERROR="9^Error"
    56  I STOP D CC^HLCSTCP2("Shutdown: (with 'Error')")
    57  I HLTCP("$ZA\8192#2")=0 D
    58  . D CC^HLCSTCP2("Halt (Er): (Disconnected with 'Error')")
    59  G:STOP!(HLTCP("$ZA\8192#2")=0) H2^XUSCLEAN
    60  ; patch HL*1.6*122 end
    6137 D UNWIND^%ZTER
    6238 Q
    6339 ;
    6440PROXY ; set DUZ for application proxy user
    65  ;
    66  ; removed the execcution: patch 122 TEST v2
     41 S HLDUZ=+$$APFIND^XUSAP("HLSEVEN,APPLICATION PROXY")
     42 S DUZ=HLDUZ
     43 D DUZ^XUP(DUZ)
    6744 Q
    6845 ;
    69  ;; S HLDUZ=+$$APFIND^XUSAP("HLSEVEN,APPLICATION PROXY")
    70  ;; S DUZ=HLDUZ
    71  ;; D DUZ^XUP(DUZ)
    72  ;; Q
    73  ;
    7446HLDUZ ; compare DUZ and set DUZ to application proxy user
    75  ;
    76  ; removed the execcution: patch 122 TEST v2
    77  Q
    78  ;
    79  ;; I '$G(HLDUZ) D PROXY
    80  ;
    81 HLDUZ2 ; compare DUZ and HLDUZ
     47 I '$G(HLDUZ) D PROXY
    8248 I $G(DUZ)'=HLDUZ D
    8349 . S DUZ=HLDUZ
     
    12187 I HLIND1 D  Q
    12288 . ;get pointer to 772, kill header
    123  . ;
    124  . ; patch HL*1.6*122: MPI-client/server
    125  . F  L +^HLMA(+HLIND1):10 Q:$T  H 1
    12689 . K ^HLMA(+HLIND1,"MSH")
    127  . L -^HLMA(+HLIND1)
    128  . ;
    12990 . I $D(^HL(772,+$P(HLIND1,U,2),"IN")) K ^("IN")
    13091 . S X=$$MAID^HLTF(+HLIND1,HLMID)
     
    155116 Q X
    156117 ;
    157 ERROR1 ;
    158  ; moved from ERROR^HLCSTCP1
    159  ; Error trap for disconnect error and return back to the read loop.
    160  ; patch HL*1.6*122 start
    161  I (^%ZOSF("OS")["OpenM") D
    162  . S HLTCP("$ZA")=$ZA
    163  . ; For TCP devices $ZA\8192#2: the device is currently in the
    164  . ; Connected state talking to a remote host.
    165  . S HLTCP("$ZA\8192#2")=$ZA\8192#2
    166  . I HLTCP("$ZA\8192#2")=0 D
    167  .. ; decrement counter of multi-listener
    168  .. I $D(^HLCS(870,"E","M",+$G(HLDP))) D EXITM^HLCSTCP
    169  .. ; process terminated
    170  .. D H2^XUSCLEAN
    171  S $ETRAP="D UNWIND^%ZTER"
    172  ; I $$EC^%ZOSV["READ"!($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D UNWIND^%ZTER Q
    173  I ($$EC^%ZOSV["NOTOPEN")!($$EC^%ZOSV["DEVNOTOPN") D  Q
    174  . ; if it is not a multi-listener
    175  . I '$D(^HLCS(870,"E","M",+$G(HLDP))) D CC^HLCSTCP1("Open-err")
    176  . D UNWIND^%ZTER
    177  I $$EC^%ZOSV["READ" D  Q
    178  . ; if it is not a multi-listener
    179  . I '$D(^HLCS(870,"E","M",+$G(HLDP))) D CC^HLCSTCP1("Rd-err")
    180  . D UNWIND^%ZTER
    181  ;
    182  ; I $$EC^%ZOSV["WRITE" D CC("Wr-err") D UNWIND^%ZTER Q
    183  I $$EC^%ZOSV["WRITE" D  Q
    184  . ; if it is not a multi-listener
    185  . I '$D(^HLCS(870,"E","M",+$G(HLDP))) D CC^HLCSTCP1("Wr-err")
    186  . D UNWIND^%ZTER
    187  ;
    188  ; for GT.M
    189  I $ECODE["UREAD" D  Q
    190  . ; if it is not a multi-listener
    191  . I '$D(^HLCS(870,"E","M",+$G(HLDP))) D CC^HLCSTCP1("Rd-err")
    192  . D UNWIND^%ZTER
    193  ;
    194  ; S HLCSOUT=1 D ^%ZTER,CC("Error")
    195  S HLCSOUT=1
    196  D ^%ZTER
    197  ; if it is not a multi-listener
    198  I '$D(^HLCS(870,"E","M",+$G(HLDP))) D CC^HLCSTCP1("Error")
    199  ; patch HL*1.6*122 end
    200  ;
    201  D UNWIND^%ZTER
    202  Q
    203  ;
    204 CLRMCNTR ;
    205  ; clear the counter to set as "0 server" for multi-listener
    206  ; HL*1.6*122 start
    207  Q:'$G(HLDP)
    208  Q:'$D(^HLCS(870,"E","M",HLDP))
    209  S $P(^HLCS(870,HLDP,0),"^",4)="MS"
    210  S $P(^HLCS(870,HLDP,0),U,5)="0 server"
    211  Q
    212  ;
    213 CREATUSR ;
    214  ; patch HL*1.6*122 TEST v2: DUZ code removed
    215  ; create application proxy users for listeners and incoming filer
    216  ;; N HLTEMP
    217  ;; S HLTEMP=$$CREATE^XUSAP("HLSEVEN,APPLICATION PROXY","#")
    218  Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCPA.m

    r628 r636  
    1 HLCSTCPA ;OIFO-O/RJH - (TCP/IP) VMS ;07/26/2007  10:29
    2  ;;1.6;HEALTH LEVEL SEVEN;**84,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLCSTCPA ;OIFO-O/RJH - (TCP/IP) VMS ;07/10/2003  10:12
     2 ;;1.6;HEALTH LEVEL SEVEN;**84**;Oct 13, 1995
    43 ;
    5  ; 1. port number is input from VMS COM file, such as HLSxxxxDSM.COM,
    6  ;    HLSxxxxCACHE.COM, or HLSxxxxGTM.COM file, where xxxx is port
    7  ;    number.
    8  ; 2. find the ien of #870(logical link file) for the multi-listener
     4 ; 1. port number is input from VMS HLSxxxxDSM.COM or HLSxxxxCACHE.COM
     5 ;    file, where xxxx is port number.
     6 ; 2. find the ien of #870(logical link file) for the HL7 multi-listener
     7 ; 3. call the appropriate entry:
     8 ;    for Cache: CACHEVMS^HLCSTCP(ien of #870)
     9 ;    for DSM:   EN^HLCSTCP
    910 Q
     11PORT ;
     12 ;HLIEN870: ien in #870 (logical link file)
     13 ;HLPORT: port number of multi-listener
     14 ;HLPRTS: port number in entry to be tested
     15 ;input of DSM: % = device^port number of multi-listener
     16 ;input of Cache: port number of TCPIP
    1017 ;
    11 GTMPORT(%) ; From tcpip ZFOO for GT.M
    12  ; %: device^port number
    13  N HLPORT
    14  S HLPORT=$P($G(%),"^",2)
    15  I $G(^%ZOSF("OS"))'["GT.M" D ^%ZTER Q
    16  D IEN
    17  Q
    18  ;
    19 PORT ;
    20  ; HLPORT: port number of multi-listener
    21  ; input of DSM: % = device^port number of multi-listener
    22  ; input of Cache: port number of TCPIP
    23  ;
    24  N HLPORT
    25  S HLPORT=0
    2618 I ^%ZOSF("OS")["OpenM" D
    2719 . S HLPORT=$ZF("GETSYM","PORT")
    2820 I ^%ZOSF("OS")["DSM" D
    2921 . S HLPORT=$P(%,"^",2)
    30  ;
    31 IEN ;
    32  ; HLIEN870: ien in #870 (logical link file)
    33  ; HLPRTS: port number in entry to be tested
    34  ;
    35  N HLIEN870
    3622 I 'HLPORT D ^%ZTER Q
    3723 S HLIEN870=0
     
    4127 ;
    4228 K HLPORT,HLPRTS
    43  ; patch 122
    44  S U="^"
    4529 ;
    4630 ;for Cache/VMS
    4731 I ^%ZOSF("OS")["OpenM" D  Q
    48  . D CACHEVMS(HLIEN870)
     32 .D CACHEVMS^HLCSTCP(HLIEN870)
    4933 ;
    5034 ;for DSM
     
    5236 . S $P(%,"^",2)=HLIEN870   ;set % = device^ien of #870
    5337 . K HLIEN870
    54  . D EN
    55  ;
    56  ;for GT.M
    57  I ^%ZOSF("OS")["GT.M" D  Q
    58  . S HLDP=HLIEN870   ;set HLDP = ien of #870
    59  . K HLIEN870
    60  . D GTMUCX
     38 . D EN^HLCSTCP
    6139 ;
    6240 D ^%ZTER
    6341 Q
    64 GTMUCX ; GT.M /VMS tcpip
    65  ;listener,  % = device^port
    66  S U="^",IO=$P(%,U)
    67  ; S IO(0)=$P O IO(0) ;Setup null device
    68  ; GTM specific code
    69  S @("$ZINTERRUPT=""I $$JOBEXAM^ZU($ZPOSITION)""")
    70  X "O IO:(RECORDSIZE=512)"
    71  D LISTEN^HLCSTCP
    72  C IO
    73  Q
    74  ;
    75  ; $ x=f$trnlnm("sys$net")  !This is our MBX device
    76  ; $!
    77  ; $! for GT.M
    78  ; $ assign 'f$trnlnm("SYS$NET")' SYS$NET
    79  ; $! Depending on how your command files are set up, you may need to
    80  ; $! run the GT.M profile file.
    81  ; $ @<user$:[gtmmgr]>gtmprofile.com
    82  ; $ forfoo="$" + f$parse("user$:[gtmmgr.r]ZFOO.exe")
    83  ; $ PORT=5000
    84  ; $ data="''x'^''PORT'"
    85  ; $ forfoo GTMPORT^HLCSTCPA("''data'")
    86  ;
    87 CACHEVMS(%) ;Cache'/VMS tcpip
    88  ;listener,  % = HLDP
    89  I $G(%)="" D ^%ZTER Q
    90  ; patch 133
    91  S IO="SYS$NET",U="^",HLDP=%
    92  S IO(0)="_NLA0:" O IO(0) ;Setup null device
    93  ; **Cache'/VMS specific code**
    94  O IO::5 E  D MON^HLCSTCP("Openfail") Q
    95  X "U IO:(::""-M"")" ;Packet mode like DSM
    96  D LISTEN^HLCSTCP
    97  C IO
    98  Q
    99  ;
    100 EN ; DSM/VMS tcpip
    101  ;listener,  % = device^HLDP
    102  I $G(%)="" D ^%ZTER Q
    103  ; patch 122
    104  ; S IO="SYS$NET",U="^",HLDP=$P(%,U,2)
    105  S U="^",IO=$P(%,U),HLDP=$P(%,U,2)
    106  ; patch 133
    107  S IO(0)="_NLA0:" O IO(0) ;Setup null device
    108  ; **VMS specific code, need to share device**
    109  O IO:(TCPDEV):60 E  D MON^HLCSTCP("Openfail") Q
    110  ; patch 122
    111  D LISTEN^HLCSTCP
    112  C IO
    113  Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTERM.m

    r628 r636  
    1 HLCSTERM ;ALB/RJS - SET UP VIDEO ATTRIBUTES ;06/27/2007  17:04
    2  ;;1.6;HEALTH LEVEL SEVEN;**40,49,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     1HLCSTERM ;ALB/RJS - SET UP VIDEO ATTRIBUTES - 8/1/94 ;07/28/98  09:43
     2 ;;1.6;HEALTH LEVEL SEVEN;**40,49**;Oct 13, 1995
    53TERM ; -- set up term characteristics
    64 N X
     
    2523 D WDATA^HLCSMON1(37,3,"","","MESSAGES",8),WDATA^HLCSMON1(37,4,IOUON,IOUOFF,"TO SEND ",8)
    2624 D WDATA^HLCSMON1(47,3,"","","MESSAGES",8),WDATA^HLCSMON1(47,4,IOUON,IOUOFF,"SENT    ",8)
    27  ; patch HL*1.6*122
    28  ; D WDATA^HLCSMON1(57,3,"","","DEVICE",8),WDATA^HLCSMON1(57,4,IOUON,IOUOFF,"TYPE   ",8)
    29  D WDATA^HLCSMON1(57,3,"","","DEVICE",8),WDATA^HLCSMON1(57,4,IOUON,IOUOFF,"TYPE   ",6)
    30  ;
     25 D WDATA^HLCSMON1(57,3,"","","DEVICE",8),WDATA^HLCSMON1(57,4,IOUON,IOUOFF,"TYPE   ",8)
    3126 D WDATA^HLCSMON1(66,4,IOUON,IOUOFF,"STATE",8)
    3227 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLDIE.m

    r628 r636  
    1 HLDIE ;CIOFO-O/LJA - Direct 772 & 773 Sets ; 10/19/2007 11:15
    2  ;;1.6;HEALTH LEVEL SEVEN;**109,122**;Oct 13,1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  Q
     1HLDIE ;CIOFO-O/LJA - Direct 772 & 773 Sets ; 11/18/2003 11:17
     2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13,1995
    53 ;
    64 ; Rules: if any of these rules is broken, FILE^DIE is called instead
     
    7573 .I FILE=772 D DEL772^HLUOPT3(+IEN)
    7674 ;
    77  ; patch HL*1.6*122: MPI-client/server
    7875 ; If no data in record passed in, log an error and quit...
    79  ; I '$D(@GBL) D  Q  ; Remember.  GBL contains IEN...
    80  N HLDGBL
    81  F  L +@GBL:10 Q:$T  H 1
    82  S HLDGBL=$D(@GBL)
    83  L -@GBL
    84  I 'HLDGBL D  Q  ; Remember.  GBL contains IEN...
     76 I '$D(@GBL) D  Q  ; Remember.  GBL contains IEN...
    8577 .  S ERRNO=$$ERRNO(601,"The entry does not exist.",FILE,2)
    8678 .  S @ERR@("DIERR",+ERRNO,"PARAM","IENS")=IEN_$S(IEN'[",":",",1:"")
     
    118110 QUIT:'$D(NODE("CHG"))  ;->
    119111 ;
    120  ; patch HL*1.6*122: MPI-client/server
    121  I FILE=773 D
    122  . F  L +^HLMA(IEN):10 Q:$T  H 1
    123  E  D
    124  . F  L +^HL(772,IEN):10 Q:$T  H 1
    125  ;
    126112 ; Store changes in the global now...
    127113 D STORE(FILE,IEN,.NODE)
     
    131117 F  S XRF=$O(XRF(XRF)) Q:XRF']""  D
    132118 .  D @("XRF"_XRF_U_ROUTINE)
    133  ;
    134  ; patch HL*1.6*122: MPI-client/server
    135  I FILE=773 L -^HLMA(IEN)
    136  E  L -^HL(772,IEN)
    137119 ;
    138120 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLFNC.m

    r628 r636  
    1 HLFNC ;AISC/SAW/OAK-OIFO/RBN-Routine of Functions and Other Calls Used for HL7 Messages  ;03/26/2008  11:34
    2  ;;1.6;HEALTH LEVEL SEVEN;**38,42,51,66,141**;Oct 13, 1995;Build 11
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     1HLFNC ;AISC/SAW-Routine of Functions and Other Calls Used for HL7 Messages ;08/03/2000  15:45
     2 ;;1.6;HEALTH LEVEL SEVEN;**38,42,51,66**;Oct 13, 1995
    53HLNAME(X,HLECDE) ;Convert a name in DHCP format to HL7 format
    64 ; INPUT: X - Name in DHCP format
     
    5553 Q $S(Y="DT":$E(%,1,8),1:%)
    5654 ;
    57 FMDATE(X) ; Convert a date, date/time or time only in HL7 format to FM format
     55FMDATE(X) ;Convert a date, date/time or time only in HL7 format to FM format
    5856 I X="" Q ""
    5957 N %
     
    160158 Q:'$D(X) ""  Q:$L(X)<7 ""
    161159 N I,Y,Y1,Z S B=$S('$D(B):"",1:"B"_B),C=$S('$D(C):"",1:"C"_C)
    162  ;
    163  ; patch HL*1.6*141 start
    164  ; S Y="" F I=1:1:$L(X) S Y=Y_$S($E(X,I)?1N:$E(X,I),"X,x"[$E(X,I)&('$D(Z)):"X",1:"") I "X,x"[$E(X,I) S Z=""
    165  N CH
    166  S Y=""
    167  F I=1:1:$L(X) D
    168  . S CH=$E(X,I)
    169  . ; Next line modified by RBN
    170  . ;S Y=Y_$S(CH?1N:CH,"Xx"[CH&('$D(Z)):"X",1:"")
    171  . S Y=Y_$S(CH?1N:CH,"Xx,*"[CH&('$D(Z)):"X",1:"")
    172  . I "Xx"[CH S Z=""
    173  ;
    174  ; the number, following "X" character, should be greater than 0
    175  I Y["X",+$P(Y,"X",2)<1 S Y=$P(Y,"X")
    176  ; patch HL*1.6*141 end
    177  ;
     160 S Y="" F I=1:1:$L(X) S Y=Y_$S($E(X,I)?1N:$E(X,I),"X,x"[$E(X,I)&('$D(Z)):"X",1:"") I "X,x"[$E(X,I) S Z=""
    178161 I $L(Y)<7 Q ""
    179162 S Y1=$S(Y["X":"X"_$P(Y,"X",2),1:""),Y=$P(Y,"X") I $L(Y)<7 Q ""
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLMA.m

    r628 r636  
    1 HLMA ;AISC/SAW-Message Administration Module ;10/24/2007  10:15
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,58,63,66,82,91,109,115,133,132,122**;Oct 13, 1995;Build 14
     1HLMA ;AISC/SAW-Message Administration Module ;10/25/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,58,63,66,82,91,109,115,133,132**;Oct 13, 1995;Build 6
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44GENERATE(HLEID,HLARYTYP,HLFORMAT,HLRESLT,HLMTIEN,HLP) ;
     
    3535 ;   HLP("CONTPTR") = Continuation pointer, a 1 to 180 character string
    3636 ; HLP("NAMESPACE") = Passed in by application namespace - HL*1.6*91
    37  ; HLP("EXCLUDE SUBSCRIBER",<n=1,2,3...>)=<subscriber protocol ien> or
    38  ;   <subscriber protocol name> - A list of protocols to dynamically
    39  ;   drop from the event protocol's subscriber multiple.
     37 ; HLP("EXLCLUDE SUBSCRIBER",<n=1,2,3...>)=<subsciber protocol ien> - A list of protocols to dynamically drop from the event protocol's subscriber multiple.
    4038 ;
    4139 ;can't have link open when generating new message
     
    4442 S HLRESLT=""
    4543 ;Check for required parameters
    46 CONT ;
    47  I $G(HLEID)']""!($G(HLARYTYP)']"")!($G(HLFORMAT)']"") D  G EXIT
    48  . S HLRESLT="0^7^"_$G(^HL(771.7,7,0))_" at GENERATE^HLMA entry point"
     44CONT I $G(HLEID)']""!($G(HLARYTYP)']"")!($G(HLFORMAT)']"") S HLRESLT="0^7^"_$G(^HL(771.7,7,0))_" at GENERATE^HLMA entry point" G EXIT
    4945 I 'HLEID S HLEID=$O(^ORD(101,"B",HLEID,0)) I 'HLEID S HLRESLT="0^1^"_$G(^HL(771.7,1,0)) G EXIT
    5046 N HLRESLT1,HLRESLTA S (HLRESLTA,HLRESLT1)=""
     
    8278 I HLMIDAR K HLMIDAR("N") M HLRESLT=HLMIDAR
    8379 S HLRESLT=HLRESLT_"^"_HLRESLT1
    84  ;
    85  ; patch HL*1.6*122
    86  S HLRESLT("HLMID")=$G(HLMIDAR("HLMID"))
    87  S HLRESLT("IEN773")=$G(HLMIDAR("IEN773"))
    88  ;
    8980 ;Execute exit action for event driver protocol
    9081 I HLEXROU]"" X HLEXROU
     
    9788 ;Entry point to generate an immediate message, must be TCP Logical Link
    9889 ;Input:
    99  ;  The same as GENERATE,with one additional subscript to the HLP input
    100  ;  array:
     90 ;  The same as GENERATE,with one additional subscript to the HLP input array:
    10191 ;
    10292 ;  HLP("OPEN TIMEOUT") (optional, pass by reference) a number between
    10393 ;    1 and 120 that specifies how many seconds the DIRECT CONNECT should
    104  ;    try to open a connection before failing.  It is killed upon
    105  ;    completion.
     94 ;    try to open a connection before failing.  It is killed upon completion.
    10695 ;
    10796 N HLTCP,HLTCPO,HLPRIO,HLSAN,HLN,HLMIDAR,HLMTIENR,ZMID,HLDIRECT
     
    137126 ;I $P($G(^HLCS(870,HLDP,400)),U)="" W !,"Missing IP Address" Q
    138127 D SETUP^HLCSAC G:HLCS PINGQ
    139  ; patch HL*1.6*122
    140  G:$$DONTPING^HLMA4 PINGQ
    141128 ;PING header=MSH^PING^domain^PING^logical link^datetime
    142129 S INPUT(1)="MSH^PING^"_HLDPDM_"^PING^"_HLDPNM_"^"_$$HTE^XLFDT($H)
     
    147134 . ;non-standard HL7 header; start block,header,end block
    148135 . S HLX1=$H
    149  . ;
    150  . ; HL*1.6*122 start
    151  . ; replace flush character '!' with @IOF (! or #)
    152  . ; W $C(11)_INPUT(1)_$C(28)_$C(13),! ;HL*1.6*115, restored ! char
    153  . W $C(11)_INPUT(1)_$C(28)_$C(13),@IOF
    154  . ; HL*1.6*122 end
    155  . ;
     136 . W $C(11)_INPUT(1)_$C(28)_$C(13),! ;HL*1.6*115, restored ! char
    156137 . ;read response
    157138 . R X:HLDREAD
     
    179160 N HLDOM,HLIP S HLCS=""
    180161 S HLDOM=$P(^HLCS(870,HLDP,0),U,7)
    181  ; patch HL*1.6*122 start
    182  S HLDOM("DNS")=$P($G(^HLCS(870,+$G(HLDP),0)),"^",8)
    183  ; I 'HLDOM,'HLQUIET W !,"Domain Unknown" Q
    184  I 'HLDOM,($L(HLDOM("DNS"),".")<3) D  Q
    185  . I 'HLQUIET W !,"Domain Unknown"
    186  . S HLCS="-1^Connection Fail"
    187  ; patch HL*1.6*122 end
     162 I 'HLDOM,'HLQUIET W !,"Domain Unknown" Q
    188163 I HLDOM S HLDOM=$P(^DIC(4.2,HLDOM,0),U)
    189  ; patch HL*1.6*122
    190  ; I HLDOM]"" D  Q:'POP
    191  I HLDOM]""!($L(HLDOM("DNS"),".")>2) D  Q:'POP
     164 I HLDOM]"" D  Q:'POP
    192165 . I HLDOM["VA.GOV"&(HLDOM'[".MED.") S HLDOM=$P(HLDOM,".VA.GOV")_".MED.VA.GOV"
    193166 . I HLTCPORT=5000 S HLDOM="HL7."_HLDOM
    194167 . I HLTCPORT=5500 S HLDOM="MPI."_HLDOM
    195  . ; patch HL*1.6*122
    196  . I ($L(HLDOM("DNS"),".")>2) S HLDOM=HLDOM("DNS")
    197168 . I 'HLQUIET W !,"Domain, "_HLDOM
    198169 . I 'HLQUIET W !,"Port: ",HLTCPORT
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOAPI1.m

    r628 r636  
    1 HLOAPI1 ;ALB/CJM-HL7 - Developer API's for sending & receiving messages(continued) ;07/18/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,132,134,137**;Oct 13, 1995;Build 21
     1HLOAPI1 ;ALB/CJM-HL7 - Developer API's for sending & receiving messages(continued) ;02/06/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,132,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    5454 .I '$G(HLMSTATE("BODY")),'$G(HLMSTATE("UNSTORED LINES")) S ERROR="MESSAGE NOT YET CREATED" Q
    5555 .;
    56  .I $$CHKPARMS^HLOAPI2(.HLMSTATE,.PARMS,.ERR1)&$$CHKWHO^HLOAPI2(.HLMSTATE,.WHOTO,.ERR2) D
     56 .I $$CHKPARMS^HLOAPI2(.HLMSTATE,.PARMS,.ERR1)&$$CHKWHO(.HLMSTATE,.WHOTO,.ERR2) D
    5757 ..I $$SEND(.HLMSTATE,.ERROR) S SUCCESS=1
    5858 .E  D
    59  ..S ERROR=$G(ERR1)_": "_$G(ERR2)
    60  ..D DONTSEND(.HLMSTATE,ERROR)
     59 .S ERROR=$G(ERR1)_": "_$G(ERR2)
     60 .D DONTSEND(.HLMSTATE,ERROR)
    6161 K PARMS,WHOTO
    6262 Q $S(SUCCESS:HLMSTATE("IEN"),1:0)
     
    106106 .K STATE M STATE=HLMSTATE S STATE("IEN")=""
    107107 .S ERROR=""
    108  .I $$CHKWHO^HLOAPI2(.STATE,.WHO,.ERROR) D
     108 .I $$CHKWHO(.STATE,.WHO,.ERROR) D
    109109 ..I $$SEND(.STATE,.ERROR) D
    110110 ...S WHOTO(I,"QUEUED")=1
     
    190190 ;
    191191 I '$$SAVEMSG^HLOF778(.HLMSTATE) S ERROR="$$SAVE^HLOF778 FAILED!" Q 0
    192  I HLMSTATE("BATCH"),$L($G(HLMSTATE("STATUS","SEQUENCE QUEUE"))) S ERROR="SEQUENCE QUEUES NOT SUPPORTED FOR BATCH MESSAGES" Q 0
    193  I $L($G(HLMSTATE("STATUS","SEQUENCE QUEUE"))) D
    194  .S HLMSTATE("STATUS","MOVED TO OUT QUEUE")=$$SQUE^HLOQUE(HLMSTATE("STATUS","SEQUENCE QUEUE"),HLMSTATE("STATUS","LINK NAME"),$G(HLMSTATE("STATUS","PORT")),HLMSTATE("STATUS","QUEUE"),HLMSTATE("IEN")) D:HLMSTATE("STATUS","MOVED TO OUT QUEUE")
    195  ..S $P(^HLB(HLMSTATE("IEN"),5),"^",2)=1
    196  E  D
    197  .D OUTQUE^HLOQUE(HLMSTATE("STATUS","LINK NAME"),$G(HLMSTATE("STATUS","PORT")),HLMSTATE("STATUS","QUEUE"),HLMSTATE("IEN"))
     192 D OUTQUE^HLOQUE(HLMSTATE("STATUS","LINK NAME"),$G(HLMSTATE("STATUS","PORT")),HLMSTATE("STATUS","QUEUE"),HLMSTATE("IEN"))
    198193 Q HLMSTATE("IEN")
    199194 ;
    200195DONTSEND(HLMSTATE,ERROR) ;
    201  ;This procedure does NOT send a message.  Rather, it creates an entry in file 778 with the status ER. 
     196 ;This procedure does NOT send a message.  Rather, it creates an entry in file 778 with the
     197 ;of "SE". 
    202198 ;Input:
    203199 ;       HLMSTATE - pass-by-reference
     
    207203 I HLMSTATE("UNSTORED LINES"),'$$SAVEMSG^HLOF777(.HLMSTATE) ; just continue
    208204 ;
    209  S HLMSTATE("STATUS")="ER"
     205 S HLMSTATE("STATUS")="SE"
    210206 S HLMSTATE("STATUS","PURGE")=$$FMADD^XLFDT(HLMSTATE("DT/TM CREATED"),HLMSTATE("SYSTEM","ERROR PURGE"))
    211207 S HLMSTATE("STATUS","ERROR TEXT")=$G(ERROR)
    212208 I '$$SAVEMSG^HLOF778(.HLMSTATE) ;already reported an error to the app
    213209 Q
     210 ;
     211CHKWHO(HLMSTATE,WHOTO,ERROR) ;
     212 N RETURN,I
     213 S RETURN=1
     214 I '$$CHECKWHO^HLOASUB1(.WHOTO,.RETURN,.ERROR) S RETURN=0
     215 ;
     216 ;move parameters into HLMSTATE
     217 S HLMSTATE("STATUS","LINK IEN")=$G(RETURN("LINK IEN"))
     218 S HLMSTATE("STATUS","LINK NAME")=$G(RETURN("LINK NAME"))
     219 S HLMSTATE("STATUS","PORT")=$P($G(RETURN("RECEIVING FACILITY",2)),":",2)
     220 S HLMSTATE("HDR","RECEIVING APPLICATION")=$G(RETURN("RECEIVING APPLICATION"))
     221 F I=1:1:3 S HLMSTATE("HDR","RECEIVING FACILITY",I)=$G(RETURN("RECEIVING FACILITY",I))
     222 Q RETURN
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOAPI2.m

    r628 r636  
    1 HLOAPI2 ;ALB/CJM-HL7 - Developer API's for sending application acks ;07/30/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,131,133,134,137**;Oct 13, 1995;Build 21
     1HLOAPI2 ;ALB/CJM-HL7 - Developer API's for sending application acks ;12/11/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,131,133,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    6666 .S ACK("HDR","RECEIVING APPLICATION")=$G(HLMSTATE("HDR","SENDING APPLICATION"))
    6767 .F I=1:1:3 S ACK("HDR","RECEIVING FACILITY",I)=$G(HLMSTATE("HDR","SENDING FACILITY",I))
    68  .S ACK("ACK TO","STATUS")=$S(PARMS("ACK CODE")="AA":"SU",1:"ER")
     68 .S ACK("ACK TO","STATUS")=$S(PARMS("ACK CODE")="AA":"SU",1:"AE")
    6969 .S ACK("ACK TO")=$G(HLMSTATE("HDR","MESSAGE CONTROL ID"))
    7070 .S ACK("ACK TO","IEN")=HLMSTATE("IEN")
     
    117117 I LEN>20 S ERROR="QUEUE PARAMETER IS MAX 20 LENGTH",PARMS("QUEUE")=$E(PARMS("QUEUE"),1,20)
    118118 I 'LEN S PARMS("QUEUE")="DEFAULT"
    119  D
    120  .N APPIEN
    121  .I $G(PARMS("SENDING APPLICATION"))="" D  Q
    122  ..S ERROR="SENDING APPLICATION IS REQUIRED"
    123  ..S PARMS("SENDING APPLICATION")=""
    124  .E  D  Q:'APPIEN
    125  ..S APPIEN=$$GETIEN^HLOAPP(PARMS("SENDING APPLICATION"))
    126  ..I 'APPIEN S ERROR="SENDING APPLICATION NOT FOUND IN THE HLO APPLICATION REGISTRY"
    127  .I $L($G(PARMS("SEQUENCE QUEUE"))) D
    128  ..I ($L(PARMS("SEQUENCE QUEUE"))>30) S ERROR="SEQUENCE QUEUE NAME > 30 CHARACTERS" Q
    129  ..I PARMS("SEQUENCE QUEUE")["^" S ERROR="SEQUENCE QUEUE NAME MAY NOT CONTAIN '^'" Q
    130  ..I $G(PARMS("APP ACK TYPE"))'="AL" S ERROR="SEQUENCE QUEUES REQUIRE AN APPLICATION ACKNOWLEDGMENT" Q
    131  ..I $G(PARMS("ACCEPT ACK TYPE"))'="AL" S ERROR="SEQUENCE QUEUES REQUIRE AN ACCEPT ACKNOWLEDGMENT" Q
     119 I $G(PARMS("SENDING APPLICATION"))="" D
     120 .S ERROR="SENDING APPLICATION IS REQUIRED"
     121 .S PARMS("SENDING APPLICATION")=""
     122 E  D
     123 .I '$D(^HLD(779.2,"C",PARMS("SENDING APPLICATION"))) S ERROR="SENDING APPLICATION NOT FOUND IN THE HLO APPLICATION REGISTRY"
    132124 ;
    133125 ;move parameters into HLMSTATE
     
    140132 S @SARY@("FAILURE RESPONSE")=$G(PARMS("FAILURE RESPONSE"))
    141133 S @SARY@("QUEUE")=PARMS("QUEUE")
    142  S @SARY@("SEQUENCE QUEUE")=$G(PARMS("SEQUENCE QUEUE"))
    143134 Q:$L(ERROR) 0
    144135 Q 1
    145  ;
    146136 ;
    147137SETCODE(SEG,VALUE,FIELD,COMP,REP) ;
     
    165155 S @VAR=9,SEG(FIELD,REP,COMP,SUB)=$G(VALUE("ORIGINAL TEXT"))
    166156 Q
    167  ;
    168 CHKWHO(HLMSTATE,WHOTO,ERROR) ;
    169  N RETURN,I
    170  S RETURN=1
    171  I '$$CHECKWHO^HLOASUB1(.WHOTO,.RETURN,.ERROR) S RETURN=0
    172  ;
    173  ;move parameters into HLMSTATE
    174  S HLMSTATE("STATUS","LINK IEN")=$G(RETURN("LINK IEN"))
    175  S HLMSTATE("STATUS","LINK NAME")=$G(RETURN("LINK NAME"))
    176  S HLMSTATE("STATUS","PORT")=$P($G(RETURN("RECEIVING FACILITY",2)),":",2)
    177  S HLMSTATE("HDR","RECEIVING APPLICATION")=$G(RETURN("RECEIVING APPLICATION"))
    178  F I=1:1:3 S HLMSTATE("HDR","RECEIVING FACILITY",I)=$G(RETURN("RECEIVING FACILITY",I))
    179  Q RETURN
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOAPI3.m

    r628 r636  
    1 HLOAPI3 ;ALB/CJM-HL7 - Developer API's for sending application acks ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,133,134,137**;Oct 13, 1995;Build 21
     1HLOAPI3 ;ALB/CJM-HL7 - Developer API's for sending application acks ;03/13/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,133,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    9292 .I PARMS("EVENT")="",ACK("ACK TO","BODY"),$P(SUB,"^",2) S PARMS("EVENT")=$P($G(^HLA(ACK("ACK TO","BODY"),2,$P(SUB,"^",2),0)),"^",3)
    9393 .S PARMS("ACK TO")=PARMS("MESSAGE CONTROL ID")
    94  .S PARMS("ACK TO","STATUS")=$S(PARMS("ACK CODE")="AA":"SU",1:"ER")
     94 .S PARMS("ACK TO","STATUS")=$S(PARMS("ACK CODE")="AA":"SU",1:"AE")
    9595 .Q:'$$ADDMSG^HLOAPI(.ACK,.PARMS,.ERROR)
    9696 .S ACK("MSA")="MSA|"_PARMS("ACK CODE")_"|"_PARMS("MESSAGE CONTROL ID")_"|"_$G(PARMS("ERROR MESSAGE"))
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOAPP.m

    r628 r636  
    1 HLOAPP ;ALB/CJM-HL7 -Application Registry ;07/09/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,132,137**;Oct 13, 1995;Build 21
     1HLOAPP ;ALB/CJM-HL7 -Application Registry ;10/31/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,132**;Oct 13, 1995;Build 6
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
    55GETIEN(NAME) ;given the application name, it finds the ien.  Returns 0 on failure
    66 Q:'$L($G(NAME)) 0
    7  Q +$O(^HLD(779.2,"C",$E(NAME,1,60),0))
     7 N IEN,SUB
     8 S SUB=$E(NAME,1,60)
     9 S IEN=0
     10 F  S IEN=$O(^HLD(779.2,"B",SUB,IEN)) Q:'IEN  Q:$P($G(^HLD(779.2,IEN,0)),"^")=NAME
     11 Q +IEN
    812 ;
    913ACTION(HEADER,ACTION,QUEUE) ;Given the parsed header of a message it returns both the action that should be performed in response to the message and the incoming queue that it should be placed on.
     
    9397 S:SUBIEN ACTIVE='(+$P($G(^HLD(779.2,IEN,1,SUBIEN,0)),"^",7))
    9498 Q ACTIVE
    95  ;
    96 EXCEPT(APPNAME) ;
    97  ;returns the exception handler (tag^routine) that should be invoked
    98  ;when an applicaiton's messages are being sequenced and an app ack
    99  ;is not timely received
    100  ;
    101  N IEN,RTN
    102  S IEN=$$GETIEN($G(APPNAME))
    103  I IEN S RTN=$P($G(^HLD(779.2,IEN,0)),"^",10,11)
    104  I $L($G(RTN))>1 Q RTN
    105  Q "DEFAULT^HLOAPP"
    106  ;
    107 DEFAULT ;default exception handler if the app doesn't specify one
    108  S ^TMP("HLO SEQUENCING EXCEPTION",$J,$$NOW^XLFDT,+$G(HLMSGIEN))=""
    109  Q
    110  ;
    111 TIMEOUT(APPNAME) ;
    112  N IEN,TIME
    113  S IEN=$$GETIEN($G(APPNAME))
    114  I IEN S TIME=$P($G(^HLD(779.2,IEN,0)),"^",12)
    115  Q:'$G(TIME) 10
    116  Q TIME
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOCLNT.m

    r628 r636  
    1 HLOCLNT ;ALB/CJM- Client for sending messages - 10/4/94 1pm ;08/15/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134,137**;Oct 13, 1995;Build 21
     1HLOCLNT ;ALB/CJM- Client for sending messages - 10/4/94 1pm ;03/22/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    155155 .;
    156156 .;try to send the message
    157  .;
    158  .;
    159157 .Q:'$$WRITEMSG^HLOCLNT1(.HLCSTATE,.HLMSTATE)
    160158 .;does the message need an accept ack?
     
    170168 ..S $P(UPDATE,"^",5)=1
    171169 ..S UPDATE("MSA")=ACKID_"^"_MSA
    172  ..I '(ACKCODE="CA") S $P(UPDATE,"^",3)="ER",$P(UPDATE,"^",4)=2
     170 ..I '(ACKCODE="CA") S $P(UPDATE,"^",3)="SE",$P(UPDATE,"^",4)=2
    173171 ..I ACKCODE="CA",HLMSTATE("HDR","APP ACK TYPE")="NE" S $P(UPDATE,"^",3)="SU",$P(UPDATE,"^",4)=$S(HLMSTATE("BATCH"):"2",1:1)
    174  ..I ($P(UPDATE,"^",3)="ER") S $P(UPDATE,"^",6)=$P(HLMSTATE("HDR",1),FS,5) ;errors need the application for xref
     172 ..I ($P(UPDATE,"^",3)="SE") S $P(UPDATE,"^",6)=$P(HLMSTATE("HDR",1),FS,5) ;errors need the application for xref
    175173 ..;
    176  ..;if it's from a sequence queue, timestamp the queue
    177  ..I $L($G(HLMSTATE("STATUS","SEQUENCE QUEUE"))) D
    178  ...L +^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE")):200
    179  ...I $P($G(^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE"))),"^")'=MSGIEN L -^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE")) Q
    180  ...I ACKCODE="CA" S $P(^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE")),"^",2)=$$FMADD^XLFDT($P(UPDATE,"^",2),,,$$TIMEOUT^HLOAPP($$GETSAP^HLOCLNT2(MSGIEN))) L -^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE")) Q
    181  ...;if the message wasn't accepted, need to notify without waiting
    182  ...S $P(^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE")),"^",2)=$P(UPDATE,"^",2)
    183  ...L -^HLB("QUEUE","SEQUENCE",HLMSTATE("STATUS","SEQUENCE QUEUE"))
    184  ..;
    185  ..;does the app need notification of accept ack?
     174 ..;did the app request notification of accept ack?
    186175 ..S UPDATE("ACTION")=HLMSTATE("ACCEPT ACK RESPONSE")
    187  ..;
    188176 ..S SUCCESS=1
    189177 .E  D  ;accept ack wasn't requested
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOCLNT1.m

    r628 r636  
    1 HLOCLNT1 ;IRMFO-ALB/CJM - Writing messages, reading acks;03/24/2004  14:43 ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134,137**;Oct 13, 1995;Build 21
     1HLOCLNT1 ;IRMFO-ALB/CJM - Writing messages, reading acks;03/24/2004  14:43 ;03/19/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    146146 ...S $P(^HLB(MSG,0),"^",21)=COUNT_" FAILED TRANSMISSIONS"
    147147 ...S $P(^HLB(MSG,0),"^",20)="TF"
    148  ...S ^HLB("ERRORS",RAPP,TIME,MSG)=""
     148 ...S ^HLB("ERRORS","TF",SAPP,TIME,MSG)=""
    149149 ...D COUNT^HLOESTAT("OUT",RAPP,SAPP,MTYPE,EVENT)
    150150 ...S ACTION=$P(NODE0,"^",14,15)
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOCLNT2.m

    r628 r636  
    1 HLOCLNT2 ;ALB/CJM- Performs message updates for the client - 10/4/94 1pm ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,133,134,137**;Oct 13, 1995;Build 21
     1HLOCLNT2 ;ALB/CJM- Performs message updates for the client - 10/4/94 1pm ;03/09/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,133,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    5353UPDATE(MSGIEN,TIME,PARMS) ;
    5454 S:PARMS("STATUS")]"" $P(^HLB(MSGIEN,0),"^",20)=PARMS("STATUS")
    55  I PARMS("STATUS")="ER" D
    56  .S ^HLB("ERRORS",PARMS("RECEIVING APP"),TIME,MSGIEN_"^")=""
    57  .D COUNT^HLOESTAT("OUT",PARMS("RECEIVING APP"),$$GETSAP(MSGIEN),$$GETMTYPE(MSGIEN))
     55 S:PARMS("STATUS")="SE" ^HLB("ERRORS","SE",PARMS("RECEIVING APP"),TIME,MSGIEN)=""
     56 S:PARMS("STATUS")="AE" ^HLB("ERRORS","AE",PARMS("RECEIVING APP"),TIME,MSGIEN_"^")=""
     57 I PARMS("STATUS")["E" D COUNT^HLOESTAT("OUT",PARMS("RECEIVING APP"),$$GETSAP(MSGIEN),$$GETMTYPE(MSGIEN))
    5858 S:PARMS("ACCEPT ACK") $P(^HLB(MSGIEN,0),"^",17)=PARMS("ACCEPT ACK")
    5959 S $P(^HLB(MSGIEN,0),"^",16)=TIME
     
    101101 ;    "ID" - message id from the header
    102102 ;    "IEN" - ien, file 778
    103  ;    "STATUS","SEQUENCE QUEUE")=name of the sequence queue (optional)
    104103 ;
    105104 K MSG
     
    147146 .S MSG("HDR","ACCEPT ACK TYPE")=$E($P($P(MSG("HDR",2),FS,4),"ACCEPT ACK TYPE=",2),1,2)
    148147 .S MSG("HDR","APP ACK TYPE")=$E($P($P(MSG("HDR",2),FS,4),"APP ACK TYPE=",2),1,2)
    149  S MSG("STATUS","SEQUENCE QUEUE")=$P($G(^HLB(IEN,5)),"^")
    150148 Q 1
    151149 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOCLNT3.m

    r628 r636  
    1 HLOCLNT3 ;ALB/CJM- Updates messages missing application acks - 10/4/94 1pm ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,134,137**;Oct 13, 1995;Build 21
     1HLOCLNT3 ;ALB/CJM- Updates messages missing application acks - 10/4/94 1pm ;03/22/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    2929 .S $P(^HLB(MSGIEN,0),"^",9)=PURGE
    3030 .S ^HLB("AD","OUT",PURGE,MSGIEN)=""
    31  .S $P(^HLB(MSGIEN,0),"^",20)="ER"
     31 .S $P(^HLB(MSGIEN,0),"^",20)="AE"
    3232 .S $P(^HLB(MSGIEN,0),"^",21)="MISSING APPLICATION ACKNOWLEDGMENT"
    3333 .M HDR=MSG("HDR")
    3434 .Q:'$$PARSEHDR^HLOPRS(.HDR)
    35  .S ^HLB("ERRORS",$S($L(HDR("RECEIVING APPLICATION")):HDR("RECEIVING APPLICATION"),1:"UNKNOWN"),NOW,MSGIEN)=""
     35 .S ^HLB("ERRORS","AE",$S($L(HDR("RECEIVING APPLICATION")):HDR("RECEIVING APPLICATION"),1:"UNKNOWN"),NOW,MSGIEN)=""
    3636 .D COUNT^HLOESTAT("OUT",HDR("RECEIVING APPLICATION"),HDR("SENDING APPLICATION"),$S(MSG("BATCH"):"BATCH",1:$G(HDR("MESSAGE TYPE"))),$G(HDR("EVENT")))
    3737 S:MSGIEN>99999999999 MSGIEN=0
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOCNRT.m

    r628 r636  
    1 HLOCNRT ;DAOU/ALA-Generate HL7 Optimized Message ;07/24/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,132,134,137**;Oct 13, 1995;Build 21
     1HLOCNRT ;DAOU/ALA-Generate HL7 Optimized Message ;03/15/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,132,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    1717 ;   ARYTYP = The array where HL7 message resides
    1818 ;   HLP = Additional HL7 message parameters (optional, pass by reference)
    19  ;        These optional subscripts to HLP are supported for input:
    20  ;             "APP ACK RESPONSE" = <tag^routine> to call when the app ack is received
    21  ;             "CONTPTR"
     19 ;        These optional subscripts to HLL are supported for input:
    2220 ;             "SECURITY"
    23  ;             "SEQUENCE QUEUE" - queue used to maintain the order of the messages via application acks.  If used, the application MUST specify that both an accept ack and application ack be returned.
     21 ;              "CONTPTR"
     22 ;              "APP ACK RESPONSE" = <tag^routine> to call when the app ack is received
    2423 ;       
    2524 ;   HLL  (optional, pass by reference) Additional message recipients being dynamically added
     
    5150 . I $G(HLP("CONTPTR"))'="" S APPARMS("CONTINUATION POINTER")=HLP("CONTPTR")
    5251 . I $G(HLP("QUEUE"))'="" S APPARMS("QUEUE")=HLP("QUEUE")
    53  . I $G(HLP("SEQUENCE QUEUE"))'="" S APPARMS("SEQUENCE QUEUE")=HLP("SEQUENCE QUEUE")
    5452 . I $G(HLP("APP ACK RESPONSE"))'="" S APPARMS("APP ACK RESPONSE")=HLP("APP ACK RESPONSE")
    5553 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOF778.m

    r628 r636  
    1 HLOF778 ;ALB/CJM-HL7 - Saving messages to file 778 ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,137**;Oct 13, 1995;Build 21
     1HLOF778 ;ALB/CJM-HL7 - Saving messages to file 778 ;03/15/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    142142 .S $P(^HLB(IEN,3,SUBIEN,0),"^",4)=$G(ACKTO("ACK BY"))
    143143 .S $P(^HLB(IEN,3,SUBIEN,0),"^",5)=STATUS
    144  I (STATUS="ER"),'SKIP D
     144 I (STATUS="AE"),'SKIP D
    145145 .N APP
    146  .S APP=HLMSTATE("HDR","RECEIVING APPLICATION")
     146 .S APP=HLMSTATE("HDR","SENDING APPLICATION")
    147147 .I APP="" S APP="UNKNOWN"
    148  .S ^HLB("ERRORS",APP,$$NOW^XLFDT,ACKTO("IEN"))=""
     148 .S ^HLB("ERRORS","AE",APP,$$NOW^XLFDT,ACKTO("IEN"))=""
    149149 .;don't count the error - the app ack was already counted as an error.
    150150 .D COUNT^HLOESTAT("IN",$G(HLMSTATE("HDR","RECEIVING APPLICATION")),$G(HLMSTATE("HDR","SENDING APPLICATION")),$S(HLMSTATE("BATCH"):"BATCH",1:$G(HLMSTATE("HDR","MESSAGE TYPE"))),$G(HLMSTATE("HDR","EVENT")))
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOF778A.m

    r628 r636  
    1 HLOF778A ;ALB/CJM-HL7 - Saving messages to file 778 (continued) ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,137**;Oct 13, 1995;Build 21
     1HLOF778A ;ALB/CJM-HL7 - Saving messages to file 778 (continued) ;03/07/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    4747 .S ^HLB("B",ID,IEN)=""
    4848 .S ^HLB("C",HLMSTATE("BODY"),IEN)=""
    49  .I ($G(@STAT)="ER") D
    50  ..S ^HLB("ERRORS",$S($L($G(HLMSTATE("HDR","RECEIVING APPLICATION"))):HLMSTATE("HDR","RECEIVING APPLICATION"),1:"UNKNOWN"),HLMSTATE("DT/TM CREATED"),IEN)=""
     49 .I ($G(@STAT)="SE") D
     50 ..S ^HLB("ERRORS","SE",$S($L($G(HLMSTATE("HDR","RECEIVING APPLICATION"))):HLMSTATE("HDR","RECEIVING APPLICATION"),1:"UNKNOWN"),HLMSTATE("DT/TM CREATED"),IEN)=""
    5151 ..D COUNT^HLOESTAT("OUT",$G(HLMSTATE("HDR","RECEIVING APPLICATION")),$G(HLMSTATE("HDR","SENDING APPLICATION")),$S(HLMSTATE("BATCH"):"BATCH",1:$G(HLMSTATE("HDR","MESSAGE TYPE"))),$G(HLMSTATE("HDR","EVENT")))
    5252 .;
     
    7070 ;The "SEARCH" x-ref will be created asynchronously
    7171 S ^HLTMP("PENDING SEARCH X-REF",$J,HLMSTATE("DT/TM CREATED"),IEN)=""
    72  ;
    73  ;sequence q?
    74  I HLMSTATE("DIRECTION")="OUT",$G(@STAT@("SEQUENCE QUEUE"))'="" S ^HLB(IEN,5)=@STAT@("SEQUENCE QUEUE")
    7572 ;
    7673 Q IEN
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOFILER.m

    r628 r636  
    1 HLOFILER ;ALB/CJM- Passes messages on the incoming queue to the applications - 10/4/94 1pm ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,131,134,137**;Oct 13, 1995;Build 21
     1HLOFILER ;ALB/CJM- Passes messages on the incoming queue to the applications - 10/4/94 1pm ;03/28/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,131,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    115115 D DEQUE()
    116116 ;
    117  ;may need to change the status to Error
     117 ;may need to change the status to Application Error
    118118 D
    119119 .N NODE,RAPP,SAPP,FS,CS,REP,ESCAPE,SUBCOMP,HDR,DIR,NOW
     
    121121 .S NODE=$G(^HLB(MSGIEN,0))
    122122 .Q:NODE=""
    123  .Q:$P(NODE,"^",20)="ER"
    124  .S $P(NODE,"^",20)="ER",$P(NODE,"^",21)="APPLICATION ROUTINE ERROR"
     123 .Q:$P(NODE,"^",20)="AE"
     124 .S $P(NODE,"^",20)="AE",$P(NODE,"^",21)="APPLICATION ROUTINE ERROR"
    125125 .S DIR=$S($E($P(NODE,"^",4))="I":"IN",1:"OUT")
    126126 .I $P(NODE,"^",9) K ^HLB("AD",DIR,$P(NODE,"^",9),MSGIEN)
     
    138138 .I RAPP="" S RAPP="UNKNOWN"
    139139 .S SAPP=$$DESCAPE^HLOPRS1($P($P(HDR,FS,3),CS),FS,CS,SUBCOMP,REP,ESCAPE)
    140  .S ^HLB("ERRORS",RAPP,NOW,MSGIEN)=""
     140 .S ^HLB("ERRORS","AE",RAPP,NOW,MSGIEN)=""
    141141 .D COUNT^HLOESTAT(DIR,RAPP,SAPP,"UNKNOWN")
    142142 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOMSG.m

    r628 r636  
    1 HLOMSG ;ALB/CJM-HL7 - APIs for files 777/778 ;07/25/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,137**;Oct 13, 1995;Build 21
     1HLOMSG ;ALB/CJM-HL7 - APIs for files 777/778 ;02/04/2004
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    4343 ;     "PURGE" - scheduled purge dt/tm
    4444 ;     "QUEUE" - the queue that the message was placed on
    45  ;     "SEQUENCE QUEUE" - the sequence queue (optional)
    4645 ;
    4746 K MSG
     
    9695 .S MSG("MESSAGE TYPE")=$P(NODE,"^",3)
    9796 .S MSG("EVENT")=$P(NODE,"^",4)
    98  I MSG("DIRECTION")="OUT" D
    99  .N NODE5
    100  .S NODE5=$G(^HLB(IEN,5))
    101  .S MSG("STATUS","SEQUENCE QUEUE")=$P(NODE5,"^")
    102  .S MSG("STATUS","MOVED TO OUT QUEUE")=$P(NODE5,"^",2)
    103  .S MSG("STATUS","SEQUENCE EXCEPTION RAISED")=$P(NODE5,"^",3)
    10497 Q 1
    10598 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOPOST.m

    r628 r636  
    1 HLOPOST ;IRMFO-ALB/CJM -Post-Install routine for HLO;03/24/2004  14:43 ;07/20/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,136,137**;Oct 13, 1995;Build 21
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLOPOST ;IRMFO-ALB/CJM -Post-Install routine for HLO;03/24/2004  14:43 ;05/03/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134,136**;Oct 13, 1995;Build 9
    43 ;
    54 N SYSTEM,DATA,VASITE,OLDSITE
     
    8079 S ^HLD(779.3,IEN,0)="PURGE OLD MESSAGES^1^0^2^20^^5^GETWORK^HLOPURGE^DOWORK^HLOPURGE^1^0"
    8180 Q
    82  ;
    83 P137 ;
    84  ;move the existing errros to the new structure
    85  N TYPE
    86  K ^TMP($J,"HLO ERRORS")
    87  F TYPE="TF","SE","AE" D
    88  .M ^TMP($J,"HLO ERRORS",TYPE)=^HLB("ERRORS",TYPE)
    89  .M ^HLB("ERRORS")=^TMP($J,"HLO ERRORS",TYPE)
    90  .K ^TMP($J,"HLO ERRORS",TYPE)
    91  .K ^HLB("ERRORS",TYPE)
    92  Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOPURGE.m

    r628 r636  
    1 HLOPURGE ;IRMFO-ALB/CJM - Purging Old Messages;03/24/2004  14:43 ;07/25/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,136,137**;Oct 13, 1995;Build 21
     1HLOPURGE ;IRMFO-ALB/CJM - Purging Old Messages;03/24/2004  14:43 ;04/30/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134,136**;Oct 13, 1995;Build 9
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    2828 Q
    2929OLD778 ;
    30  N OLD,START,END,APP,TYPE,TODAY,PARMS
     30 N OLD,START,END,APP,TYPE,TODAY
    3131 S TODAY=$$DT^XLFDT
    3232 S OLD=$$FMADD^XLFDT(TODAY,-45)
     
    5858 ;
    5959 ;also kill old errors left lying around
    60  D SYSPARMS^HLOSITE(.PARMS)
    61  S OLD=$$FMADD^XLFDT($$DT^XLFDT,-PARMS("ERROR PURGE"))
    62  S APP=""
    63  F  S APP=$O(^HLB("ERRORS",APP)) Q:APP=""  D
    64  .N TIME
     60 F TYPE="TF","AE","SE" S APP="" F  S APP=$O(^HLB("ERRORS",TYPE,APP)) Q:APP=""  D
     61 .N TIME,PARMS
     62 .D SYSPARMS^HLOSITE(.PARMS)
     63 .S OLD=$$FMADD^XLFDT($$DT^XLFDT,-PARMS("ERROR PURGE"))
    6564 .S TIME=0
    66  .F  S TIME=$O(^HLB("ERRORS",APP,TIME)) Q:'TIME  Q:TIME>OLD  K ^HLB("ERRORS",APP,TIME)
     65 .F  S TIME=$O(^HLB("ERRORS",TYPE,APP,TIME)) Q:'TIME  Q:TIME>OLD  K ^HLB("ERRORS",TYPE,APP,TIME)
    6766 Q
    6867OLD777 ;
     
    102101 ;if an error status,take care of the "ERRORS" x-ref
    103102 I MSG("STATUS")'="",MSG("STATUS")'="SU",MSG("BODY") D
    104  .K ^HLB("ERRORS",RAPP,MSG("DT/TM CREATED"),MSGIEN)
    105  .I MSG("STATUS")="ER" D
     103 .N APP
     104 .S APP=$S(MSG("STATUS")="TF":SAPP,1:RAPP)
     105 .K ^HLB("ERRORS",MSG("STATUS"),APP,MSG("DT/TM CREATED"),MSGIEN)
     106 .I MSG("STATUS")="AE" D
    106107 ..N SUB
    107108 ..S SUB=MSGIEN_"^"
    108  ..K ^HLB("ERRORS",RAPP,MSG("DT/TM CREATED"),SUB)
    109  ..F  S SUB=$O(^HLB("ERRORS",RAPP,MSG("DT/TM CREATED"),SUB)) Q:SUB=""  Q:+SUB'=MSGIEN  K ^HLB("ERRORS",RAPP,MSG("DT/TM CREATED"),SUB)
     109 ..K ^HLB("ERRORS","AE",APP,MSG("DT/TM CREATED"),SUB)
     110 ..F  S SUB=$O(^HLB("ERRORS","AE",APP,MSG("DT/TM CREATED"),SUB)) Q:SUB=""  Q:+SUB'=MSGIEN  K ^HLB("ERRORS","AE",APP,MSG("DT/TM CREATED"),SUB)
    110111 ;
    111112 ;kill the whole-file xrefs for the message ien within a batch
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOQUE.m

    r628 r636  
    1 HLOQUE ;ALB/CJM- HL7 QUEUE MANAGEMENT - 10/4/94 1pm ;07/31/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,132,134,137**;Oct 13, 1995;Build 21
     1HLOQUE ;ALB/CJM- HL7 QUEUE MANAGEMENT - 10/4/94 1pm ;01/05/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,132,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    9090 I $G(^HLTMP("STOPPED QUEUES",DIR,QUEUE)) Q 1
    9191 Q 0
    92  ;
    93 SQUE(SQUE,LINKNAME,PORT,QNAME,IEN778) ;
    94  ;Will place the message=IEN778 on the sequencing queue. This is always done in the context of the application calling an HLO API to send a message.
    95  ;Input:
    96  ;  SQUE - name of the sequencing queue
    97  ;  LINKNAME = name of (.01) the logical link
    98  ;  PORT (optional) the port to connect to
    99  ;  QNAME (optional) outgoing queue
    100  ;  IEN778 = ien of the message in file 778
    101  ;Output: 1 if placed on the outgoing queue, 0 if placed on the sequence queue
    102  ;
    103  N NEXT,MOVED
    104  S MOVED=0
    105  ;
    106  ;keep a count of messages pending on sequence queues for the HLO System Monitor
    107  I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE")))
    108  ;
    109  L +^HLB("QUEUE","SEQUENCE",SQUE):200
    110  ;
    111  S NEXT=+$G(^HLB("QUEUE","SEQUENCE",SQUE))
    112  Q:NEXT=IEN778 0  ;already queued!
    113  ;if the sequence queue is empty and not waiting on a message, then the message can be put directly on the outgoing queue, bypassing the sequence queue
    114  I '$O(^HLB("QUEUE","SEQUENCE",SQUE,0)),'NEXT D
    115  .S ^HLB("QUEUE","SEQUENCE",SQUE)=IEN778 ;to mean something moved to outgoing but not yet transmitted
    116  .L -^HLB("QUEUE","SEQUENCE",SQUE)
    117  .D OUTQUE(.LINKNAME,.PORT,.QNAME,IEN778)
    118  .S MOVED=1
    119  E  D
    120  .;Put the message on the sequence queue.
    121  .S ^HLB("QUEUE","SEQUENCE",SQUE,IEN778)=""
    122  .L -^HLB("QUEUE","SEQUENCE",SQUE)
    123  Q MOVED
    124  ;
    125 ADVANCE(SQUE,MSGIEN) ;
    126  ;Will move the specified sequencing queue to the next message.
    127  ;Input:
    128  ;  SQUE - name of the sequencing queue
    129  ;  MSGIEN - the ien of the message upon which the sequence queue was waiting.  If it is NOT the correct ien, then the sequence queue will NOT be advance.
    130  ;Output:
    131  ;  Function - 1 if advanced, 0 if not
    132  ;
    133  N NODE,IEN778,LINKNAME,PORT,QNAME
    134  Q:'$L($G(SQUE)) 0
    135  Q:'$G(MSGIEN) 0
    136  L +^HLB("QUEUE","SEQUENCE",SQUE):200
    137  ;
    138  ;do not advance if the queue wasn't pending the message=MSGIEN
    139  I (MSGIEN'=$P($G(^HLB("QUEUE","SEQUENCE",SQUE)),"^")) L -^HLB("QUEUE","SEQUENCE",SQUE) Q 0
    140  ;
    141  I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE")),-1)<0,$$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE"))) ;decrement the count of messages pending sequence queues
    142  ;
    143  S IEN778=0
    144  ;look for the first message on the sequence que.  Make sure its valid, if not remove the invalid entry and keep looking.
    145  F  S IEN778=$O(^HLB("QUEUE","SEQUENCE",SQUE,0)) Q:'IEN778  S NODE=$G(^HLB(IEN778,0)) Q:$L(NODE)  D
    146  .;message does not exist! Remove from queue and try again.
    147  .K ^HLB("QUEUE","SEQUENCE",SQUE,IEN778)
    148  .I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE")),-1)<0,$$INC^HLOSITE($NA(^HLC("QUEUECOUNT","SEQUENCE"))) ;decrement the count of messages pending sequence queues
    149  ;
    150  ;IEN778 is the next pending msg on this sequence queue
    151  I IEN778 D
    152  .;
    153  .;parse out info needed to move to outgoing queue
    154  .S LINKNAME=$P(NODE,"^",5),PORT=$P(NODE,"^",8),QNAME=$P(NODE,"^",6)
    155  .;
    156  .S ^HLB("QUEUE","SEQUENCE",SQUE)=IEN778 ;indicates this sequence queue is now waiting for msg=IEN778 before advancing.  The second pieces is the timer, but will not be set until the message=IEN778 is actually transmitted.
    157  .K ^HLB("QUEUE","SEQUENCE",SQUE,IEN778) ;remove from sequence queue
    158  .L -^HLB("QUEUE","SEQUENCE",SQUE)
    159  .S $P(^HLB(IEN778,5),"^",2)=1
    160  .D OUTQUE(.LINKNAME,$G(PORT),$G(QNAME),IEN778) ;move to outgoing queue
    161  E  D
    162  .K ^HLB("QUEUE","SEQUENCE",SQUE) ;this sequence queue is currently empty and not needed
    163  .L -^HLB("QUEUE","SEQUENCE",SQUE)
    164  Q 1
    165  ;
    166 SEQCHK(WORK) ;functions under the HLO Process Manager
    167  ;check sequence queues for timeout
    168  N QUE,NOW
    169  S NOW=$$NOW^XLFDT
    170  S QUE=""
    171  F  S QUE=$O(^HLB("QUEUE","SEQUENCE",QUE)) Q:QUE=""  D
    172  .N NODE,MSGIEN,ACTION,NODE
    173  .S NODE=$G(^HLB("QUEUE","SEQUENCE",QUE))
    174  .Q:'$P(NODE,"^",2)
    175  .Q:$P(NODE,"^",2)>NOW
    176  .Q:$P(NODE,"^",3)
    177  .L +^HLB("QUEUE","SEQUENCE",QUE):2
    178  .;don't report if a lock wasn't obtained
    179  .Q:'$T
    180  .S NODE=$G(^HLB("QUEUE","SEQUENCE",QUE))
    181  .I '$P(NODE,"^",2) L -^HLB("QUEUE","SEQUENCE",QUE) Q
    182  .I ($P(NODE,"^",2)>NOW) L -^HLB("QUEUE","SEQUENCE",QUE) Q
    183  .I $P(NODE,"^",3) L -^HLB("QUEUE","SEQUENCE",QUE) Q  ;exception already raised
    184  .S MSGIEN=$P(NODE,"^")
    185  .I 'MSGIEN L -^HLB("QUEUE","SEQUENCE",QUE) Q
    186  .S ACTION=$$EXCEPT^HLOAPP($$GETSAP^HLOCLNT2(MSGIEN))
    187  .S $P(^HLB(MSGIEN,5),"^",3)=1
    188  .S $P(^HLB("QUEUE","SEQUENCE",QUE),"^",3)=1 ;indicates exception raised
    189  .L -^HLB("QUEUE","SEQUENCE",QUE)
    190  .D  ;call the application to take action
    191  ..N HLMSGIEN,MCODE,DUZ,QUE,NOW
    192  ..N $ETRAP,$ESTACK S $ETRAP="G ERROR^HLOQUE"
    193  ..S HLMSGIEN=MSGIEN
    194  ..S MCODE="D "_ACTION
    195  ..N MSGIEN,X
    196  ..D DUZ^XUP(.5)
    197  ..X MCODE
    198  ..;kill the apps variables
    199  ..D
    200  ...N ZTSK
    201  ...D KILL^XUSCLEAN
    202  Q
    203 ERROR ;error trap for application context
    204  S $ETRAP="D UNWIND^%ZTER"
    205  D ^%ZTER
    206  S $ECODE=",UAPPLICATION ERROR,"
    207  ;
    208  ;kill the apps variables
    209  D
    210  .N ZTSK,MSGIEN,QUEUE
    211  .D KILL^XUSCLEAN
    212  ;
    213  ;release all the locks the app may have set, except Taskman lock
    214  L:$D(ZTSK) ^%ZTSCH("TASK",ZTSK):1
    215  L:'$D(ZTSK)
    216  ;reset HLO's lock
    217  L +^HLTMP("HL7 RUNNING PROCESSES",$J):0
    218  ;return to processing the next message on the queue
    219  D UNWIND^%ZTER
    220  Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOSRVR.m

    r628 r636  
    1 HLOSRVR ;ALB/CJM- Server for receiving messages - 10/4/94 1pm ;07/19/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134,137**;Oct 13, 1995;Build 21
     1HLOSRVR ;ALB/CJM- Server for receiving messages - 10/4/94 1pm ;03/22/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    5656 ..D:HLMSTATE("IEN") UPDATE(.HLMSTATE,.HLCSTATE)
    5757 ..D:HLCSTATE("COUNTS")>4 SAVECNTS^HLOSTAT(.HLCSTATE)
    58  ..I $G(HLMSTATE("ACK TO","IEN")),$L($G(HLMSTATE("ACK TO","SEQUENCE QUEUE"))) D ADVANCE^HLOQUE(HLMSTATE("ACK TO","SEQUENCE QUEUE"),+HLMSTATE("ACK TO","IEN"))
    5958 .E  D INQUE() H:HLCSTATE("CONNECTED") 1
    6059 ;
     
    138137 .I HLMSTATE("STATUS")="" S HLMSTATE("STATUS")="SU"
    139138 .S:HLMSTATE("BATCH") WAIT=HLCSTATE("SYSTEM","ERROR PURGE")
    140  .S:'HLMSTATE("BATCH") WAIT=$S(($G(HLMSTATE("ACK TO","STATUS"))="ER"):24*HLCSTATE("SYSTEM","ERROR PURGE"),HLMSTATE("STATUS")="ER":24*HLCSTATE("SYSTEM","ERROR PURGE"),1:HLCSTATE("SYSTEM","NORMAL PURGE"))
     139 .S:'HLMSTATE("BATCH") WAIT=$S(($G(HLMSTATE("ACK TO","STATUS"))="AE"):24*HLCSTATE("SYSTEM","ERROR PURGE"),HLMSTATE("STATUS")="SE":24*HLCSTATE("SYSTEM","ERROR PURGE"),1:HLCSTATE("SYSTEM","NORMAL PURGE"))
    141140 .S PURGE=$$FMADD^XLFDT($$NOW^XLFDT,,WAIT)
    142141 .S $P(^HLB(HLMSTATE("IEN"),0),"^",9)=PURGE
     
    151150 I HLMSTATE("STATUS")'="" S $P(^HLB(HLMSTATE("IEN"),0),"^",20)=HLMSTATE("STATUS") S:$G(HLMSTATE("MSA",3))]"" $P(^HLB(HLMSTATE("IEN"),0),"^",21)=HLMSTATE("MSA",3) D:HLMSTATE("STATUS")="SE"
    152151 .N APP
    153  .S APP=HLMSTATE("HDR","RECEIVING APPLICATION") S:APP="" APP="UNKNOWN" S ^HLB("ERRORS",APP,HLMSTATE("DT/TM"),HLMSTATE("IEN"))=""
     152 .S APP=HLMSTATE("HDR","RECEIVING APPLICATION") S:APP="" APP="UNKNOWN" S ^HLB("ERRORS","SE",APP,HLMSTATE("DT/TM"),HLMSTATE("IEN"))=""
    154153 .D COUNT^HLOESTAT("IN",$G(HLMSTATE("HDR","RECEIVING APPLICATION")),$G(HLMSTATE("HDR","SENDING APPLICATION")),$S(HLMSTATE("BATCH"):"BATCH",1:$G(HLMSTATE("HDR","MESSAGE TYPE"))),$G(HLMSTATE("HDR","EVENT")))
    155154 ;
     
    161160 .I FROM="" S FROM="UNKNOWN SENDING FACILITY"
    162161 .S PARMS("FROM")=FROM,PARMS("QUEUE")=HLMSTATE("STATUS","QUEUE"),PARMS("ACTION")=HLMSTATE("STATUS","ACTION")
    163  .I HLMSTATE("STATUS")'="" S PARMS("PURGE")=$S(HLMSTATE("STATUS")="ER":2,$G(HLMSTATE("ACK TO","STATUS"))="ER":2,1:1)
     162 .I HLMSTATE("STATUS")'="" S PARMS("PURGE")=$S(HLMSTATE("STATUS")'="SU":2,$G(HLMSTATE("ACK TO","STATUS"))="AE":2,1:1)
    164163 .S:$G(HLMSTATE("ACK TO","IEN")) PARMS("ACKTOIEN")=HLMSTATE("ACK TO","IEN") ;to insure that the infiler will know to set the purge date at the same time as the initial message
    165164 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOSRVR1.m

    r628 r636  
    1 HLOSRVR1 ;IRMFO-ALB/CJM - Reading messages, sending acks;03/24/2004  14:43 ;07/17/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,133,134,137**;Oct 13, 1995;Build 21
     1HLOSRVR1 ;IRMFO-ALB/CJM - Reading messages, sending acks;03/24/2004  14:43 ;03/26/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,133,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    5252 ....S HLMSTATE("ACK TO")=OLDMSGID
    5353 ....S HLMSTATE("ACK TO","ACK BY")=HLMSTATE("ID")
    54  ....S HLMSTATE("ACK TO","STATUS")=$S(CODE="AA":"SU",1:"ER")
    55  ....I $G(IEN) D
    56  .....S HLMSTATE("ACK TO","IEN")=IEN
    57  .....S HLMSTATE("ACK TO","SEQUENCE QUEUE")=$P($G(^HLB(+IEN,5)),"^")
     54 ....S HLMSTATE("ACK TO","STATUS")=$S(CODE="AA":"SU",1:"AE")
     55 ....S:$D(IEN) HLMSTATE("ACK TO","IEN")=IEN
    5856 ....S HLMSTATE("ACK TO","ERROR TEXT")=TEXT
    5957 ...D ADDSEG^HLOMSG(.HLMSTATE,.SEG)
     
    6866 .....S HLMSTATE("BATCH","ACK TO",SUBIEN)=OLDMSGID
    6967 .....S HLMSTATE("BATCH","ACK TO",SUBIEN,"ACK BY")=NEWMSGID
    70  .....S HLMSTATE("BATCH","ACK TO",SUBIEN,"STATUS")=$S(CODE="AA":"SU",1:"ER")
     68 .....S HLMSTATE("BATCH","ACK TO",SUBIEN,"STATUS")=$S(CODE="AA":"SU",1:"AE")
    7169 .....S:$D(IEN) HLMSTATE("BATCH","ACK TO",SUBIEN,"IEN")=IEN
    7270 ....D ADDSEG^HLOMSG(.HLMSTATE,.SEG)
     
    127125 ;  HLMSTATE("HDR") - the parsed header segment
    128126 ;Output:
    129  ;  HLMSTATE("STATUS")="ER" if an error is detected
     127 ;  HLMSTATE("STATUS")="SE" if an error is detected
    130128 ;  HLMSTATE("STATUS","QUEUE") queue to put the message on
    131129 ;  HLMSTATE("STATUS","ACTION")  <tag^rtn> that is the processing routine for the receiving application
     
    139137 E  D
    140138 .S WANTACK=1
    141  I HLMSTATE("ORIGINAL MODE") S HLMSTATE("MSA",1)="AE",HLMSTATE("MSA",3)="THIS INTERFACE DOES NOT IMPLEMENT ORIGINAL MODE APPLICATION ACKOWLEDGMENTS",HLMSTATE("STATUS")="ER" Q
     139 I HLMSTATE("ORIGINAL MODE") S HLMSTATE("MSA",1)="AE",HLMSTATE("MSA",3)="THIS INTERFACE DOES NOT IMPLEMENT ORIGINAL MODE APPLICATION ACKOWLEDGMENTS",HLMSTATE("STATUS")="SE" Q
    142140 I $G(HLMSTATE("ACK TO"))="" D  Q:ERROR
    143  .I '$$ACTION^HLOAPP(.HDR,.ACTION,.QUEUE) S ERROR=1 S:WANTACK HLMSTATE("MSA",1)="CR" S HLMSTATE("MSA",3)="RECEIVING APPLICATION NOT DEFINED",HLMSTATE("STATUS")="ER" Q
     141 .I '$$ACTION^HLOAPP(.HDR,.ACTION,.QUEUE) S ERROR=1 S:WANTACK HLMSTATE("MSA",1)="CR" S HLMSTATE("MSA",3)="RECEIVING APPLICATION NOT DEFINED",HLMSTATE("STATUS")="SE" Q
    144142 .S HLMSTATE("STATUS","ACTION")=$G(ACTION),HLMSTATE("STATUS","QUEUE")=$G(QUEUE)
    145143 E  D  Q:ERROR  ;this is an app ack
     
    147145 .N NODE
    148146 .S:+$G(HLMSTATE("ACK TO","IEN")) NODE=$G(^HLB(+HLMSTATE("ACK TO","IEN"),0))
    149  .I $G(NODE)="" S ERROR=1,HLMSTATE("STATUS")="ER",HLMSTATE("ACK TO","IEN")="" S:WANTACK HLMSTATE("MSA",1)="CE" S HLMSTATE("MSA",3)="INITIAL MESSAGE TO APPLICATION ACKNOWLEDGMENT NOT FOUND" Q
    150  .I $P(NODE,"^",7)'="",$P(NODE,"^",7)'=HLMSTATE("ID") S ERROR=1,HLMSTATE("STATUS")="ER",HLMSTATE("ACK TO","IEN")="" S:WANTACK HLMSTATE("MSA",1)="CE" S HLMSTATE("MSA",3)="INITIAL MESSAGE WAS ALREADY ACKED" Q
     147 .I $G(NODE)="" S ERROR=1,HLMSTATE("STATUS")="SE",HLMSTATE("ACK TO","IEN")="" S:WANTACK HLMSTATE("MSA",1)="CE" S HLMSTATE("MSA",3)="INITIAL MESSAGE TO APPLICATION ACKNOWLEDGMENT NOT FOUND" Q
     148 .I $P(NODE,"^",7)'="",$P(NODE,"^",7)'=HLMSTATE("ID") S ERROR=1,HLMSTATE("STATUS")="SE",HLMSTATE("ACK TO","IEN")="" S:WANTACK HLMSTATE("MSA",1)="CE" S HLMSTATE("MSA",3)="INITIAL MESSAGE WAS ALREADY ACKED" Q
    151149 .I ($P(NODE,"^",11)]"") S HLMSTATE("STATUS","ACTION")=$P(NODE,"^",10,11),HLMSTATE("STATUS","QUEUE")=$S($P(NODE,"^",6)]"":$P(NODE,"^",6),1:"DEFAULT")  Q
    152150 .;processing routine for the app ack wasn't found with the original message, look in the HLO Application Registry
     
    154152 .I $$ACTION^HLOAPP(.HDR,.ACTION,.QUEUE) S HLMSTATE("STATUS","ACTION")=$G(ACTION),HLMSTATE("STATUS","QUEUE")=$G(QUEUE)
    155153 ;
    156  I HDR("PROCESSING ID")'=HLCSTATE("SYSTEM","PROCESSING ID") S:WANTACK HLMSTATE("MSA",1)="CR" S HLMSTATE("STATUS")="ER",HLMSTATE("MSA",3)="SYSTEM PROCESSING ID="_HLCSTATE("SYSTEM","PROCESSING ID") Q
     154 I HDR("PROCESSING ID")'=HLCSTATE("SYSTEM","PROCESSING ID") S:WANTACK HLMSTATE("MSA",1)="CR" S HLMSTATE("STATUS")="SE",HLMSTATE("MSA",3)="SYSTEM PROCESSING ID="_HLCSTATE("SYSTEM","PROCESSING ID") Q
    157155 ;
    158156 ;wrong receiving facility?  This is hard to check if the sender is not VistA, because the HL7 standard permits different coding systems to be used. This check is only for DNS or station number.
     
    166164 .I $P(HDR("RECEIVING FACILITY",2),":")[HLCSTATE("SYSTEM","DOMAIN") S PASS=1 Q
    167165 .I HLCSTATE("SYSTEM","DOMAIN")[$P(HDR("RECEIVING FACILITY",2),":") S PASS=1 Q
    168  I 'PASS S HLMSTATE("STATUS")="ER",HLMSTATE("MSA",3)="RECEIVING FACILITY IS "_HLCSTATE("SYSTEM","DOMAIN") S:WANTACK HLMSTATE("MSA",1)="CE"
     166 I 'PASS S HLMSTATE("STATUS")="SE",HLMSTATE("MSA",3)="RECEIVING FACILITY IS "_HLCSTATE("SYSTEM","DOMAIN") S:WANTACK HLMSTATE("MSA",1)="CE"
    169167 I PASS,WANTACK S HLMSTATE("MSA",1)="CA"
    170168 Q
     
    215213 D END^HLOSRVR
    216214 ;
    217  ;multi-listener should stop execution, only a single server may continue
     215 ;concurrent server connections (multi-listener) should stop execution, only a single server may continue
    218216 I $P($G(HLCSTATE("LINK","SERVER")),"^",2)'="S" D  Q:$QUIT "" Q
    219  .;don't log these errors
     217 .;don't log these common errors
    220218 .I ($ECODE["READ")!($ECODE["NOTOPEN")!($ECODE["DEVNOTOPN")!($ECODE["WRITE")!($ECODE["OPENERR") D
    221219 ..;
     
    223221 ..D ^%ZTER
    224222 ;
    225  ;debugging?
     223 ;while debugging quit on all errors
    226224 I $G(^HLTMP("LOG ALL ERRORS"))!($ECODE["EDITED") Q:$QUIT "" Q
    227225 ;
    228  ;possibly an endless loop?
     226 ;a lot of errors of the same time may indicate an endless loop, so keep a count and quit if large count
    229227 N HOUR
    230228 S HOUR=$E($$NOW^XLFDT,1,10)
     229 ;
    231230 I ($G(^TMP("HL7 ERRORS",$J,HOUR,$P($ECODE,",",2)))>30) Q:$QUIT "" Q
    232231 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOSRVR2.m

    r628 r636  
    1 HLOSRVR2 ;ALB/CJM-HL7 - HLO Server ;07/20/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**131,137**;Oct 13, 1995;Build 21
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
     1HLOSRVR2 ;ALB/CJM-HL7 - Sends an application ack over an open connection, for original mode ;02/04/2004
     2 ;;1.6;HEALTH LEVEL SEVEN;**131**;Oct 13, 1995;Build 10
    43 ;
    54NEWMSG(HLCSTATE,HLMSTATE,HDR) ;
     
    4948 S HLMSTATE("MSA",2)=HLMSTATE("ID")
    5049 Q
     50 ;
     51ACKNOW(MSG,ERROR) ;
     52 ;Sends the messge immediately if there is an open connection, otherwise
     53 ;will return an error.
     54 ;
     55 N $ETRAP,$ESTACK S $ETRAP="G ERROR^HLOSRVR2"
     56 N SENT
     57 S SENT=0,ERROR=""
     58 I '$G(HLCSTATE("CONNECTED")) D
     59 .S ERROR="NOT CONNECTED"
     60 .S MSG("STATUS")="TF"
     61 E  S MSG("STATUS")="SU"
     62 S:'$G(MSG("DT/TM CREATED")) MSG("DT/TM CREATED")=$$NOW^XLFDT
     63 S MSG("STATUS","PURGE")=$$FMADD^XLFDT(MSG("DT/TM CREATED"),$S($G(HLCSTATE("ERROR PURGE")):HLCSTATE("ERROR PURGE"),1:7))
     64 D
     65 .I $G(MSG("UNSTORED LINES")),'$$SAVEMSG^HLOF777(.MSG) S ERROR="$$SAVE^HLOF777 FAILED!" Q
     66 .I '$$SAVEMSG^HLOF778(.MSG) S ERROR="$$SAVE^HLOF778 FAILED!" Q
     67 .Q:MSG("STATUS")'="SU"
     68 .I '$$WRITEMSG^HLOCLNT1(.HLCSTATE,.MSG) S ERROR="TRANSMISSION FAILURE" Q
     69 .S SENT=1
     70 .D COUNT^HLOSTAT(.HLCSTATE,ACK("HDR","RECEIVING APPLICATION"),ACK("HDR","SENDING APPLICATION"),ACK("HDR","MESSAGE TYPE")_"~"_ACK("HDR","EVENT"))
     71 ;
     72END ;
     73 I 'SENT,MSG("STATUS")="SU",$G(MSG("IEN")) D
     74 .Q:'$D(^HLB(MSG("IEN"),0))
     75 .S MSG("STATUS")="TF"
     76 .S MSG("STATUS","ERROR TEXT")=ERROR
     77 .S $P(^HLB(MSG("IEN"),0),"^",20)=MSG("STATUS")
     78 .S $P(^HLB(MSG("IEN"),0),"^",21)=MSG("STATUS","ERROR TEXT")
     79 .S ^HLB("ERRORS","TF",$S($L($G(MSG("HDR","RECEIVING APPLICATION"))):MSG("HDR","RECEIVING APPLICATION"),1:"UNKNOWN"),MSG("DT/TM CREATED"),IEN)=""
     80 ;
     81 Q SENT
     82 ;
     83ERROR ;error trap for ACKNOW
     84 S SENT=0,ERROR="TRANSMISSION FAILURE:"_$P($ECODE,",",1,2)
     85 S $ETRAP="D UNWIND^%ZTER"
     86 ;
     87 ;don't log some common errors
     88 I ($ECODE["READ")!($ECODE["NOTOPEN")!($ECODE["DEVNOTOPN")!($ECODE["WRITE")!($ECODE["OPENERR") D
     89 .;nothing!
     90 E  D
     91 .D ^%ZTER
     92 G END^HLOSRVR2
     93 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOTCP.m

    r628 r636  
    1 HLOTCP ;ALB/CJM- TCP/IP I/O - 10/4/94 1pm ;07/10/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,131,134,137**;Oct 13, 1995;Build 21
     1HLOTCP ;ALB/CJM- TCP/IP I/O - 10/4/94 1pm ;03/22/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,131,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    129129 ..S LINE=HLCSTATE("BUFFER",SEGMENT,I)
    130130 ..F  Q:'(J+$L(LINE)>MAX)  D
    131  ...W $E(LINE,1,MAX-J),@HLCSTATE("FLUSH") S HLCSTATE("FLUSHED")=1
     131 ...W $E(LINE,1,MAX-J),@HLCSTATE("FLUSH")
    132132 ...S LINE=$E(LINE,(MAX-J)+1,99999)
    133133 ...S J=0
    134  ..I (LINE]"") W LINE S HLCSTATE("FLUSHED")=0
     134 ..W:(LINE]"") LINE
    135135 K HLCSTATE("BUFFER")
    136136 S HLCSTATE("BUFFER","SEGMENT COUNT")=1
     
    203203 .D FLUSH
    204204 .U HLCSTATE("DEVICE")
    205  .I ('$G(HLCSTATE("FLUSHED")))!$X W @HLCSTATE("FLUSH") S HLCSTATE("FLUSHED")=1
     205 .W:$X @HLCSTATE("FLUSH")
    206206 Q 0
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOTLNK.m

    r628 r636  
    1 HLOTLNK ;IRMFO-ALB/CJM - APIs for the HL Logical Link file;03/24/2004  14:43
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,131**;Oct 13, 1995;Build 10
     1HLOTLNK ;IRMFO-ALB/CJM - APIs for the HL Logical Link file;03/24/2004  14:43 ;1/23/07  16:59
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,131,135**;Oct 13, 1995;Build 10
     3 ; Modified from FOIA VISTA,
     4 ; Copyright (C) 2007 WorldVistA
     5 ;
     6 ; This program is free software; you can redistribute it and/or modify
     7 ; it under the terms of the GNU General Public License as published by
     8 ; the Free Software Foundation; either version 2 of the License, or
     9 ; (at your option) any later version.
     10 ;
     11 ; This program is distributed in the hope that it will be useful,
     12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 ; GNU General Public License for more details.
     15 ;
     16 ; You should have received a copy of the GNU General Public License
     17 ; along with this program; if not, write to the Free Software
     18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
     19 ;
     20 ;;  VWSD LOGICAL TO ALLOW A NON-VA STATION ( NODE )WITH $D(HLVWNOVA) VARIABLE EXIST FOR HL LOGICAL LINKS
    321 ;
    422SETSHUT(LINKIEN) ;
     
    6482 ;reserved for officially released links associated with VHA institutions
    6583 ;** EXCEPTION** MPIVA is an official link associated with 200M
    66  ;
     84 ;***LOCAL VWSD - ALLOW NON-VA STATION (NODE) AS VARIABLE HLVWNOVA TO BE USED TO DETERMINE FACILITY LINK
    6785 Q:'$L($G(STATN)) 0
    6886 ;
    6987 N NAME,IEN
    7088 S (NAME,IEN)=""
    71  F  S NAME=$O(^HLCS(870,"AC",STATN,NAME)) Q:NAME=""  I (NAME'="VA-VIE"),($E(NAME,1,2)="VA")!(NAME="MPIVA") S IEN=$O(^HLCS(870,"AC",STATN,NAME,0)) Q
     89 ; START LOCAL MOD VWSD FLAG HLVWNOVA
     90 ; F  S NAME=$O(^HLCS(870,"AC",STATN,NAME)) Q:NAME=""  I (NAME'="VA-VIE"),($E(NAME,1,2)="VA")!(NAME="MPIVA") S IEN=$O(^HLCS(870,"AC",STATN,NAME,0)) Q
     91 F  S NAME=$O(^HLCS(870,"AC",STATN,NAME)) Q:NAME=""  I (NAME'="VA-VIE"),(($E(NAME,1,2)="VA")!(NAME="MPIVA"))!$D(HLVWNOVA) S IEN=$O(^HLCS(870,"AC",STATN,NAME,0)) Q
     92 ;END LOCAL MOD
    7293 Q IEN
    7394 ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOUSR.m

    r628 r636  
    1 HLOUSR ;ALB/CJM -ListManager Screen for viewing system status;12 JUN 1997 10:00 am ;07/30/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,130,134,137**;Oct 13, 1995;Build 21
     1HLOUSR ;ALB/CJM -ListManager Screen for viewing system status;12 JUN 1997 10:00 am ;02/07/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,130,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
    55EN ;
    66 ;
    7  N HLSCREEN,TESTOPEN,HLRFRSH,HLPARMS
     7 N HLSCREEN,TESTOPEN,HLRFRSH
    88 D WAIT^DICD
    99 D EN^VALM("HLO SYSTEM MONITOR")
    1010 Q
    1111 ;
    12 BRIEF ;
     12BRIEF ;Init variables and list array
    1313 N COUNT,LINK,QUE,FROM,TIME,STATUS,TEMP,DIR,TODAY,LIST
    1414 S HLRFRSH="BRIEF^HLOUSR"
    1515 S (HLSCREEN,VALMSG)="Brief System Status"
    16  S VALMCNT=16
     16 S VALMCNT=8
    1717 ;K @VALMAR
    1818 D CLEAN^VALM10
    1919 S VALMBG=1
    2020 S VALMBCK="R"
    21  S VALMDDF("COL 1")="COL1^1^80^"
    2221 K VALMDDF("COL 2"),VALMDDF("COL 3"),VALMDDF("COL 4"),VALMDDF("COL 5")
    23  D CHGCAP^VALM("COL 1"," Brief Operational Overview")
     22 D CHGCAP^VALM("COL 1","Brief Operational Overview")
    2423 S @VALMAR@(1,0)="SYSTEM STATUS:             "_$S($$CHKSTOP^HLOPROC:"STOPPED",1:"RUNNING")
    2524 S @VALMAR@(2,0)="PROCESS MANAGER:           "_$S($$RUNNING:"RUNNING",1:"STOPPED")
     
    5554 ..S TEMP=$G(^HLC("QUEUECOUNT","OUT",LINK,QUE))
    5655 ..S:TEMP>0 COUNT=COUNT+TEMP
    57  S @VALMAR@(8,0)="MESSAGES PENDING ON OUT QUEUES:    "_$$RJ(+COUNT,7)_"     ON SEQUENCE QUEUES:  "_$$RJ(+$G(^HLC("QUEUECOUNT","SEQUENCE")),7)
     56 S @VALMAR@(8,0)="MESSAGES PENDING TRANSMISSION:      "_+COUNT
    5857 S TEMP="STOPPED OUTGOING QUEUES: "
    5958 S COUNT=0,QUE=""
     
    6665 ..S TEMP=$G(^HLC("QUEUECOUNT","IN",QUE,FROM))
    6766 ..S:TEMP>0 COUNT=COUNT+TEMP
    68  S @VALMAR@(10,0)="MESSAGES PENDING ON APPLICATIONS: "_$$RJ(+COUNT,7)
     67 S @VALMAR@(10,0)="MESSAGES PENDING ON APPLICATIONS:   "_+COUNT
    6968 S TEMP="STOPPED INCOMING QUEUES: "
    7069 S COUNT=0,QUE=""
     
    9392 Q TOTAL
    9493 ;
    95 HELP ;
     94HELP ;Help code
    9695 S X="?" D DISP^XQORM1 W !!
    9796 Q
    9897 ;
    99 EXIT ;
     98EXIT ;Exit code
    10099 D CLEAN^VALM10
    101100 D CLEAR^VALM1
    102  Q
    103  ;
    104 EXPND ;
     101 ;
     102 Q
     103 ;
     104EXPND ;Expand code
    105105 Q
    106106 ;
     
    111111 S VALMCNT=0
    112112 S VALMBCK="R"
    113  S VALMDDF("COL 1")="COL1^1^34^"
    114113 S VALMDDF("COL 2")="COL 2^35^10^MIN^H"
    115114 S VALMDDF("COL 3")="COL 3^47^10^MAX^H"
     
    194193 S VALMBCK="R"
    195194 ;
    196  ;currently HL7 (Optimized) only does TCP
     195 ;currently HL7 (Optimized) only does TCP, when serial added a change is needed here
    197196 S LINK=$$ASKLINK
    198197 Q:LINK=""
     
    215214 Q $$RJ^XLFSTR($E(STRING,1,LEN),LEN)
    216215 ;
    217 RUNNING() ;Process Manager running?
     216RUNNING() ;Is the Process Manager running?
    218217 N RUNNING
    219218 L +^HLTMP("PROCESS MANAGER"):0
     
    257256 Q
    258257 ;
    259 UPDMODE ;realtime
     258UPDMODE ;update mode
    260259 Q:'$L(HLRFRSH)
    261  N TOP,BOTTOM,DX,DY,IOTM,IOBM,LINE,OLD,OLDCNT
    262  S OLDCNT=VALMCNT
    263  W !!!!!,IOINHI,"Hit any key to escape realtime display mode...",IOINORM
    264  S IOTM=20,IOBM=23 W @IOSTBM
     260 N QUIT,NEW,TOP,BOTTOM,DX,DY,IOTM,IOBM,I
     261 W !!,IOINHI,"Hit any key to escape realtime display mode...",IOINORM
     262 S IOTM=3,IOBM=23
     263 W @IOSTBM
     264 S DX=1,DY=$S(VALMCNT<17:VALMCNT+1,1:17) X IOXY
     265 I VALMCNT>16 F I=17:1:$S(VALMCNT<22:VALMCNT,1:21) W !,@VALMAR@(I,0)
     266 S QUIT=0
    265267 S TOP=VALMBG
    266  S BOTTOM=TOP+20
    267  F LINE=TOP:1:BOTTOM D
    268  .I LINE>VALMCNT S @VALMAR@(LINE,0)=$$LJ(" ",80) Q
    269  .S @VALMAR@(LINE,0)=$$LJ(@VALMAR@(LINE,0),80)
    270  F LINE=TOP:1:BOTTOM D
    271  .S OLD(LINE)=@VALMAR@(LINE,0)
    272  F LINE=17:1:BOTTOM D
    273  .S DX=50,DY=22 X IOXY W !
    274  .D WRITE^VALM10(LINE)
    275  D  F  R *C:4 Q:$T  D
     268 S BOTTOM=TOP+23
     269 S OLD=VALMAR
     270 S VALMAR="NEW"
     271 S VALMCNT=0
     272 F  D  Q:QUIT
     273 .N LINE
     274 .R *C:3 I $T S QUIT=1
     275 .S (VALMCNT,I)=0
    276276 .D @HLRFRSH
    277  .F LINE=TOP:1:BOTTOM D
    278  ..I LINE>VALMCNT S @VALMAR@(LINE,0)=$$LJ(" ",80) Q
    279  ..S @VALMAR@(LINE,0)=$$LJ(@VALMAR@(LINE,0),80)
    280  .S VALMCNT=BOTTOM
    281  .F LINE=TOP:1:BOTTOM IF OLD(LINE)'=@VALMAR@(LINE,0) D
    282  ..S OLD(LINE)=@VALMAR@(LINE,0)
    283  ..S DX=50,DY=22 X IOXY W !
     277 .F LINE=TOP:1:BOTTOM IF $G(@OLD@(LINE,0))'=$G(@VALMAR@(LINE,0)) D
     278 ..S:'$D(@VALMAR@(LINE,0)) @VALMAR@(LINE,0)=" "
    284279 ..D WRITE^VALM10(LINE)
    285  S VALMCNT=OLDCNT
    286  S VALMBCK="R"
    287  Q
     280 K @OLD M @OLD=@VALMAR S VALMAR=OLD
     281 S VALMBCK="R"
     282 Q
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOUSR1.m

    r628 r636  
    1 HLOUSR1 ;ALB/CJM -ListManager Screen for viewing messages;12 JUN 1997 10:00 am ;07/25/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,137**;Oct 13, 1995;Build 21
     1HLOUSR1 ;ALB/CJM -ListManager Screen for viewing messages;12 JUN 1997 10:00 am ;03/19/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    101101 S @VALMAR@($$I,0)="Dir:   "_$$LJ($S(MSG("DIRECTION")="IN":"INCOMING",1:"OUTGOING"),10)_$$LJ("  Trans Dt/Tm: ",12)_$$FMTE^XLFDT(MSG("DT/TM"),2)_$$LJ("  Purge DT/TM: ",8)_$$FMTE^XLFDT(MSG("STATUS","PURGE"),2)
    102102 S @VALMAR@($$I,0)="Link:  "_$$LJ(MSG("STATUS","LINK NAME"),29)_"   "_$$LJ("Queue: ",13)_MSG("STATUS","QUEUE")
    103  I $L($G(MSG("STATUS","SEQUENCE QUEUE"))) D
    104  .S @VALMAR@($$I,0)="Sequence Queue: "_MSG("STATUS","SEQUENCE QUEUE")_"    Moved: "_$S(MSG("STATUS","MOVED TO OUT QUEUE"):"YES",1:"NO")
    105103 I MSG("STATUS","ACCEPT ACK'D") D
    106  .S @VALMAR@($$I,0)="Accept Ack: "_$$LJ(MSG("STATUS","ACCEPT ACK ID"),26)_$$LJ(" DT/TM Ack'd: ",14)_$$FMTE^XLFDT(MSG("STATUS","ACCEPT ACK DT/TM"),2)
     104 .S @VALMAR@($$I,0)="Accept Ack: "_$$LJ(MSG("STATUS","ACCEPT ACK ID"),26)_$$LJ(" At: ",14)_$$FMTE^XLFDT(MSG("STATUS","ACCEPT ACK DT/TM"),2)
    107105 .S @VALMAR@($$I,0)="   "_MSG("STATUS","ACCEPT ACK MSA")
    108106 I MSG("DIRECTION")="IN" D
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLOUSR2.m

    r628 r636  
    1 HLOUSR2 ;ALB/CJM -ListManager Screen for viewing messages(continued);12 JUN 1997 10:00 am ;07/17/2007
    2  ;;1.6;HEALTH LEVEL SEVEN;**126,134,137**;Oct 13, 1995;Build 21
     1HLOUSR2 ;ALB/CJM -ListManager Screen for viewing messages(continued);12 JUN 1997 10:00 am ;03/19/2007
     2 ;;1.6;HEALTH LEVEL SEVEN;**126,134**;Oct 13, 1995;Build 30
    33 ;Per VHA Directive 2004-038, this routine should not be modified
    44 ;
     
    88 Q
    99 ;
    10 SHOWLIST ;
     10SHOWLIST(TYPE) ;
     11 ;TYPE= "SE", "AE", "TF"
    1112 N PARMS,I,ERRCOUNT
    1213 S (VALMBG,VALMCNT,I,ERRCOUNT)=0
     
    1718 .N APP
    1819 .S APP=""
    19  .F  S APP=$O(^HLB("ERRORS",APP)) Q:APP=""  D  Q:ERRCOUNT>PARMS("MAX")
     20 .F  S APP=$O(^HLB("ERRORS",TYPE,APP)) Q:APP=""  D  Q:ERRCOUNT>PARMS("MAX")
    2021 ..N TIME,IEN
    2122 ..S TIME=PARMS("START")
    22  ..Q:($O(^HLB("ERRORS",APP,TIME))="")
     23 ..Q:($O(^HLB("ERRORS",TYPE,APP,TIME))="")
    2324 ..S @VALMAR@($$I,0)="Application: "_APP
    2425 ..D CNTRL^VALM10(VALMCNT,14,$L(APP),IOINHI,IOINORM)
    25  ..F  S TIME=$O(^HLB("ERRORS",APP,TIME)) Q:'TIME  Q:ERRCOUNT>PARMS("MAX")  S IEN="" F  S IEN=$O(^HLB("ERRORS",APP,TIME,IEN)) Q:IEN=""  D ADDTO(IEN,TIME,.ERRCOUNT) Q:ERRCOUNT>PARMS("MAX")
     26 ..F  S TIME=$O(^HLB("ERRORS",TYPE,APP,TIME)) Q:'TIME  Q:ERRCOUNT>PARMS("MAX")  S IEN="" F  S IEN=$O(^HLB("ERRORS",TYPE,APP,TIME,IEN)) Q:IEN=""  D ADDTO(TYPE,IEN,TIME,.ERRCOUNT) Q:ERRCOUNT>PARMS("MAX")
    2627 E  D
    2728 .N APP
     
    2930 .N TIME,IEN
    3031 .S TIME=PARMS("START")
    31  .Q:$O(^HLB("ERRORS",APP,TIME))=""
     32 .Q:$O(^HLB("ERRORS",TYPE,APP,TIME))=""
    3233 .S @VALMAR@($$I,0)="Application: "_APP
    3334 .D CNTRL^VALM10(VALMCNT,14,$L(APP),IOINHI,IOINORM)
    34  .F  S TIME=$O(^HLB("ERRORS",APP,TIME)) Q:'TIME  Q:ERRCOUNT>PARMS("MAX")  S IEN="" F  S IEN=$O(^HLB("ERRORS",APP,TIME,IEN)) Q:IEN=""  D ADDTO(IEN,TIME,.ERRCOUNT) Q:ERRCOUNT>PARMS("MAX")
     35 .F  S TIME=$O(^HLB("ERRORS",TYPE,APP,TIME)) Q:'TIME  Q:ERRCOUNT>PARMS("MAX")  S IEN="" F  S IEN=$O(^HLB("ERRORS",TYPE,APP,TIME,IEN)) Q:IEN=""  D ADDTO(TYPE,IEN,TIME,.ERRCOUNT) Q:ERRCOUNT>PARMS("MAX")
    3536 ;
    3637SHOW S VALMBCK="R"
    3738 ;
    3839 Q
    39 ADDTO(IEN,TIME,ERRCOUNT) ;
     40ADDTO(LTYPE,IEN,TIME,ERRCOUNT) ;
    4041 N NODE,MSG
    4142 Q:'$$GETMSG^HLOMSG(+IEN,.MSG)
    4243 S ERRCOUNT=ERRCOUNT+1
    43  ;application errors could be an error to a msg within a batch
    44  ;also, need to go to the ack msg to get the error text from the MSA segment
    45  ;
    46  N SUBIEN,MSA,ERRTEXT
    47  S (ERRTEXT,MSA)=""
    48  S SUBIEN=$P(IEN,"^",2)
    49  ;within batch?
    50  D:SUBIEN GETMSGB^HLOMSG1(.MSG,SUBIEN,.MSG)
    51  S ERRTEXT=MSG("STATUS","ERROR TEXT")
    52  I ERRTEXT="",MSG("ACK BY")]"",($$FINDMSG^HLOMSG1(MSG("ACK BY"),.LIST)=1) D
    53  .N MSG,SEG,FS,AIEN
    54  .S AIEN=+LIST(1),SUBIEN=$P(LIST(1),"^",2)
    55  .Q:'$$GETMSG^HLOMSG(AIEN,.MSG)
    56  .I SUBIEN S MSG("BATCH","CURRENT MESSAGE")=SUBIEN,MSG("LINE COUNT")=0
    57  .F  Q:'$$HLNEXT^HLOMSG(.MSG,.SEG)  I $E(SEG(1),1,3)="MSA" S MSA=SEG(1),FS=$E(MSA,4),ERRTEXT=$P(MSA,FS,4) Q
    58  I ERRTEXT="",MSG("ACK BY")="" D
    59  .N FS
    60  .S FS=$E(MSG("HDR",1),4)
    61  .I $L(FS) S ERRTEXT=$P($G(MSG("STATUS","ACCEPT ACK MSA")),FS,4)
    62  S @VALMAR@($$I,0)="  "_$$LJ(MSG("ID"),15)_$$LJ(MSG("MESSAGE TYPE")_"~"_MSG("EVENT"),8)_$$LJ($$FMTE^XLFDT(MSG("DT/TM CREATED"),2),20)_$E(ERRTEXT,1,35)
    63  D CNTRL^VALM10(VALMCNT,3,15,IOINHI,IOINORM)
    64  I $L(ERRTEXT)>35 D
    65  .S @VALMAR@($$I,0)=$$RJ(" ",45)_$E(ERRTEXT,36,115)
    66  S:MSG("ID")]"" @VALMAR@("INDEX",MSG("ID"))=IEN
     44 I LTYPE'="AE" D
     45 .N TYPE
     46 .S TYPE=$S(MSG("BATCH"):"BATCH",1:MSG("MESSAGE TYPE")_"~"_MSG("EVENT"))
     47 .S @VALMAR@($$I,0)="  "_$$LJ(MSG("ID"),15)_$$LJ(TYPE,8)_$$LJ($$FMTE^XLFDT(TIME,2),20)_MSG("STATUS","ERROR TEXT")
     48 .D CNTRL^VALM10(VALMCNT,3,15,IOINHI,IOINORM)
     49 .S:MSG("ID")]"" @VALMAR@("INDEX",MSG("ID"))=IEN
     50 E  D
     51 .;application errors - could be an error to a msg within a batch
     52 .;also, need to go to the ack msg to get the error text from the MSA segment
     53 .;
     54 .N SUBIEN,MSA,ERRTEXT
     55 .S (ERRTEXT,MSA)=""
     56 .S SUBIEN=$P(IEN,"^",2)
     57 .;within batch?
     58 .D:SUBIEN GETMSGB^HLOMSG1(.MSG,SUBIEN,.MSG)
     59 .S ERRTEXT=MSG("STATUS","ERROR TEXT")
     60 .I ERRTEXT="",MSG("ACK BY")]"",($$FINDMSG^HLOMSG1(MSG("ACK BY"),.LIST)=1) D
     61 ..N MSG,SEG,FS,AIEN
     62 ..S AIEN=+LIST(1),SUBIEN=$P(LIST(1),"^",2)
     63 ..Q:'$$GETMSG^HLOMSG(AIEN,.MSG)
     64 ..I SUBIEN S MSG("BATCH","CURRENT MESSAGE")=SUBIEN,MSG("LINE COUNT")=0
     65 ..F  Q:'$$HLNEXT^HLOMSG(.MSG,.SEG)  I $E(SEG(1),1,3)="MSA" S MSA=SEG(1),FS=$E(MSA,4),ERRTEXT=$P(MSA,FS,4) Q
     66 .S @VALMAR@($$I,0)="  "_$$LJ(MSG("ID"),15)_$$LJ(MSG("MESSAGE TYPE")_"~"_MSG("EVENT"),8)_$$LJ($$FMTE^XLFDT(MSG("DT/TM CREATED"),2),20)_$E(ERRTEXT,1,37)
     67 .D CNTRL^VALM10(VALMCNT,3,15,IOINHI,IOINORM)
     68 .I $L(ERRTEXT)>37 D
     69 ..S @VALMAR@($$I,0)="~"_$E(ERRTEXT,38,112)
     70 ..D CNTRL^VALM10(VALMCNT,1,1,IORVON,IORVOFF)
     71 .S:MSG("ID")]"" @VALMAR@("INDEX",MSG("ID"))=IEN
    6772 Q
    6873 ;
     
    95100 N DIR
    96101 S DIR(0)="F^3:60"
    97  S DIR("A")="Receiving Application"
     102 S DIR("A")="Application"
    98103 S DIR("?")="Enter the full name of the application, or '^' to exit."
     104 S DIR("?",1)="For transmission failures, enter the sending application. "
     105 S DIR("?",2)="For other errors, enter the name of the receiving application. "
    99106 D ^DIR
    100107 I $D(DIRUT)!(Y="") Q ""
     
    221228LJ(STRING,LEN) ;
    222229 Q $$LJ^XLFSTR(STRING,LEN)
    223 RJ(STRING,LEN) ;
    224  Q $$RJ^XLFSTR(STRING,LEN)
    225230 ;
    226231I() ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTF.m

    r628 r636  
    1 HLTF ;AISC/SAW,JRP-Create/Process Message Text File Entries ;10/17/2007  09:41
    2  ;;1.6;HEALTH LEVEL SEVEN;**1,19,43,55,109,120,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
    5  Q
    6  ;
     1HLTF ;AISC/SAW,JRP-Create/Process Message Text File Entries ;01/23/06  12:56
     2 ;;1.6;HEALTH LEVEL SEVEN;**1,19,43,55,109,120**;Oct 13, 1995;Build 12
    73FILE ;Create Entries in files 772 and 773 for Version 1.5 Interface Only
    84 D CREATE(,.HLDA,.HLDT,.HLDT1)
     
    7571MA(X,HLMID) ;X=ien in file 772, HLMID=msg. id (passed by ref.)
    7672 ;return ien in file 773
    77  ;
    78  ; patch HL*1.6*122: MPI-client/server start
    79  F  L +^HL(772,+$G(X)):10 Q:$T  H 1
    8073 Q:'$G(^HL(772,X,0)) 0
    81  L -^HL(772,+$G(X))
    82  ; patch HL*1.6*122: MPI-client/server end
    83  ;
    8474 N DA,DD,DO,DIC,DIE,DR,HLDA,HLCNT,HLJ,Y
    8575 S DIC="^HLMA(",DIC(0)="L"
     
    118108OUT(HLDA,HLMID,HLMTN) ;File Data in Message Text File for Outgoing Message
    119109 ;Version 1.5 Interface Only
    120  ;
    121  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    122  ; OUT, IN, and ACK to HLTF2 routine.
    123  ;
    124  D OUT^HLTF2($G(HLDA),$G(HLMID),$G(HLMTN))
     110 Q:'$D(HLFS)
     111 ;
     112 I HLMTN="ACK"!(HLMTN="MCF")!(HLMTN="ORR") Q:'$D(HLMSA)  D ACK(HLMSA,"I") Q
     113 ;
     114 ;-- if message contained MSA find inbound message
     115 I $D(HLMSA),$D(HLNDAP),$P(HLMSA,HLFS,3)]"" D
     116 . N HLDAI
     117 . S HLDAI=0
     118 . F  S HLDAI=$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),$P(HLMSA,HLFS,3),HLDAI)) Q:'HLDAI!($P($G(^HL(772,+HLDAI,0)),U,4)="I")
     119 . I 'HLDAI K HLDAI
     120 ;
     121 D STUFF^HLTF0("O")
     122 ;
     123 N HLAC S HLAC=$S($D(HLERR):4,'$P(HLNDAP0,"^",10):1,1:2) D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
     124 D:$D(HLCHAR) STATS^HLTF0(HLDA,HLCHAR,$G(HLEVN))
     125 ;
     126 ;-- update status if MSA and found inbound message
     127 I $D(HLMSA),$D(HLDAI) D
     128 .N HLERR,HLMSG I $P(HLMSA,HLFS,4)]"" S HLERR=$P(HLMSA,HLFS,4)
     129 .S HLAC=$P(HLMSA,HLFS,2)
     130 .I HLAC'="AA" S HLMSG=$S(HLAC="AR":"Application Reject",HLAC="AE":"Application Error",1:"")_" - "_HLERR
     131 .S HLAC=$S(HLAC'="AA":4,1:3) D STATUS^HLTF0(HLDAI,HLAC,$G(HLMSG))
    125132 Q
    126133 ;
    127134IN(HLMTN,HLMID,HLTIME) ;File Data in Message Text File for Incoming Message
    128135 ;Version 1.5 Interface Only
    129  ;
    130  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    131  ; OUT, IN, and ACK to HLTF2 routine.
    132  ;
    133  D IN^HLTF2($G(HLMTN),$G(HLMID),$G(HLTIME))
     136 Q:'$D(HLFS)
     137 I HLMTN="ACK"!(HLMTN="MCF")!(HLMTN="ORR") Q:'$D(HLMSA)  D ACK(HLMSA,"O",$G(HLDA)) Q
     138 ;
     139 N HLDAI S HLDA=0
     140 I $D(HLNDAP),HLMID]"" D
     141 .F  S HLDA=+$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),HLMID,HLDA)) Q:'HLDA!($P($G(^HL(772,+HLDA,0)),U,4)="I")
     142 .I HLDA D
     143 ..S HLDT=+$P($G(^HL(772,HLDA,0)),"^"),HLDT1=$$HLDATE^HLFNC(HLDT)
     144 ..K ^HL(772,HLDA,"IN")
     145 .I $D(HLMSA),$P(HLMSA,HLFS,3)]"" D
     146 ..S HLDAI=0
     147 ..F  S HLDAI=$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),$P(HLMSA,HLFS,3),HLDAI)) Q:'HLDAI!($P($G(^HL(772,+HLDAI,0)),U,4)="O")
     148 ..I 'HLDAI K HLDAI
     149 ;
     150 I 'HLDA D CREATE(.HLMID,.HLDA,.HLDT,.HLDT1) K HLZ
     151 ;
     152 D STUFF^HLTF0("I")
     153 N HLAC S HLAC=$S($D(HLERR):4,1:1) D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
     154 ;
     155 D MERGE15^HLTF1("G",HLDA,"HLR",HLTIME)
     156 ;
     157 I '$D(HLERR),$D(HLMSA),$D(HLDAI) D
     158 .N HLAC,HLERR,HLMSG I $P(HLMSA,HLFS,4)]"" S HLERR=$P(HLMSA,HLFS,4)
     159 .S HLAC=$P(HLMSA,HLFS,2) I HLAC'="AA" S HLMSG=$S(HLAC="AR":"Application Reject",1:"Application Error")_" - "_HLERR
     160 .S HLAC=$S(HLAC'="AA":4,1:3) D STATUS^HLTF0(HLDAI,HLAC,$G(HLMSG))
    134161 Q
    135162 ;
    136163ACK(HLMSA,HLIO,HLDA) ;Process 'ACK' Message Type - Version 1.5 Interface Only
    137  ;
    138  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    139  ; OUT, IN, and ACK to HLTF2 routine.
    140  ;
    141  D ACK^HLTF2($G(HLMSA),$G(HLIO),$G(HLDA))
     164 ; To determine the correct message to link the ACK, HLIO is used.
     165 ; For an ack from DHCP (original message from remote system) then
     166 ; HLIO should be "I" so that the correct inbound message is ack-ed. For
     167 ; an inbound ack (original message outbound from DHCP) HLIO should be
     168 ; "O". This distinction must be made due to the possible duplicate
     169 ; message ids from a bi-direction interface.
     170 ;
     171 ; Input : MSA - MSA from ACK message.
     172 ;         HLIO - Either "I" or "O" : See note above.
     173 ;Output : None
     174 ;
     175 N HLAC,HLMIDI
     176 ;-- set up required vars
     177 S HLAC=$P(HLMSA,HLFS,2),HLMIDI=$P(HLMSA,HLFS,3)
     178 ;-- quit
     179 Q:HLMIDI']""!(HLAC']"")!('$D(HLNDAP))
     180 ;-- find message to ack
     181 I '$G(HLDA) S HLDA=0 D
     182 . F  S HLDA=+$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),HLMIDI,HLDA)) Q:'HLDA!($P($G(^HL(772,+HLDA,0)),U,4)=HLIO)
     183 ;-- quit if no message
     184 Q:'$D(^HL(772,+HLDA,0))
     185 ;-- check for error
     186 I $P(HLMSA,HLFS,4)]"" N HLERR S HLERR=$P(HLMSA,HLFS,4)
     187 I $D(HLERR),'$D(HLMSG) N HLMSG S HLMSG="Error During Receipt of Acknowledgement Message"_$S(HLAC="AR":" - Application Reject",HLAC="AE":" - Application Error",1:"")_" - "_HLERR
     188 ;-- update status
     189 S HLAC=$S(HLMTN="MCF":2,HLAC'="AA":4,1:3)
     190 D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
    142191 Q
    143192 ;
     
    152201 I '$L($G(OS)) N OS S OS=$G(^%ZOSF("OS"))
    153202 ;
    154  I OS'["DSM",OS'["OpenM" D
     203 ; patch HL*1.6*120, protect Else command
     204 ; I OS'["DSM",OS'["OpenM" D
     205 I OS'["DSM",OS'["OpenM" D  I 1
    155206 .F  L +^HLCS(869.3,1,772):10 S IEN=+$G(^HLCS(869.3,1,772))+1,^HLCS(869.3,1,772)=IEN S:$D(^HL(772,IEN)) IEN=0,^HLCS(869.3,1,772)=($O(^HL(772,":"),-1)\1) L -^HLCS(869.3,1,772) Q:IEN
    156207 E  D
    157208 .F  S IEN=$I(^HLCS(869.3,1,772),1) S:$D(^HL(772,IEN)) IEN=0,^HLCS(869.3,1,772)=($O(^HL(772,":"),-1)\1) Q:IEN
    158  ;
    159  ; patch HL*1.6*122: MPI-client/server start
    160  F  L +^HL(772,IEN):10 Q:$T  H 1
    161209 S ^HL(772,IEN,0)=$G(FLD01)_"^"
    162210 I $L($G(FLD01)) S ^HL(772,"B",FLD01,IEN)=""
    163  L -^HL(772,IEN)
    164  ; patch HL*1.6*122: MPI-client/server end
    165  ;
    166211 Q IEN
    167212 ;
     
    176221 I '$L($G(OS)) N OS S OS=$G(^%ZOSF("OS"))
    177222 ;
    178  I OS'["DSM",OS'["OpenM" D
     223 ; patch HL*1.6*120, protect Else command
     224 ; I OS'["DSM",OS'["OpenM" D
     225 I OS'["DSM",OS'["OpenM" D  I 1
    179226 .F  L +^HLCS(869.3,1,773):10 S IEN=+$G(^HLCS(869.3,1,773))+1,^HLCS(869.3,1,773)=IEN S:$D(^HLMA(IEN)) IEN=0,^HLCS(869.3,1,773)=($O(^HLMA(":"),-1)\1) L -^HLCS(869.3,1,773) Q:IEN
    180227 E  D
    181228 .F  S IEN=$I(^HLCS(869.3,1,773),1) S:$D(^HLMA(IEN)) IEN=0,^HLCS(869.3,1,773)=($O(^HLMA(":"),-1)\1) Q:IEN
    182  ;
    183  ; patch HL*1.6*122: MPI-client/server
    184  F  L +^HLMA(IEN):10 Q:$T  H 1
    185229 S ^HLMA(IEN,0)=$G(FLD01)_"^"
    186230 I $L($G(FLD01)) S ^HLMA("B",FLD01,IEN)=""
    187  L -^HLMA(IEN)
    188  ;
    189231 Q IEN
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTF1.m

    r628 r636  
    1 HLTF1 ;AISC/SAW/MTC-Process Message Text File Entries (Cont'd) ;10/17/2007  09:43
    2  ;;1.6;HEALTH LEVEL SEVEN;**5,8,22,25,19,78,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     1HLTF1 ;AISC/SAW/MTC-Process Message Text File Entries (Cont'd) ;09/10/98  11:21
     2 ;;1.6;HEALTH LEVEL SEVEN;**5,8,22,25,19,78**;Oct 13, 1995
    53MERGE15(ARAYTYPE,MTIEN,SUB1,SUB2) ;Merge Local/Global Array From Application into
    64 ;Message Text File
     
    6967 N HLCHAR,HLEVN,HLFS,I,X,X1,X2,X3 S (HLCHAR,HLEVN,X)=0
    7068 ;
    71  ; patch HL*1.6*122: MPI-client/server
    72  F  L +^HL(772,+$G(MTIEN)):10 Q:$T  H 1
    73  ;
    7469 ;Merge data from a global array with two subscript
    7570 I ARAYTYPE="G",$G(SUB2)'="" D
     
    105100 ;-- update 0 node for message text
    106101 S ^HL(772,MTIEN,"IN",0)="^^"_I_"^"_I_"^"_$$DT^XLFDT_"^"
    107  ;
    108  ; patch HL*1.6*122: MPI-client/server
    109  L -^HL(772,+$G(MTIEN))
    110102 ;
    111103 ;File message statistics
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTF2.m

    r628 r636  
    1 HLTF2 ;AISC/SAW/MTC-Process Message Text File Entries (Cont'd) ;10/17/2007  09:44
    2  ;;1.6;HEALTH LEVEL SEVEN;**25,122**;Oct 13, 1995;Build 14
    3  ;Per VHA Directive 2004-038, this routine should not be modified.
    4  ;
     1HLTF2 ;AISC/SAW/MTC-Process Message Text File Entries (Cont'd) ;02/24/97  13:56
     2 ;;1.6;HEALTH LEVEL SEVEN;**25**;Oct 13, 1995
    53MERGEIN(LLD0,LLD1,MTIEN,HDR,MSA) ;Merge Data From Communication Server
    64 ;Module Logical Link File into Message Text File
     
    2725 N FLG,HLCHAR,HLEVN,HLFS,I,X,X1,HLDONE
    2826 S (FLG,HLCHAR,HLEVN,X)=0
    29  ;
    30  ; patch HL*1.6*122: MPI-client/server
    31  F  L +^HL(772,+$G(MTIEN)):10 Q:$T  H 1
    3227 ;
    3328 ;Move data from Logical Link file to Message Text file
     
    5651 S ^HL(772,MTIEN,"IN",0)="^^"_I_"^"_I_"^"_$$DT^XLFDT_"^"
    5752 ;Update statistics in Message Text file for this entry
    58  ;
    59  ; patch HL*1.6*122: MPI-client/server
    60  L -^HL(772,+$G(MTIEN))
    61  ;
    6253 D STATS^HLTF0(MTIEN,HLCHAR,HLEVN)
    6354 Q
     
    8980 S I=0
    9081 ;
    91  ; patch HL*1.6*122: MPI-client/server
    92  F  L +^HLCS(870,+$G(LLD0),2,+$G(LLD1)):10 Q:$T  H 1
    93  ;
    9482 ;-- move header into 870 from HDR array
    9583 S X="" F  S X=$O(@HDR@(X)) Q:'X  D
     
    10492 S ^HLCS(870,LLD0,2,LLD1,1,0)="^^"_I_"^"_I_"^"_$$DT^XLFDT_"^"
    10593 ;
    106  ; patch HL*1.6*122: MPI-client/server
    107  L -^HLCS(870,+$G(LLD0),2,+$G(LLD1))
    108  ;
    10994 Q
    110 OUT(HLDA,HLMID,HLMTN) ;File Data in Message Text File for Outgoing Message
    111  ;Version 1.5 Interface Only
    112  ;
    113  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    114  ; OUT, IN, and ACK to HLTF2 routine.
    115  ;
    116  Q:'$D(HLFS)
    117  ;
    118  I HLMTN="ACK"!(HLMTN="MCF")!(HLMTN="ORR") Q:'$D(HLMSA)  D ACK(HLMSA,"I") Q
    119  ;
    120  ;-- if message contained MSA find inbound message
    121  I $D(HLMSA),$D(HLNDAP),$P(HLMSA,HLFS,3)]"" D
    122  . N HLDAI
    123  . S HLDAI=0
    124  . F  S HLDAI=$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),$P(HLMSA,HLFS,3),HLDAI)) Q:'HLDAI!($P($G(^HL(772,+HLDAI,0)),U,4)="I")
    125  . I 'HLDAI K HLDAI
    126  ;
    127  D STUFF^HLTF0("O")
    128  ;
    129  N HLAC S HLAC=$S($D(HLERR):4,'$P(HLNDAP0,"^",10):1,1:2) D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
    130  D:$D(HLCHAR) STATS^HLTF0(HLDA,HLCHAR,$G(HLEVN))
    131  ;
    132  ;-- update status if MSA and found inbound message
    133  I $D(HLMSA),$D(HLDAI) D
    134  .N HLERR,HLMSG I $P(HLMSA,HLFS,4)]"" S HLERR=$P(HLMSA,HLFS,4)
    135  .S HLAC=$P(HLMSA,HLFS,2)
    136  .I HLAC'="AA" S HLMSG=$S(HLAC="AR":"Application Reject",HLAC="AE":"Application Error",1:"")_" - "_HLERR
    137  .S HLAC=$S(HLAC'="AA":4,1:3) D STATUS^HLTF0(HLDAI,HLAC,$G(HLMSG))
    138  Q
    139  ;
    140 IN(HLMTN,HLMID,HLTIME) ;File Data in Message Text File for Incoming Message
    141  ;Version 1.5 Interface Only
    142  ;
    143  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    144  ; OUT, IN, and ACK to HLTF2 routine.
    145  ;
    146  Q:'$D(HLFS)
    147  I HLMTN="ACK"!(HLMTN="MCF")!(HLMTN="ORR") Q:'$D(HLMSA)  D ACK(HLMSA,"O",$G(HLDA)) Q
    148  ;
    149  N HLDAI S HLDA=0
    150  I $D(HLNDAP),HLMID]"" D
    151  .F  S HLDA=+$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),HLMID,HLDA)) Q:'HLDA!($P($G(^HL(772,+HLDA,0)),U,4)="I")
    152  .I HLDA D
    153  ..S HLDT=+$P($G(^HL(772,HLDA,0)),"^"),HLDT1=$$HLDATE^HLFNC(HLDT)
    154  ..K ^HL(772,HLDA,"IN")
    155  .I $D(HLMSA),$P(HLMSA,HLFS,3)]"" D
    156  ..S HLDAI=0
    157  ..F  S HLDAI=$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),$P(HLMSA,HLFS,3),HLDAI)) Q:'HLDAI!($P($G(^HL(772,+HLDAI,0)),U,4)="O")
    158  ..I 'HLDAI K HLDAI
    159  ;
    160  ; patch HL*1.6*122: MPI-client/server
    161  ; I 'HLDA D CREATE(.HLMID,.HLDA,.HLDT,.HLDT1) K HLZ
    162  I 'HLDA D CREATE^HLTF(.HLMID,.HLDA,.HLDT,.HLDT1) K HLZ
    163  ;
    164  D STUFF^HLTF0("I")
    165  N HLAC S HLAC=$S($D(HLERR):4,1:1) D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
    166  ;
    167  D MERGE15^HLTF1("G",HLDA,"HLR",HLTIME)
    168  ;
    169  I '$D(HLERR),$D(HLMSA),$D(HLDAI) D
    170  .N HLAC,HLERR,HLMSG I $P(HLMSA,HLFS,4)]"" S HLERR=$P(HLMSA,HLFS,4)
    171  .S HLAC=$P(HLMSA,HLFS,2) I HLAC'="AA" S HLMSG=$S(HLAC="AR":"Application Reject",1:"Application Error")_" - "_HLERR
    172  .S HLAC=$S(HLAC'="AA":4,1:3) D STATUS^HLTF0(HLDAI,HLAC,$G(HLMSG))
    173  Q
    174  ;
    175 ACK(HLMSA,HLIO,HLDA) ;Process 'ACK' Message Type - Version 1.5 Interface Only
    176  ;
    177  ; patch HL*1.6*122: HLTF routine splitted, moves sub-routines,
    178  ; OUT, IN, and ACK to HLTF2 routine.
    179  ;
    180  ; To determine the correct message to link the ACK, HLIO is used.
    181  ; For an ack from DHCP (original message from remote system) then
    182  ; HLIO should be "I" so that the correct inbound message is ack-ed. For
    183  ; an inbound ack (original message outbound from DHCP) HLIO should be
    184  ; "O". This distinction must be made due to the possible duplicate
    185  ; message ids from a bi-direction interface.
    186  ;
    187  ; Input : MSA - MSA from ACK message.
    188  ;         HLIO - Either "I" or "O" : See note above.
    189  ;Output : None
    190  ;
    191  N HLAC,HLMIDI
    192  ;-- set up required vars
    193  S HLAC=$P(HLMSA,HLFS,2),HLMIDI=$P(HLMSA,HLFS,3)
    194  ;-- quit
    195  Q:HLMIDI']""!(HLAC']"")!('$D(HLNDAP))
    196  ;-- find message to ack
    197  I '$G(HLDA) S HLDA=0 D
    198  . F  S HLDA=+$O(^HL(772,"AH",+$P($G(HLNDAP0),U,12),HLMIDI,HLDA)) Q:'HLDA!($P($G(^HL(772,+HLDA,0)),U,4)=HLIO)
    199  ;-- quit if no message
    200  Q:'$D(^HL(772,+HLDA,0))
    201  ;-- check for error
    202  I $P(HLMSA,HLFS,4)]"" N HLERR S HLERR=$P(HLMSA,HLFS,4)
    203  I $D(HLERR),'$D(HLMSG) N HLMSG S HLMSG="Error During Receipt of Acknowledgement Message"_$S(HLAC="AR":" - Application Reject",HLAC="AE":" - Application Error",1:"")_" - "_HLERR
    204  ;-- update status
    205  S HLAC=$S(HLMTN="MCF":2,HLAC'="AA":4,1:3)
    206  D STATUS^HLTF0(HLDA,HLAC,$G(HLMSG))
    207  Q
    208  ;
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTP3.m

    r628 r636  
    1 HLTP3 ;SFIRMFO/RSD - Transaction Processor for TCP ;10/05/2007  15:17
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,58,59,66,69,109,115,108,116,117,125,120,133,122**;Oct 13, 1995;Build 14
     1HLTP3 ;SFIRMFO/RSD - Transaction Processor for TCP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,58,59,66,69,109,115,108,116,117,125,120,133**;Oct 13, 1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
    55 Q
    6 NEW(X) ;process new msg. ien in 773^ien in 772
    7  ;HLMTIENS=ien in #773; HLMTIEN=ien in #772
     6NEW(X) ;process new msg. ien in 773^msg. ien in 772
     7 ;HLMTIENS=ien in #773, msg header; HLMTIEN=ien in #772, msg text
    88 ;HLHDRO=original header;  HLHDR=response header
    99 ;set error trap
     
    2121 . ;HLTCP=ien of acknowledgment msg. from ACK^HLTP4
    2222 . D ACK^HLTP4(X,$P(HLRESLT,U,2)) Q:'$G(HLTCP)
    23  . ;write ack back
     23 . ;write ack back over connection
    2424 . S X=$$WRITE^HLCSTCP2(HLTCP)
    2525 . ;update counter to sent
    2626 . D LLCNT^HLCSTCP(HLDP,4)
    27  . ;update status of ack
     27 . ;update status of ack to complete
    2828 . D STATUS^HLTF0(HLTCP,3,,,1)
    2929 ;
    3030 ;check for duplicate msg., use rec. app and msg. id x-ref
    3131 ; patch HL*1.6*120
     32 ; I $L($G(HL("MID"))),$G(HL("RAP")) S X=$O(^HLMA("AH",HL("RAP"),HL("MID"),0)) D  Q:'$D(HLMTIENS)
    3233 I $G(HL("MID"))]"",$G(HL("RAP")) S X=$O(^HLMA("AH",HL("RAP"),HL("MID"),0)) D  Q:'$D(HLMTIENS)
    3334 . ;HLASTMSG=last ien received during this connection
     
    4142 .I MSH(HLMTIENS)'=MSH(OIENS) S HLASTMSG=HLMTIENS Q
    4243 .;
    43  . ;msg is duplicate, set status
     44 . ;msg is duplicate, set status as duplicate
    4445 . D STATUS^HLTF0(HLMTIENS,4,109,"Duplicate with ien "_OIENS,1),EXIT
    45  . ;msg was resent, ignore it.
     46 . ;msg was resent during this connection, ignore it.
    4647 . I HLASTMSG=HLMTIENS K HLMTIENS Q
    4748 . ;find original response and send back
    4849 . S HLASTRSP=$O(^HLMA("AF",OIENS,OIENS))
    4950 ;
    50  ;Quit if this is ack to ack
     51 ;Quit if this is acknowledgment to acknowledgement message
    5152 I $G(HL("ACK")) D  Q
    52  . ;Update status of original ack message
     53 . ;Update status of original acknowledgment message to successfully
    5354 . D STATUS^HLTF0(HL("MTIENS"),3,,,1),STATUS^HLTF0(HLMTIENS,3,,,1)
    5455 . ;unlock record
     
    7677 ; patch HL*1.6*120 start
    7778 ;resending old response, msg is a resend
    78  ; do not re-send duplicate when $G(HL("ACAT"))="AL"
     79 ; I $G(HLASTRSP) S HLTCP=HLASTRSP G ACK
     80 ; do not re-send duplicate message when $G(HL("ACAT"))="AL"
    7981 I $G(HLASTRSP),$G(HL("ACAT"))'="AL" S HLTCP=HLASTRSP G ACK
    8082 ; quit if duplicate
     
    9092 . ;X=1 if ack ok, 0=reject of error
    9193 . S X=$E(HLMSA,2)="A"
    92  . ;Update status of original message and remove it from the queue
     94 . ;Update status of original subscriber message and remove it from the out-going queue
    9395 . D STATUS^HLTF0(HL("MTIENS"),$S(X:3,1:4),"",$S(X:"",1:$P(HLMSA,HL("FS"),3)),1)
    9496 . D DEQUE^HLCSREP($P($G(^HLMA(HL("MTIENS"),0)),"^",7),"O",HL("MTIENS"))
    9597 . D
    96  .. N HLTCP ;variable to update status in file #772.
     98 .. N HLTCP ;New variable to update status in file #772.
    9799 ..;
    98100 ..;**108**
     
    104106 ..;
    105107 .. D PROCACK^HLTP2(HLMTIEN,HL("EID"),.HLRESLT,.HL)
    106  . ;update status of incoming & unlock
     108 . ;update status of incoming to complete & unlock
    107109 . D STATUS^HLTF0(HLMTIENS,$S($G(HLRESLT):4,1:3),$S($G(HLRESLT):+$G(HLRESLT),1:""),$S($G(HLRESLT):$P(HLRESLT,U,2),1:""),1),EXIT
    108110 ;
     
    123125 ;update status of incoming to complete & unlock
    124126 D STATUS^HLTF0(HLMTIENS,$S(HLRESLT:4,1:3),$S(HLRESLT:+HLRESLT,1:""),$S(HLRESLT:$P(HLRESLT,U,2),1:""),1,$S($G(HLERR("SKIP_EVENT"))=1:1,1:0)),EXIT
    125  ;HLTCPO=link open, HLTCP=ien of ack msg. from GENACK
     127 ;HLTCPO=link open, HLTCP=ien of acknowledgment msg. from GENACK
    126128ACK I $G(HLTCPO),$G(HLTCP) D  Q
    127129 . D LLCNT^HLCSTCP(HLDP,3)
     
    137139 ;
    138140 ; patch HL*1.6*120 start
    139  ; clean non-Kernel variables
     141 ; clean variables except Kernel related variables
    140142 D
    141143 . ; protect variables defined in STARTIN^HLCSIN
     
    152154 N HLERR     ;patch HL*1.6*109
    153155 Q:'$G(HLDP)!'$G(X)  Q:'$G(^HLMA(X,0))
     156 ;**109 START**
    154157 Q:'$D(^HLMA("AC","I",HLDP,X))
     158 ;**109 END**
    155159 ;
    156160 N HL,HLA,HLD0,HLEID,HLEIDS,HLHDR,HLHDRO,HLMTIEN,HLMTIENS,HLJ,HLMSA,HLN,HLQUIT,HLNODE,HLNEXT,HLRESLT,HLRESLTA,HLTCP,HLXX,Z,HLDONE1
     161 ;setup variables
    157162 S HLMTIENS=X,X=^HLMA(HLMTIENS,0),HLMTIEN=+$P(X,U),HL("MID")=$P(X,U,2),HL("MTIENS")=$P(X,U,10),HL("LL")=$P(X,U,7),HLTCP="",HL("Q")=""""""
    158163 S HL("EIDS")=$P(X,U,8),HL("SAP")=$P(X,U,11),HL("RAP")=$P(X,U,12),HL("MTP")=$P(X,U,13),HL("ETP")=$P(X,U,14)
     
    164169 M HLHDRO=^HLMA(HLMTIENS,"MSH")
    165170 ; if no header quit
     171 ;**109**
     172 ;I '$O(HLHDRO(0)) L -^HLMA(HLMTIENS) Q
    166173 Q:'$O(HLHDRO(0))
    167174 ;
    168175 S HL("FS")=$E(HLHDRO(1,0),4),HL("ECH")=$$P^HLTPCK2(.HLHDRO,2),HL("SFN")=$$P^HLTPCK2(.HLHDRO,4),HL("RFN")=$$P^HLTPCK2(.HLHDRO,6),HL("DTM")=$$P^HLTPCK2(.HLHDRO,7)
    169176 ;
     177 ; patch HL*1.6*109 start
    170178 ; quit if ien of #772 is not defined
    171179 Q:'HLMTIEN
    172180 ; quit if field separator is not defined
    173181 Q:HL("FS")=""
     182 ; patch HL*1.6*109 end
    174183 ;
    175184 S X=$$P^HLTPCK2(.HLHDRO,1)
     
    187196 . S X=$$P^HLTPCK2(.HLHDRO,9),Z=$E(HL("ECH")),HL("PID")=$P(X,Z,2),HL("VER")=$P(X,Z,4)
    188197 . ;
    189  . ; original code incorrectly treats repetition separator as
     198 . ; original implementation incorrectly treats repetition separator as
    190199 . ; subcomponent separator
    191200 . I $E(HL("ECH"),2)]"",X[$E(HL("ECH"),2) D
     
    206215 . S HLMSA=$P($$P^HLTPCK2(.HLHDRO,10),$E(HL("ECH")),1),$P(HLMSA,HL("FS"),2)=$$P^HLTPCK2(.HLHDRO,12),$P(HLMSA,HL("FS"),3)=$P($$P^HLTPCK2(.HLHDRO,10),$E(HL("ECH")),2),HL("MSAID")=$P(HLMSA,HL("FS"),2)
    207216 ;
     217 ; HL*1.6*108
    208218 ; quit if this is a commit ack
    209219 I $P($G(^HL(772,HLMTIEN,"IN",1,0)),HL("FS"),1)="MSA",$E($P($G(^HL(772,HLMTIEN,"IN",1,0)),HL("FS"),2))="C" Q
     220 ; **
    210221 ;
    211222 ;**  HL*1.6*117 **
    212223 K HLL("SET FOR APP ACK"),HLL("LINKS")
     224 ;** END HL*1.6*117 **
    213225 ;
    214226 D CONT
     
    217229MSA(Y) ;Y=ien in 772, returns MSA segment
    218230 ;ack code^msg being ack id^text
    219  ; patch HL*1.6*122
    220  ; for HL7 v2.5 and beyond with MSA as 3rd segment
    221  N X,SUBIEN,DATA,DONE
     231 N X
    222232 S X=$G(^HL(772,Y,"IN",1,0)),X=$S($E(X,1,3)="MSA":$E(X,5,999),1:"")
    223  Q:X]"" X
    224  ;
    225  S DONE=0
    226  S SUBIEN=1
    227  F  S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN  D  Q:DONE
    228  . S DATA=$G(^HL(772,Y,"IN",SUBIEN,0)) I DATA="" D
    229  .. S DONE=1
    230  .. S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN
    231  .. S X=$G(^HL(772,Y,"IN",SUBIEN,0)),X=$S($E(X,1,3)="MSA":$E(X,5,999),1:"")
    232  ; patch HL*1.6*122 end
    233  ;
    234233 Q X
    235234 ;
     
    237236 D ^%ZTER
    238237 I $G(HLMTIENS),$D(^HLMA(HLMTIENS,0)) D STATUS^HLTF0(HLMTIENS,4,,,1),EXIT
    239  ; release locks created by inbound filer
     238 ;*109* release all locks created by inbound filer
    240239 L -^HLMA("AC","I",+$G(HLXX))
    241240 G UNWIND^%ZTER
  • FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTPCK2B.m

    r628 r636  
    1 HLTPCK2B ;OIFO-O/RJH - Message Header Validation (Con't) ;10/04/2007  16:00
    2  ;;1.6;HEALTH LEVEL SEVEN;**120,133,122**;Oct 13, 1995;Build 14
     1HLTPCK2B ;OIFO-O/RJH - Message Header Validation (Con't) ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**120,133**;Oct 13, 1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
     
    2323 . S X=$G(^HLMA(ARY("MTIENS"),0)),ARY("EIDS")=$P(X,U,8),ARY("ACK")=$P(X,U,10)
    2424 . ;if no subscriber protocol then response msg. is invalid
    25  . ;
    26  . ; patch HL*1.6*122 start
    27  . ; comment out the following code: for patch 109- dynamic addressing
    28  . ; I ('ARY("EIDS")) S:(ERR="") ERR="Invalid Message Control ID in MSA Segment - No Subscr. IEN in 773" Q
     25 . I ('ARY("EIDS")) S:(ERR="") ERR="Invalid Message Control ID in MSA Segment - No Subscr. IEN in 773" Q
    2926 . ;get message text ien in file 772 and server protocol, 'EID'
    3027 . S ARY("MTIEN")=+X,X=$G(^HL(772,+X,0)),ARY("EID")=$P(X,U,10)
    3128 . I ('ARY("EID")) S:(ERR="") ERR="Event Protocol not found" Q
    32  . ; D EVENT^HLUTIL1(ARY("EIDS"),"770,773",.HLN)
    33  . I ARY("EIDS") D EVENT^HLUTIL1(ARY("EIDS"),"770,773",.HLN)
    34  . ; patch HL*1.6*122 end
     29 . D EVENT^HLUTIL1(ARY("EIDS"),"770,773",.HLN)
    3530 ;
    3631 ;Find Server Protocol - based on sending application, message type,
Note: See TracChangeset for help on using the changeset viewer.