- DGROAPI ;DJH/AMA - ROM EXTERNAL USER INTERFACE APIs ; 27 Apr 2004 4:42 PM
- ;;5.3;Registration;**533,572,1015**;Aug 13, 1993;Build 21
- ;
- ;This routine contains API entry points that are used by packages
- ;and modules that are external to the Register Once module.
- ;
- Q ;no direct entry
- ;
- ROMQRY(DGDFN) ;query the LST for all patient demographic data
- ;This function queries a given patient's Last Site Treated (LST)
- ;site to retrieve all patient demographic data for the patient.
- ;The function will only succeed when the QRY HL7 interface is
- ;enabled, the patient has a national Integrated Control Number
- ;(ICN), the patient's LST is not the local site and the HL7 query
- ;receives an ACK from the LST site.
- ;
- ; Input:
- ; DGDFN - pointer to patient in PATIENT (#2) file
- ;
- ; Output:
- ; Function value - 1 on success, 0 on failure
- ;
- N DGRSLT,STRTIME,ENDTIME,ELAPTIME
- S STRTIME=$P($H,",",2)
- ;
- S DGRSLT=$$SNDQRY^DGROHLS(DGDFN)
- S ENDTIME=$P($H,",",2)
- S ELAPTIME=ENDTIME-STRTIME
- I DGRSLT=0&(ELAPTIME>59) D
- . S DGMSG(1)=" "
- . S DGMSG(2)="The connection to the Last Site Treated failed and timed out."
- . S DGMSG(3)="Please continue with registration."
- . S DGMSG(4)=" "
- . D EN^DDIOL(.DGMSG)
- ;
- Q $G(DGRSLT) ;ihs/cmi/maw 02/08/2012 patch 1014 no IB
- I DGRSLT D
- . N ZTSAVE,A,ZTRTN,ZTDESC,ZTIO,ZTDTH,DGMSG
- . ;Invoke IB Insurance Query (Patch IB*2.0*214)
- . S ZTSAVE("IBTYPE")=1,ZTSAVE("DFN")=DGDFN,ZTSAVE("IBDUZ")=$G(DUZ)
- . S ZTRTN="BACKGND^IBCNRDV"
- . S ZTDTH=$H
- . S ZTDESC="IBCN INSURANCE QUERY TASK"
- . S ZTIO=""
- . D ^%ZTLOAD
- . ;display busy message to interactive users
- . S DGMSG(2)="Insurance data retrieval has been initiated."
- . S DGMSG(3)=" "
- . D EN^DDIOL(.DGMSG) R A:5
- Q DGRSLT
- ;
- DGROAPI ;DJH/AMA - ROM EXTERNAL USER INTERFACE APIs ; 27 Apr 2004 4:42 PM
- +1 ;;5.3;Registration;**533,572,1015**;Aug 13, 1993;Build 21
- +2 ;
- +3 ;This routine contains API entry points that are used by packages
- +4 ;and modules that are external to the Register Once module.
- +5 ;
- +6 ;no direct entry
- QUIT
- +7 ;
- ROMQRY(DGDFN) ;query the LST for all patient demographic data
- +1 ;This function queries a given patient's Last Site Treated (LST)
- +2 ;site to retrieve all patient demographic data for the patient.
- +3 ;The function will only succeed when the QRY HL7 interface is
- +4 ;enabled, the patient has a national Integrated Control Number
- +5 ;(ICN), the patient's LST is not the local site and the HL7 query
- +6 ;receives an ACK from the LST site.
- +7 ;
- +8 ; Input:
- +9 ; DGDFN - pointer to patient in PATIENT (#2) file
- +10 ;
- +11 ; Output:
- +12 ; Function value - 1 on success, 0 on failure
- +13 ;
- +14 NEW DGRSLT,STRTIME,ENDTIME,ELAPTIME
- +15 SET STRTIME=$PIECE($HOROLOG,",",2)
- +16 ;
- +17 SET DGRSLT=$$SNDQRY^DGROHLS(DGDFN)
- +18 SET ENDTIME=$PIECE($HOROLOG,",",2)
- +19 SET ELAPTIME=ENDTIME-STRTIME
- +20 IF DGRSLT=0&(ELAPTIME>59)
- Begin DoDot:1
- +21 SET DGMSG(1)=" "
- +22 SET DGMSG(2)="The connection to the Last Site Treated failed and timed out."
- +23 SET DGMSG(3)="Please continue with registration."
- +24 SET DGMSG(4)=" "
- +25 DO EN^DDIOL(.DGMSG)
- End DoDot:1
- +26 ;
- +27 ;ihs/cmi/maw 02/08/2012 patch 1014 no IB
- QUIT $GET(DGRSLT)
- +28 IF DGRSLT
- Begin DoDot:1
- +29 NEW ZTSAVE,A,ZTRTN,ZTDESC,ZTIO,ZTDTH,DGMSG
- +30 ;Invoke IB Insurance Query (Patch IB*2.0*214)
- +31 SET ZTSAVE("IBTYPE")=1
- SET ZTSAVE("DFN")=DGDFN
- SET ZTSAVE("IBDUZ")=$GET(DUZ)
- +32 SET ZTRTN="BACKGND^IBCNRDV"
- +33 SET ZTDTH=$HOROLOG
- +34 SET ZTDESC="IBCN INSURANCE QUERY TASK"
- +35 SET ZTIO=""
- +36 DO ^%ZTLOAD
- +37 ;display busy message to interactive users
- +38 SET DGMSG(2)="Insurance data retrieval has been initiated."
- +39 SET DGMSG(3)=" "
- +40 DO EN^DDIOL(.DGMSG)
- READ A:5
- End DoDot:1
- +41 QUIT DGRSLT
- +42 ;