- DGROAPI ;DJH/AMA - ROM EXTERNAL USER INTERFACE APIs ; 27 Apr 2004 4:42 PM
- ;;5.3;Registration;**533,572,1102**;Aug 13, 1993;Build 4
- ;
- ;This routine contains API entry points that are used by packages
- ;and modules that are external to the Register Once module.
- ;
- ; Reference to (#350.9,54.01) supported by ICR #7429
- ; Reference to BACKGND^IBCNRDV supported by ICR #4288
- 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)
- ;
- I DGRSLT D
- . N ZTSAVE,A,ZTRTN,ZTDESC,ZTIO,ZTDTH,DGMSG
- . ;Invoke IB Insurance Query (Query was introduced with IB*2.0*214)
- . ;DG*1102/TAZ - Check Insurance Import Enabled flag
- . ; Reference to Field 54.01 in File 350.9 supported by ICR #7429
- . I '$$GET1^DIQ(350.9,"1,",54.01,"I") D Q
- .. S DGMSG(1)="Insurance data retrieval is not currently enabled."
- .. S DGMSG(2)=" "
- .. D EN^DDIOL(.DGMSG) R A:5
- . S ZTSAVE("IBTYPE")=1,ZTSAVE("DFN")=DGDFN,ZTSAVE("IBDUZ")=$G(DUZ)
- . S ZTRTN="BACKGND^IBCNRDV" ;Supported by ICR #4288
- . 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
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGROAPI 2161 printed Feb 19, 2025@00:21:11 Page 2
- DGROAPI ;DJH/AMA - ROM EXTERNAL USER INTERFACE APIs ; 27 Apr 2004 4:42 PM
- +1 ;;5.3;Registration;**533,572,1102**;Aug 13, 1993;Build 4
- +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 ; Reference to (#350.9,54.01) supported by ICR #7429
- +7 ; Reference to BACKGND^IBCNRDV supported by ICR #4288
- +8 ;no direct entry
- QUIT
- +9 ;
- 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 IF DGRSLT
- Begin DoDot:1
- +28 NEW ZTSAVE,A,ZTRTN,ZTDESC,ZTIO,ZTDTH,DGMSG
- +29 ;Invoke IB Insurance Query (Query was introduced with IB*2.0*214)
- +30 ;DG*1102/TAZ - Check Insurance Import Enabled flag
- +31 ; Reference to Field 54.01 in File 350.9 supported by ICR #7429
- +32 IF '$$GET1^DIQ(350.9,"1,",54.01,"I")
- Begin DoDot:2
- +33 SET DGMSG(1)="Insurance data retrieval is not currently enabled."
- +34 SET DGMSG(2)=" "
- +35 DO EN^DDIOL(.DGMSG)
- READ A:5
- End DoDot:2
- QUIT
- +36 SET ZTSAVE("IBTYPE")=1
- SET ZTSAVE("DFN")=DGDFN
- SET ZTSAVE("IBDUZ")=$GET(DUZ)
- +37 ;Supported by ICR #4288
- SET ZTRTN="BACKGND^IBCNRDV"
- +38 SET ZTDTH=$HOROLOG
- +39 SET ZTDESC="IBCN INSURANCE QUERY TASK"
- +40 SET ZTIO=""
- +41 DO ^%ZTLOAD
- +42 ;display busy message to interactive users
- +43 SET DGMSG(2)="Insurance data retrieval has been initiated."
- +44 SET DGMSG(3)=" "
- +45 DO EN^DDIOL(.DGMSG)
- READ A:5
- End DoDot:1
- +46 QUIT DGRSLT
- +47 ;