IBARXCR2 ;ALB/MKN-CERNER RXCOPAY RECEIVE HL7 QRY^R02 MESSAGE SEND DSR^Q03 ; 19 Feb 2021
;;2.0;INTEGRATED BILLING;**676,726**;21-MAR-94;Build 1
;
;IA# Supports
;------ -------------------------------------------------
;4718 $$STARTMSG^HLOPRS, $$NEXTSEG^HLOPRS, $$GET^HLOPRS
;4722 $$ACK^HLOAPI2, $$SENDACK^HLOAPI2
;
; Receives from Cerner the IBARXC-QRY - QRY^R02
; requesting seeding data from vista, return response IBARXC-QRYRESP DSR^Q03
; OR
; Receives from Cerner the IBARXC-QRYRESP - DSR^Q03
; proccess requested cerner seeding data, parse and save transactions
;
EN ; receives HL7 message QRY^R02 from Cerner and calls EN^IBARXSH to reply with DSR^Q03
N DFN,IBHDR,IBMSG,IBSEG,IBSEGT,IBSTAT,IBWHAT,ICN,MSGTYPE,IBIEN,DATEQ,ERR,HLERR
;
S ERR=0,IBSTAT=$$STARTMSG^HLOPRS(.IBMSG,HLMSGIEN,.IBHDR)
S IBIEN=HLMSGIEN
I 'IBSTAT S HLERR="Unable to start parse of message" Q
I IBHDR("MESSAGE TYPE")'["QRY"&(IBHDR("MESSAGE TYPE")'["DSR") Q
;
; extract some incoming message data from Cerner message IBARXC-QRY - QRY^R02
; or IBARXC-QRYRESP - DSR^Q03
F Q:'$$NEXTSEG^HLOPRS(.IBMSG,.IBSEG) S IBSEGT=$G(IBSEG("SEGMENT TYPE")) Q:IBSEGT="" D
. I IBSEGT="QRD" D QRD
. I IBSEGT="QRF" D QRF
. Q
; Process response, either return the requested seeding data to Cerner or save the seeding data received from cerner
S MSGTYPE=IBMSG("HDR","MESSAGE TYPE")
I MSGTYPE="DSR" D EN^IBARXCRD(ICN) Q ; Seeding QRYRESP returned from Cerner, process DSR
D EN^IBARXCSH(ICN,IBIEN,DATEQ) ; Seeding request QRY from Cerner, return/send vista data IBARXC-QRYRESP DSR^Q03
Q
;
QRD ;Parse QRD segment
S ICN=$$GET^HLOPRS(.IBSEG,9,1)
S DATEQ=$$GET^HLOPRS(.IBSEG,11,1)_"^"_$$GET^HLOPRS(.IBSEG,11,2)
;I 'DFN G END^IBARXCSH
Q
;
QRF ;Parse QRF segment
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBARXCR2 1814 printed Nov 22, 2024@17:17:06 Page 2
IBARXCR2 ;ALB/MKN-CERNER RXCOPAY RECEIVE HL7 QRY^R02 MESSAGE SEND DSR^Q03 ; 19 Feb 2021
+1 ;;2.0;INTEGRATED BILLING;**676,726**;21-MAR-94;Build 1
+2 ;
+3 ;IA# Supports
+4 ;------ -------------------------------------------------
+5 ;4718 $$STARTMSG^HLOPRS, $$NEXTSEG^HLOPRS, $$GET^HLOPRS
+6 ;4722 $$ACK^HLOAPI2, $$SENDACK^HLOAPI2
+7 ;
+8 ; Receives from Cerner the IBARXC-QRY - QRY^R02
+9 ; requesting seeding data from vista, return response IBARXC-QRYRESP DSR^Q03
+10 ; OR
+11 ; Receives from Cerner the IBARXC-QRYRESP - DSR^Q03
+12 ; proccess requested cerner seeding data, parse and save transactions
+13 ;
EN ; receives HL7 message QRY^R02 from Cerner and calls EN^IBARXSH to reply with DSR^Q03
+1 NEW DFN,IBHDR,IBMSG,IBSEG,IBSEGT,IBSTAT,IBWHAT,ICN,MSGTYPE,IBIEN,DATEQ,ERR,HLERR
+2 ;
+3 SET ERR=0
SET IBSTAT=$$STARTMSG^HLOPRS(.IBMSG,HLMSGIEN,.IBHDR)
+4 SET IBIEN=HLMSGIEN
+5 IF 'IBSTAT
SET HLERR="Unable to start parse of message"
QUIT
+6 IF IBHDR("MESSAGE TYPE")'["QRY"&(IBHDR("MESSAGE TYPE")'["DSR")
QUIT
+7 ;
+8 ; extract some incoming message data from Cerner message IBARXC-QRY - QRY^R02
+9 ; or IBARXC-QRYRESP - DSR^Q03
+10 FOR
if '$$NEXTSEG^HLOPRS(.IBMSG,.IBSEG)
QUIT
SET IBSEGT=$GET(IBSEG("SEGMENT TYPE"))
if IBSEGT=""
QUIT
Begin DoDot:1
+11 IF IBSEGT="QRD"
DO QRD
+12 IF IBSEGT="QRF"
DO QRF
+13 QUIT
End DoDot:1
+14 ; Process response, either return the requested seeding data to Cerner or save the seeding data received from cerner
+15 SET MSGTYPE=IBMSG("HDR","MESSAGE TYPE")
+16 ; Seeding QRYRESP returned from Cerner, process DSR
IF MSGTYPE="DSR"
DO EN^IBARXCRD(ICN)
QUIT
+17 ; Seeding request QRY from Cerner, return/send vista data IBARXC-QRYRESP DSR^Q03
DO EN^IBARXCSH(ICN,IBIEN,DATEQ)
+18 QUIT
+19 ;
QRD ;Parse QRD segment
+1 SET ICN=$$GET^HLOPRS(.IBSEG,9,1)
+2 SET DATEQ=$$GET^HLOPRS(.IBSEG,11,1)_"^"_$$GET^HLOPRS(.IBSEG,11,2)
+3 ;I 'DFN G END^IBARXCSH
+4 QUIT
+5 ;
QRF ;Parse QRF segment
+1 QUIT
+2 ;