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

SD53747P.m

Go to the documentation of this file.
  1. SD53747P ;MNT/BJR - Clean up Untransmitted Encounters ; Apr 01, 2020@19:34
  1. ;;5.3;Scheduling;**747**;Aug 13, 1993;Build 5
  1. ;
  1. Q
  1. ;
  1. ;Reference to $$EMGRES^DGUTL supported by ICR # 4800
  1. ;Reference to $$SITE^VASITE supported by ICR # 10112
  1. ;Reference to $$FMTE^XLFDT supported by ICR # 10103
  1. ;Reference to $$HTE^XLFDT supported by ICR # 10103
  1. ;Reference to $$NOW^XLFDT supported by ICR # 10103
  1. ;Reference to $$SCH^XLFDT supported by ICR # 10103
  1. ;Reference to ^XMD supported by ICR # 10070
  1. ;Reference to BMES^XPDUTL supported by ICR # 10141
  1. ;Reference to MES^XPDUTL supported by ICR # 10141
  1. ;
  1. POST ;Scan the TRANSMITTED OUTPATIENT ENCOUNTER file (#409.73) for records
  1. ;transmitted with the Pandemic EMERGENCY RESPONSE INDICATOR.
  1. ;
  1. N SDTIEN ;Transmitted Outpatient Encounter file pointer
  1. N SDENCPTR ;Outpatient Encounter file pointer
  1. N SDREQUE ;Count of messages re-queued
  1. N SDSTART ;start date/time
  1. N SDXMITDT ;Date/Time Counter
  1. N SDERIDT ;Pandemic patch earliest install date
  1. N SDDFN ;IEN to PATIENT file (#2)
  1. ;
  1. K ^TMP("SD53747P",$J)
  1. S SDERIDT=3200327
  1. S SDSTART=$$NOW^XLFDT
  1. S SDREQUE=0
  1. S SDXMITDT=SDERIDT-.00001
  1. D MES^XPDUTL("Performing Ambulatory Care Validation Checks...")
  1. F S SDXMITDT=$O(^SD(409.73,"AACXMIT",SDXMITDT)) Q:'SDXMITDT D
  1. . S SDTIEN=0
  1. . F S SDTIEN=$O(^SD(409.73,"AACXMIT",SDXMITDT,SDTIEN)) Q:'SDTIEN D
  1. . . S SDENCPTR=$P($G(^SD(409.73,SDTIEN,0)),U,2)
  1. . . Q:'SDENCPTR
  1. . . S SDDFN=$P($G(^SCE(SDENCPTR,0)),U,2)
  1. . . Q:($$EMGRES^DGUTL(SDDFN)'="P")
  1. . . D FLG(SDTIEN)
  1. . . S SDREQUE=SDREQUE+1
  1. ;send completion MailMan message
  1. D NOTIFY(SDSTART,SDREQUE)
  1. Q
  1. ;
  1. NOTIFY(SDSTIME,SDREQ) ;send job completion msg
  1. ;
  1. ; Input
  1. ; SDSTIME - job start date/time
  1. ; SDREQ - count of untransmitted encounters re-queued
  1. ;
  1. ; Output
  1. ; none
  1. ;
  1. N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
  1. N SDSITE,SDETIME,SDTEXT,LINECT
  1. S SDSITE=$$SITE^VASITE
  1. S SDETIME=$$NOW^XLFDT
  1. S XMDUZ="Untransmitted Encounters Re-queue"
  1. S XMSUB="Patch SD*5.3*747 Pandemic ERI (Encounter Transmissions)"
  1. S XMTEXT="^TMP(""SD53747P"",$J,"
  1. S XMY(DUZ)=""
  1. S ^TMP("SD53747P",$J,1)=""
  1. S ^TMP("SD53747P",$J,2)=" Facility Name: "_$P(SDSITE,U,2)
  1. S ^TMP("SD53747P",$J,3)=" Station Number: "_$P(SDSITE,U,3)
  1. S ^TMP("SD53747P",$J,4)=""
  1. S ^TMP("SD53747P",$J,5)=" Date/Time job started: "_$$FMTE^XLFDT(SDSTIME)
  1. S ^TMP("SD53747P",$J,6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SDETIME)
  1. S ^TMP("SD53747P",$J,7)=""
  1. S ^TMP("SD53747P",$J,9)="Total untransmitted encounters re-queued : "_SDREQ
  1. S ^TMP("SD53747P",$J,10)="Please Note: There is no user intervention required with the re-transmission"
  1. S ^TMP("SD53747P",$J,11)="of the untransmitted encounters. They will be retransmitted via the nightly"
  1. S ^TMP("SD53747P",$J,12)="background job that is scheduled at your site."
  1. D ^XMD K ^TMP("SD53747P",$J),XMY
  1. Q
  1. FLG(SDXMT) ; Entry point for Reflag Transmission protocol
  1. N SDRTN
  1. S SDRTN=$$VALIDATE^SCMSVUT2(SDXMT)
  1. I SDRTN<0 Q
  1. S SDRTN=$$SETRFLG(SDXMT)
  1. I SDRTN<0 D MES^XPDUTL("There was a problem reflagging the transmission for "_SDXMT)
  1. Q
  1. ;
  1. SETRFLG(SDXMT) ;
  1. ; Input
  1. ; SDXMT - Pointer to Transmission File, #409.73
  1. ;
  1. ; Output
  1. ; -1 - There was a problem reflagging the transmission
  1. ; 0 - No errors occurred
  1. ; 1 - The entry is already flagged for transmission
  1. ;
  1. N SDRSLT,SDSTAT
  1. S SDRSLT=-1
  1. S SDSTAT=$P($G(^SD(409.73,SDXMT,0)),U,4)
  1. I SDSTAT S SDRSLT=1
  1. E D
  1. . D XMITFLAG^SCDXFU01(SDXMT,0),STREEVNT^SCDXFU01(SDXMT,0)
  1. . S SDRSLT=0
  1. Q SDRSLT
  1. ;