HLTP3A ;SFIRMFO/RSD - Transaction Processor for TCP- INIT ;11/19/2003 13:57
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
;
;split from hltp3
Q
INIT ;initialize variables, get MSA & header, returns HLRESLT if error
N HLJ
;
K HLRESLT,HL
S HLMTIENS=+X,HLMTIEN=+$P(X,U,2),HLMSA=$$MSA^HLTP3(HLMTIEN)
;
;get header and validate
M HLHDRO=^HLMA(HLMTIENS,"MSH")
;HLMSA is by ref., for a batch msg HLMSA will be setup in HLTPCK2
D CHK^HLTPCK2(.HLHDRO,.HL,.HLMSA)
;Update Message Administration file #773, for incoming message
;3=trans type, 20=status
K HLJ
S X="HLJ(773,"""_HLMTIENS_","")",@X@(3)="I",@X@(20)=9
;HL=error #^error text, 21=date process, 22=error msg, 23=error type
S:$G(HL) @X@(20)=4,@X@(21)=$$NOW^XLFDT,@X@(22)=$P(HL,U,2),@X@(23)=+HL
;8=protocol, 13=sending app
S:$G(HL("EIDS")) @X@(8)=HL("EIDS") S:$G(HL("SAP")) @X@(13)=HL("SAP")
;14=receiving app, 12=acknowledgement to
S:$G(HL("RAP")) @X@(14)=HL("RAP") S:$G(HL("MTIENS")) @X@(12)=HL("MTIENS")
;6=initial message, 7=logical link
S:$G(HLTCPI) @X@(6)=HLTCPI S @X@(7)=HLDP
;
;15=message type, 16=event type
S:$G(HL("MTP")) @X@(15)=HL("MTP") S:$G(HL("ETP")) @X@(16)=HL("ETP")
;HL*1.6*109 S:$G(HL("MTP_ETP")) @X@(17)=HL("MTP_ETP")
D FILE^HLDIE("","HLJ","","INIT-1","HLTP3A") ;HL*1.6*109
;Update Message Text file #772
;4=trans type
K HLJ S X="HLJ(772,"""_HLMTIEN_","")",@X@(4)="I"
;10=event protocol
S:$G(HL("EID")) @X@(10)=HL("EID")
D FILE^HLDIE("","HLJ","","INIT-2","HLTP3A") ; HL*1.6*109
;set HLRESLT to error
S:HL'="" HLRESLT=HL
Q
HLTP3A ;SFIRMFO/RSD - Transaction Processor for TCP- INIT ;11/19/2003 13:57
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
+2 ;
+3 ;split from hltp3
+4 QUIT
INIT ;initialize variables, get MSA & header, returns HLRESLT if error
+1 NEW HLJ
+2 ;
+3 KILL HLRESLT,HL
+4 SET HLMTIENS=+X
SET HLMTIEN=+$PIECE(X,U,2)
SET HLMSA=$$MSA^HLTP3(HLMTIEN)
+5 ;
+6 ;get header and validate
+7 MERGE HLHDRO=^HLMA(HLMTIENS,"MSH")
+8 ;HLMSA is by ref., for a batch msg HLMSA will be setup in HLTPCK2
+9 DO CHK^HLTPCK2(.HLHDRO,.HL,.HLMSA)
+10 ;Update Message Administration file #773, for incoming message
+11 ;3=trans type, 20=status
+12 KILL HLJ
+13 SET X="HLJ(773,"""_HLMTIENS_","")"
SET @X@(3)="I"
SET @X@(20)=9
+14 ;HL=error #^error text, 21=date process, 22=error msg, 23=error type
+15 IF $GET(HL)
SET @X@(20)=4
SET @X@(21)=$$NOW^XLFDT
SET @X@(22)=$PIECE(HL,U,2)
SET @X@(23)=+HL
+16 ;8=protocol, 13=sending app
+17 IF $GET(HL("EIDS"))
SET @X@(8)=HL("EIDS")
IF $GET(HL("SAP"))
SET @X@(13)=HL("SAP")
+18 ;14=receiving app, 12=acknowledgement to
+19 IF $GET(HL("RAP"))
SET @X@(14)=HL("RAP")
IF $GET(HL("MTIENS"))
SET @X@(12)=HL("MTIENS")
+20 ;6=initial message, 7=logical link
+21 IF $GET(HLTCPI)
SET @X@(6)=HLTCPI
SET @X@(7)=HLDP
+22 ;
+23 ;15=message type, 16=event type
+24 IF $GET(HL("MTP"))
SET @X@(15)=HL("MTP")
IF $GET(HL("ETP"))
SET @X@(16)=HL("ETP")
+25 ;HL*1.6*109 S:$G(HL("MTP_ETP")) @X@(17)=HL("MTP_ETP")
+26 ;HL*1.6*109
DO FILE^HLDIE("","HLJ","","INIT-1","HLTP3A")
+27 ;Update Message Text file #772
+28 ;4=trans type
+29 KILL HLJ
SET X="HLJ(772,"""_HLMTIEN_","")"
SET @X@(4)="I"
+30 ;10=event protocol
+31 IF $GET(HL("EID"))
SET @X@(10)=HL("EID")
+32 ; HL*1.6*109
DO FILE^HLDIE("","HLJ","","INIT-2","HLTP3A")
+33 ;set HLRESLT to error
+34 IF HL'=""
SET HLRESLT=HL
+35 QUIT