Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBARXCQR

IBARXCQR.m

Go to the documentation of this file.
IBARXCQR ;ALB/LEG-CERNER RXCOPAY SEND QRY REQUEST ; 23 Feb 2021
 ;;2.0;INTEGRATED BILLING;**676**;21-MAR-94;Build 34
 ;
 ;Build and send to cerner the IBARXC-QRY - QRY^R02 query requesting cerner seeding data 
 ;
EN(DFN,IBDT) ;start processing message
 ; DFN      - IEN of Patient
 ; IBDT - date within the required billing period
 ;
 N %P1,ERROR,FIELD,ICN,MSG,SEG,VALUE,WHOTO,X,XDT,XXX,NAME
 N PARMS
 ;S FACID=$$SITE^VASITE
 D MSH
 D QRD
 D QRF
 D SEND
 Q
 ;
MSH ;SET VARIABLES FOR THE MSH SEGMENT
 N PARMS K ^TMP("QRY")
 S PARMS("COUNTRY")="USA"
 S PARMS("MESSAGE TYPE")="QRY"
 S PARMS("EVENT")="R02"
 S PARMS("VERSION")="2.3"
 S PARMS("MESSAGE STRUCTURE")="QRY_R02"
 S MSG="^TMP("_"QRY"
 S X=$$NEWMSG^HLOAPI(.PARMS,.MSG,.ERROR)
 Q
 ;
QRD ;BUILD THE QRD SEGMENT
 S VALUE="QRD",FIELD=0 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S %P1=$$NOW^XLFDT() S %P1=$$FMTHL7^XLFDT(%P1)
 S VALUE=%P1,FIELD=1 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S VALUE=1,FIELD=2 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S VALUE=1,FIELD=3 D SET^HLOAPI(.SEG,VALUE,FIELD)
 ;Need to speak with VDIF about this not being available
 ;S X=FACID_" A"
 ;S X=$O(^HLB("B",X),-1)
 ;S X=$O(^HLB("B",X,0))
 ;S QRYNUM=X+1
 ;S VALUE=$G(QRYNUM),FIELD=4 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S VALUE=1,FIELD=7 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S NAME=$$GET1^DIQ(2,DFN_",",.01)
 S VALUE=$P(NAME,",",1),FIELD=8 D SET^HLOAPI(.SEG,VALUE,FIELD,1)
 S VALUE=$P(NAME,",",2),FIELD=8 D SET^HLOAPI(.SEG,VALUE,FIELD,2)
 S ICN=$$ICN^IBARXMU(DFN)
 S VALUE=ICN,FIELD=9 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S VALUE="",FIELD=10 D SET^HLOAPI(.SEG,VALUE,FIELD)
 S FIELD=11
 S VALUE=$E(IBDT,4,5) D SET^HLOAPI(.SEG,VALUE,FIELD,1)
 S VALUE=($E(IBDT,1,3)+1700) D SET^HLOAPI(.SEG,VALUE,FIELD,2)
 S X=$$ADDSEG^HLOAPI(.MSG,.SEG,.ERROR)
 Q
 ;
QRF ;
 S FIELD=0,VALUE="QRF" D SET^HLOAPI(.SEG,VALUE,FIELD)
 S FIELD=1,VALUE="IBARXC-TRANS" D SET^HLOAPI(.SEG,VALUE,FIELD)
 S FIELD=4,X=$$GET1^DIQ(2,DFN_",",.09),VALUE=$E(X,$L(X)-3,$L(X)) D SET^HLOAPI(.SEG,VALUE,FIELD) ;Last 4 of SSN
 S X=$$ADDSEG^HLOAPI(.MSG,.SEG,.ERROR)
 Q
 ;
SEND ;SEND THE MESSAGE
 S PARMS("SENDING APPLICATION")="IBARXC-QRY"
 S WHOTO("RECEIVING APPLICATION")="IBARXC-QRYRESP"
 S WHOTO("STATION NUMBER")="200CRNR"
 S WHOTO("MIDDLEWARE LINK NAME")="IBARXCVDF"
 S XXX=$$SENDONE^HLOAPI1(.MSG,.PARMS,.WHOTO,.ERROR)
 H 20
 Q
 ;