YSCLHLAD ;DSS/PO-CLOZAPINE DATA TRANSMISSION-Messaging-ADT ;19 May 2020 14:13:48
;;5.01;MENTAL HEALTH;**149**;Dec 30, 1994;Build 72
Q
;
; Reference to ^%ZTER supported by DBIA #1621
; Reference to ^DICRW supported by DBIA #10005
; Reference to ^DIQ supported by DBIA #2056
; References to ^HLOAPI supported by DBIA #4716
; References to HLOAPI1 supported by DBIA #4717
;
ADTA28(YSCLARR,YSILENT) ; Build and send registration message
; input: YSCLARR data array to build HL7 segments
;
; APPARMS - HLO application parameters
; HL - delimiters for HL7 utilities
; HL7RES - Hl7 send result, 0 if message not sent
; HLMSTATE - message state for HLO
; SEG - segment for HLO
; YSCLDEST - destination name for HLO
; YSHLERR - message creation error
; YSWHTO - destination for HLO
;
N APPARMS,HL,HL7RES,HLMSTATE,SEG,YSCLDEST,YSHLERR,YSWHTO
;
; create message
S APPARMS("MESSAGE TYPE")="ADT"
S APPARMS("EVENT")="A28"
S APPARMS("MESSAGE STRUCTURE")="ADT_A05"
S APPARMS("VERSION")="2.5.1"
I '$$NEWMSG^HLOAPI(.APPARMS,.HLMSTATE,.YSHLERR) U IO W !,$G(YSHLERR) Q
;
; create EVN segment
D SET^HLOAPI(.SEG,"EVN",0)
D SET^HLOAPI(.SEG,$$FMTHL7^XLFDT($$NOW^XLFDT),2)
Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
;
D PID^YSCLHLPD(.SEG,.YSCLARR) ;creat PID segment
Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
;
; create ROL segment
D SET^HLOAPI(.SEG,"ROL",0)
D SET^HLOAPI(.SEG,"UP",2) ; update
D SET^HLOAPI(.SEG,"PRX",3)
D SET^HLOAPI(.SEG,"HL70443",3,3)
D SET^HLOAPI(.SEG,"Prescribing Physician",3,2)
;
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_DEA"),4,1,1,1)
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_LAST NAME"),4,2,1,1)
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_FIRST NAME"),4,3,1,1)
D SET^HLOAPI(.SEG,"DEA",4,13,1,1)
;
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_NPI"),4,1,1,2)
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_LAST NAME"),4,2,1,2)
D SET^HLOAPI(.SEG,YSCLARR("PROVIDER_FIRST NAME"),4,3,1,2)
D SET^HLOAPI(.SEG,"NPI",4,13,1,2)
Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ; "ROL" segment
;
; create PV1 segment
D SET^HLOAPI(.SEG,"PV1",0)
D SET^HLOAPI(.SEG,YSCLARR("PATIENT_INPAT/OUTPAT"),2)
Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ; "PV1" segment
;
; create OBX segment for clozapine status
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|1|..."
. N SEGSEQ S SEGSEQ=1
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence id
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"PTSTAT",3,2) ; observation ID
. D SET^HLOAPI(.SEG,YSCLARR("PATIENT_CLOZ STATUS"),5) ; patient status
. D SET^HLOAPI(.SEG,"F",11) ; observation result status - "F" means Final Results
;
; create OBX segment for dispense frequency
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|2|..."
. N SEGSEQ S SEGSEQ=2
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence id
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"DISPENSE FREQUENCY",3,2) ; observation ID
. D SET^HLOAPI(.SEG,YSCLARR("LAB_FREQ"),5) ;
. D SET^HLOAPI(.SEG,"F",11) ; observation result status, "F" means Final Results
. Q
;
; create OBX segment for WBC
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|3|..."
. N SEGSEQ S SEGSEQ=3
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence ID
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"WBC",3,2) ; observation ID
. D SET^HLOAPI(.SEG,YSCLARR("LAB_WBC VAL"),5) ; WBC value
. D SET^HLOAPI(.SEG,"F",11) ; observation result status, "F" means Final Results
. ;ajf ; Don't set date if wbc value is null
. I $G(YSCLARR("LAB_WBC VAL")) D SET^HLOAPI(.SEG,YSCLARR("LAB_COLLECTION DATE"),14)
; create OBX segment for ANC
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|4|..."
. N SEGSEQ S SEGSEQ=4
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence ID
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"ANC",3,2) ; observation ID ;???PVZ should it come form LABSTR e.g. "ABS NEUT"
. D SET^HLOAPI(.SEG,YSCLARR("LAB_ANC VAL"),5)
. D SET^HLOAPI(.SEG,"F",11) ; observation result status - "F" means Final Results
. ;ajf ; Don't set date if ANC value is null
. I $G(YSCLARR("LAB_ANC VAL")) D SET^HLOAPI(.SEG,YSCLARR("LAB_COLLECTION DATE"),14)
;
; create OBX segment for site DEA number
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|5|..."
. N SEGSEQ S SEGSEQ=5
. N SITEDEA S SITEDEA=$$GET1^DIQ(4,YSCLARR("PROVIDER_DEFAULT DIV."),52)
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence ID
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"Facility DEA number",3,2) ; observation ID
. D SET^HLOAPI(.SEG,YSCLARR("SITE_SITE DEA"),5) ; facility DEA number
. D SET^HLOAPI(.SEG,"F",11) ; observation result status - "F" means Final
;
D Q:'$$ADDSEG^HLOAPI(.HLMSTATE,.SEG) ;"OBX|6|..."
. N SEGSEQ S SEGSEQ=6
. D SET^HLOAPI(.SEG,"OBX",0)
. D SET^HLOAPI(.SEG,SEGSEQ,1) ; sequence id
. D SET^HLOAPI(.SEG,"CE",2) ; value type
. D SET^HLOAPI(.SEG,"SITELOC",3,2) ; observation ID
. D SET^HLOAPI(.SEG,YSCLARR("SITE_ID"),5) ; site ID (division)
. D SET^HLOAPI(.SEG,"F",11) ; observation result status - "F" means Final
. D SET^HLOAPI(.SEG,YSCLARR("SITE_SITE NAME"),23)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_STATION"),23,10)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_STREET ADDR 1"),24,1)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_STREET ADDR 2"),24,2)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_CITY"),24,3)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_STATE"),24,4)
. D SET^HLOAPI(.SEG,YSCLARR("SITE_ZIP"),24,5)
;
S APPARMS("SENDING APPLICATION")="YSCL-REG-SEND"
S APPARMS("ACCEPT ACK TYPE")="AL"
S APPARMS("APP ACK TYPE")="NE"
S APPARMS("ACCEPT ACK RESPONSE")="COMTRESP^YSCLHLAD" ; temporary to see how COMMIT ack works
S APPARMS("APP ACK RESPONSE")="APPRESP^YSCLHLAD" ; temporary to see how APP ack works
S YSCLDEST="YSCL-REG-REC"
S YSWHTO("RECEIVING APPLICATION")=YSCLDEST
S YSWHTO("FACILITY LINK NAME")="YSCL-NCCC"
S HL7RES=$$SENDONE^HLOAPI1(.HLMSTATE,.APPARMS,.YSWHTO,.YSHLERR)
I 'HL7RES D APPERROR^%ZTER("HLO error sending ClozMod ADT^AD8") ; log error (D ^XTER) and continue
; leave code for future developers
;D:'$G(YSILENT)
;. W:HL7RES !,"ADT A05 message IEN=",HL7RES," generated and sent to ",YSCLDEST,!
;. W:'HL7RES !,"Error: ",$G(YSHLERR),!," No ADT A05 message sent!"
;
Q HL7RES
;
COMTRESP ; process COMMIT ACCEPT ACK RESPONSE
;
D DT^DICRW N HDR,MSG,RES,RTNOW,YSXTMP
S YSXTMP("1stNode")=$T(+0)_" "_DT ; first storage node in ^XTMP
S RES=$$STARTMSG^HLOPRS(.MSG,HLMSGIEN,.HDR)
S RTNOW=$$NOW^XLFDT
S ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$J,"MSGIEN")=$G(HLMSGIEN)
S ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$J,"RES")=RES
M ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$J,"MSG")=MSG
M ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$J,"HDR")=HDR
; expires in 30 days
S ^XTMP(YSXTMP("1stNode"),0)=$$HTFM^XLFDT($H+30)_U_DT_U_"YSCL* HL7 RESPONSE"
Q
;
APPRESP ; process ACCEPT ACK RESPONSE
;
N MSGIEN,RTNOW,VAR,YSXTMP
S YSXTMP("1stNode")=$T(+0)_" "_DT ; first storage node in ^XTMP
S RTNOW=$$NOW^XLFDT,MSGIEN=+$G(HLMSGIEN)
S ^XTMP(YSXTMP("1stNode"),"APPRESP",RTNOW,MSGIEN,$J)="APP ACK RESPONSE"
S VAR="HL" F S VAR=$O(@VAR) Q:'($E(VAR,1,2)="HL") M ^XTMP(YSXTMP("1stNode"),"APPRESP",RTNOW,MSGIEN,$J,VAR)=@VAR
; expires in 30 days
S ^XTMP(YSXTMP("1stNode"),0)=$$HTFM^XLFDT($H+30)_U_DT_U_"YSCL* HL7 RESPONSE"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSCLHLAD 7500 printed Dec 13, 2024@02:13:39 Page 2
YSCLHLAD ;DSS/PO-CLOZAPINE DATA TRANSMISSION-Messaging-ADT ;19 May 2020 14:13:48
+1 ;;5.01;MENTAL HEALTH;**149**;Dec 30, 1994;Build 72
+2 QUIT
+3 ;
+4 ; Reference to ^%ZTER supported by DBIA #1621
+5 ; Reference to ^DICRW supported by DBIA #10005
+6 ; Reference to ^DIQ supported by DBIA #2056
+7 ; References to ^HLOAPI supported by DBIA #4716
+8 ; References to HLOAPI1 supported by DBIA #4717
+9 ;
ADTA28(YSCLARR,YSILENT) ; Build and send registration message
+1 ; input: YSCLARR data array to build HL7 segments
+2 ;
+3 ; APPARMS - HLO application parameters
+4 ; HL - delimiters for HL7 utilities
+5 ; HL7RES - Hl7 send result, 0 if message not sent
+6 ; HLMSTATE - message state for HLO
+7 ; SEG - segment for HLO
+8 ; YSCLDEST - destination name for HLO
+9 ; YSHLERR - message creation error
+10 ; YSWHTO - destination for HLO
+11 ;
+12 NEW APPARMS,HL,HL7RES,HLMSTATE,SEG,YSCLDEST,YSHLERR,YSWHTO
+13 ;
+14 ; create message
+15 SET APPARMS("MESSAGE TYPE")="ADT"
+16 SET APPARMS("EVENT")="A28"
+17 SET APPARMS("MESSAGE STRUCTURE")="ADT_A05"
+18 SET APPARMS("VERSION")="2.5.1"
+19 IF '$$NEWMSG^HLOAPI(.APPARMS,.HLMSTATE,.YSHLERR)
USE IO
WRITE !,$GET(YSHLERR)
QUIT
+20 ;
+21 ; create EVN segment
+22 DO SET^HLOAPI(.SEG,"EVN",0)
+23 DO SET^HLOAPI(.SEG,$$FMTHL7^XLFDT($$NOW^XLFDT),2)
+24 if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+25 ;
+26 ;creat PID segment
DO PID^YSCLHLPD(.SEG,.YSCLARR)
+27 if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+28 ;
+29 ; create ROL segment
+30 DO SET^HLOAPI(.SEG,"ROL",0)
+31 ; update
DO SET^HLOAPI(.SEG,"UP",2)
+32 DO SET^HLOAPI(.SEG,"PRX",3)
+33 DO SET^HLOAPI(.SEG,"HL70443",3,3)
+34 DO SET^HLOAPI(.SEG,"Prescribing Physician",3,2)
+35 ;
+36 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_DEA"),4,1,1,1)
+37 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_LAST NAME"),4,2,1,1)
+38 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_FIRST NAME"),4,3,1,1)
+39 DO SET^HLOAPI(.SEG,"DEA",4,13,1,1)
+40 ;
+41 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_NPI"),4,1,1,2)
+42 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_LAST NAME"),4,2,1,2)
+43 DO SET^HLOAPI(.SEG,YSCLARR("PROVIDER_FIRST NAME"),4,3,1,2)
+44 DO SET^HLOAPI(.SEG,"NPI",4,13,1,2)
+45 ; "ROL" segment
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+46 ;
+47 ; create PV1 segment
+48 DO SET^HLOAPI(.SEG,"PV1",0)
+49 DO SET^HLOAPI(.SEG,YSCLARR("PATIENT_INPAT/OUTPAT"),2)
+50 ; "PV1" segment
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+51 ;
+52 ; create OBX segment for clozapine status
+53 ;"OBX|1|..."
Begin DoDot:1
+54 NEW SEGSEQ
SET SEGSEQ=1
+55 DO SET^HLOAPI(.SEG,"OBX",0)
+56 ; sequence id
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+57 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+58 ; observation ID
DO SET^HLOAPI(.SEG,"PTSTAT",3,2)
+59 ; patient status
DO SET^HLOAPI(.SEG,YSCLARR("PATIENT_CLOZ STATUS"),5)
+60 ; observation result status - "F" means Final Results
DO SET^HLOAPI(.SEG,"F",11)
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+61 ;
+62 ; create OBX segment for dispense frequency
+63 ;"OBX|2|..."
Begin DoDot:1
+64 NEW SEGSEQ
SET SEGSEQ=2
+65 DO SET^HLOAPI(.SEG,"OBX",0)
+66 ; sequence id
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+67 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+68 ; observation ID
DO SET^HLOAPI(.SEG,"DISPENSE FREQUENCY",3,2)
+69 ;
DO SET^HLOAPI(.SEG,YSCLARR("LAB_FREQ"),5)
+70 ; observation result status, "F" means Final Results
DO SET^HLOAPI(.SEG,"F",11)
+71 QUIT
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+72 ;
+73 ; create OBX segment for WBC
+74 ;"OBX|3|..."
Begin DoDot:1
+75 NEW SEGSEQ
SET SEGSEQ=3
+76 DO SET^HLOAPI(.SEG,"OBX",0)
+77 ; sequence ID
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+78 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+79 ; observation ID
DO SET^HLOAPI(.SEG,"WBC",3,2)
+80 ; WBC value
DO SET^HLOAPI(.SEG,YSCLARR("LAB_WBC VAL"),5)
+81 ; observation result status, "F" means Final Results
DO SET^HLOAPI(.SEG,"F",11)
+82 ;ajf ; Don't set date if wbc value is null
+83 IF $GET(YSCLARR("LAB_WBC VAL"))
DO SET^HLOAPI(.SEG,YSCLARR("LAB_COLLECTION DATE"),14)
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+84 ; create OBX segment for ANC
+85 ;"OBX|4|..."
Begin DoDot:1
+86 NEW SEGSEQ
SET SEGSEQ=4
+87 DO SET^HLOAPI(.SEG,"OBX",0)
+88 ; sequence ID
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+89 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+90 ; observation ID ;???PVZ should it come form LABSTR e.g. "ABS NEUT"
DO SET^HLOAPI(.SEG,"ANC",3,2)
+91 DO SET^HLOAPI(.SEG,YSCLARR("LAB_ANC VAL"),5)
+92 ; observation result status - "F" means Final Results
DO SET^HLOAPI(.SEG,"F",11)
+93 ;ajf ; Don't set date if ANC value is null
+94 IF $GET(YSCLARR("LAB_ANC VAL"))
DO SET^HLOAPI(.SEG,YSCLARR("LAB_COLLECTION DATE"),14)
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+95 ;
+96 ; create OBX segment for site DEA number
+97 ;"OBX|5|..."
Begin DoDot:1
+98 NEW SEGSEQ
SET SEGSEQ=5
+99 NEW SITEDEA
SET SITEDEA=$$GET1^DIQ(4,YSCLARR("PROVIDER_DEFAULT DIV."),52)
+100 DO SET^HLOAPI(.SEG,"OBX",0)
+101 ; sequence ID
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+102 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+103 ; observation ID
DO SET^HLOAPI(.SEG,"Facility DEA number",3,2)
+104 ; facility DEA number
DO SET^HLOAPI(.SEG,YSCLARR("SITE_SITE DEA"),5)
+105 ; observation result status - "F" means Final
DO SET^HLOAPI(.SEG,"F",11)
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+106 ;
+107 ;"OBX|6|..."
Begin DoDot:1
+108 NEW SEGSEQ
SET SEGSEQ=6
+109 DO SET^HLOAPI(.SEG,"OBX",0)
+110 ; sequence id
DO SET^HLOAPI(.SEG,SEGSEQ,1)
+111 ; value type
DO SET^HLOAPI(.SEG,"CE",2)
+112 ; observation ID
DO SET^HLOAPI(.SEG,"SITELOC",3,2)
+113 ; site ID (division)
DO SET^HLOAPI(.SEG,YSCLARR("SITE_ID"),5)
+114 ; observation result status - "F" means Final
DO SET^HLOAPI(.SEG,"F",11)
+115 DO SET^HLOAPI(.SEG,YSCLARR("SITE_SITE NAME"),23)
+116 DO SET^HLOAPI(.SEG,YSCLARR("SITE_STATION"),23,10)
+117 DO SET^HLOAPI(.SEG,YSCLARR("SITE_STREET ADDR 1"),24,1)
+118 DO SET^HLOAPI(.SEG,YSCLARR("SITE_STREET ADDR 2"),24,2)
+119 DO SET^HLOAPI(.SEG,YSCLARR("SITE_CITY"),24,3)
+120 DO SET^HLOAPI(.SEG,YSCLARR("SITE_STATE"),24,4)
+121 DO SET^HLOAPI(.SEG,YSCLARR("SITE_ZIP"),24,5)
End DoDot:1
if '$$ADDSEG^HLOAPI(.HLMSTATE,.SEG)
QUIT
+122 ;
+123 SET APPARMS("SENDING APPLICATION")="YSCL-REG-SEND"
+124 SET APPARMS("ACCEPT ACK TYPE")="AL"
+125 SET APPARMS("APP ACK TYPE")="NE"
+126 ; temporary to see how COMMIT ack works
SET APPARMS("ACCEPT ACK RESPONSE")="COMTRESP^YSCLHLAD"
+127 ; temporary to see how APP ack works
SET APPARMS("APP ACK RESPONSE")="APPRESP^YSCLHLAD"
+128 SET YSCLDEST="YSCL-REG-REC"
+129 SET YSWHTO("RECEIVING APPLICATION")=YSCLDEST
+130 SET YSWHTO("FACILITY LINK NAME")="YSCL-NCCC"
+131 SET HL7RES=$$SENDONE^HLOAPI1(.HLMSTATE,.APPARMS,.YSWHTO,.YSHLERR)
+132 ; log error (D ^XTER) and continue
IF 'HL7RES
DO APPERROR^%ZTER("HLO error sending ClozMod ADT^AD8")
+133 ; leave code for future developers
+134 ;D:'$G(YSILENT)
+135 ;. W:HL7RES !,"ADT A05 message IEN=",HL7RES," generated and sent to ",YSCLDEST,!
+136 ;. W:'HL7RES !,"Error: ",$G(YSHLERR),!," No ADT A05 message sent!"
+137 ;
+138 QUIT HL7RES
+139 ;
COMTRESP ; process COMMIT ACCEPT ACK RESPONSE
+1 ;
+2 DO DT^DICRW
NEW HDR,MSG,RES,RTNOW,YSXTMP
+3 ; first storage node in ^XTMP
SET YSXTMP("1stNode")=$TEXT(+0)_" "_DT
+4 SET RES=$$STARTMSG^HLOPRS(.MSG,HLMSGIEN,.HDR)
+5 SET RTNOW=$$NOW^XLFDT
+6 SET ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$JOB,"MSGIEN")=$GET(HLMSGIEN)
+7 SET ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$JOB,"RES")=RES
+8 MERGE ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$JOB,"MSG")=MSG
+9 MERGE ^XTMP(YSXTMP("1stNode"),"COMTRESP",RTNOW,$JOB,"HDR")=HDR
+10 ; expires in 30 days
+11 SET ^XTMP(YSXTMP("1stNode"),0)=$$HTFM^XLFDT($HOROLOG+30)_U_DT_U_"YSCL* HL7 RESPONSE"
+12 QUIT
+13 ;
APPRESP ; process ACCEPT ACK RESPONSE
+1 ;
+2 NEW MSGIEN,RTNOW,VAR,YSXTMP
+3 ; first storage node in ^XTMP
SET YSXTMP("1stNode")=$TEXT(+0)_" "_DT
+4 SET RTNOW=$$NOW^XLFDT
SET MSGIEN=+$GET(HLMSGIEN)
+5 SET ^XTMP(YSXTMP("1stNode"),"APPRESP",RTNOW,MSGIEN,$JOB)="APP ACK RESPONSE"
+6 SET VAR="HL"
FOR
SET VAR=$ORDER(@VAR)
if '($EXTRACT(VAR,1,2)="HL")
QUIT
MERGE ^XTMP(YSXTMP("1stNode"),"APPRESP",RTNOW,MSGIEN,$JOB,VAR)=@VAR
+7 ; expires in 30 days
+8 SET ^XTMP(YSXTMP("1stNode"),0)=$$HTFM^XLFDT($HOROLOG+30)_U_DT_U_"YSCL* HL7 RESPONSE"
+9 QUIT
+10 ;