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

DGPFLMT5.m

Go to the documentation of this file.
  1. DGPFLMT5 ;ALB/RBS - PRF TRANSMIT REJECT MESSAGE PROCESSING ; 7/12/06 09:30am
  1. ;;5.3;Registration;**650,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;no direct entry
  1. QUIT
  1. ;
  1. ;
  1. EN(DGVALMY) ;Entry point to retransmit rejected messages
  1. ;This function will retransmit all user selected "RJ" Rejected status
  1. ;entries of the PRF HL7 TRANSMISSION LOG (#26.17) file to the
  1. ;Treating Facility that rejected it.
  1. ;
  1. ; Input:
  1. ; DGVALMY - VALMY array of user selections, pass by reference
  1. ;
  1. ; Output:
  1. ; Function value - 1 on success, 0 on failure
  1. ;
  1. ;- Use the 0 node sort file for all retransmission processing:
  1. ; ^TMP("DGPFSORT",$J,0,<assignment ien>,<site ien>,<HL7 log ien>)=""
  1. ; Each patient's PRF Assignment record is grouped with all of the
  1. ; Treating Facilities that logged a rejected HL7 transmission entry.
  1. ;
  1. N DGAIEN ;assignment ien
  1. N DGFAC ;destination station number
  1. N DGHLIEN ;loop var
  1. N DGNODE ;"IDX" data string
  1. N DGRSLT ;function value
  1. N DGSEL ;user selection
  1. N DGSITE ;site transmitted to ien
  1. ;
  1. ;set screen to full scroll region
  1. D FULL^VALM1
  1. W !
  1. ;
  1. ;- Use the "IDX" selection entry to get the assignment info
  1. ; <assignment ien>^<site ien>^<HL7 log ien>^<patient dfn>^<patient name>^<site name>
  1. ;
  1. S DGRSLT=0
  1. I $O(DGVALMY(""))'="" D
  1. . S DGSEL=0
  1. . F S DGSEL=$O(DGVALMY(DGSEL)) Q:'DGSEL D
  1. . . S DGNODE=$G(^TMP("DGPFLMT",$J,"IDX",DGSEL,DGSEL))
  1. . . Q:'DGNODE
  1. . . S DGAIEN=$P(DGNODE,U,1)
  1. . . Q:'DGAIEN
  1. . . S DGSITE=$P(DGNODE,U,2)
  1. . . Q:'DGSITE
  1. . . ;
  1. . . ;- retransmit assignment -
  1. . . ; display patient name and site transmitted to failure & success
  1. . . ;
  1. . . I '$$XMIT(DGAIEN,DGSITE) D Q
  1. . . . W !,">>>",?5,DGSEL,". ",$P(DGNODE,U,5),"...failed to retransmit to...",$P(DGNODE,U,6)
  1. . . E W !?5,DGSEL,". ",$P(DGNODE,U,5),"...was retransmitted to...",$P(DGNODE,U,6)
  1. . . ;
  1. . . ;- Now set all of the Assignment's HL7 transmission log entry's
  1. . . ; to "RT" RE-TRANSMITTED status.
  1. . . ;- loop ^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,n) nodes
  1. . . S DGHLIEN=0
  1. . . F S DGHLIEN=$O(^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,DGHLIEN)) Q:'DGHLIEN D
  1. . . . ;- update HL7 transmission log entry status
  1. . . . ;
  1. . . . D STOSTAT^DGPFHLL(26.17,DGHLIEN,"RT")
  1. . . ;
  1. . . S DGRSLT=1
  1. ;
  1. Q DGRSLT
  1. ;
  1. XMIT(DGAIEN,DGSITE) ;call out to retransmit
  1. ;This function is used to call the PRF (ORU~R01) function to transmit
  1. ;a patient's Assignment record and all History records to a single
  1. ;Treating Facility.
  1. ;
  1. ; Supported DBIA #2171: $$STA^XUAF4
  1. ; This supported DBIA is used to access the Kernel API to convert
  1. ; a station number to an INSTITUTION (#4) file IEN.
  1. ;
  1. ; Input: (required)
  1. ; DGAIEN - assignment ien
  1. ; DGSITE - site transmitted to ien
  1. ;
  1. ; Output:
  1. ; Function value - 1 on success, 0 on failure
  1. ;
  1. N DGFAC ;destination station number array
  1. N DGHIENS ;array of assignment history ien's
  1. N DGRSLT ;function value
  1. S DGRSLT=0
  1. ;
  1. I +$G(DGAIEN)>0 D
  1. . K DGFAC,DGHIENS
  1. . ;
  1. . ;convert institution# to station#
  1. . S DGFAC(1)=$$STA^XUAF4(DGSITE)
  1. . Q:'DGFAC(1)
  1. . ;
  1. . ;get all assignment history ien's
  1. . Q:'$$GETALLDT^DGPFAAH(DGAIEN,.DGHIENS)
  1. . ;
  1. . ;build and transmit the new message
  1. . Q:'$$SNDORU^DGPFHLS(DGAIEN,.DGHIENS,.DGFAC)
  1. . ;
  1. . S DGRSLT=1
  1. ;
  1. Q DGRSLT