[613] | 1 | SCDXFU13 ;ALB/JRP - ACRP TRANSMISSION MANAGEMENT FILE UTILS;14-JUL-97
|
---|
| 2 | ;;5.3;Scheduling;**128**;AUG 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | HST4XMIT(XMITPTR,ARRAY,FORMAT) ;Return transmission/acknowledgement history
|
---|
| 5 | ; for entry in Transmitted Outpatient Encounter file (#409.73)
|
---|
| 6 | ;
|
---|
| 7 | ;Input : XMITPTR - Pointer to entry in Transmitted Outpatient
|
---|
| 8 | ; Encounter file (#409.73)
|
---|
| 9 | ; ARRAY - Output array (full global reference)
|
---|
| 10 | ; - Defaults to ^TMP("SCDXFU13",$J,"HST4XMIT")
|
---|
| 11 | ; FORMAT - Flag denoting subscript for ARRAY
|
---|
| 12 | ; 0 = Subscript ARRAY by pointer to file (Default)
|
---|
| 13 | ; 1 = Subscript ARRAY by transmission date
|
---|
| 14 | ; 2 = Subscript ARRAY by acknowledgement date
|
---|
| 15 | ;Output : X - Number of times entry was transmitted
|
---|
| 16 | ; Format 0: ARRAY(HistPtr) = XmitDT ^ AckDT ^ Code ^ Late
|
---|
| 17 | ; Format 1: ARRAY(XmitDT) = HistPtr ^ AckDT ^ Code ^ Late
|
---|
| 18 | ; ARRAY(0 , HistPtr) = HistPtr ^ AckDT ^ Code ^ Late
|
---|
| 19 | ; Used when XmitDT not on file
|
---|
| 20 | ; Format 2: ARRAY(AckDT) = XmitDT ^ HistPtr ^ Code ^ Late
|
---|
| 21 | ; ARRAY(0 , HistPtr) = XmitDT ^ HistPtr ^ Code ^ Late
|
---|
| 22 | ; Used when AckDT not on file
|
---|
| 23 | ; HistPtr = Pointer to ACRP Transmission History file
|
---|
| 24 | ; XmitDT = Date/time of transmission (FileMan)
|
---|
| 25 | ; AckDT = Date/time of acknowledgement (FileMan)
|
---|
| 26 | ; Code = Acknowledgement code received
|
---|
| 27 | ; A = Accepted R = Rejected E = Error
|
---|
| 28 | ; Late = Transmission occur after workload close-out
|
---|
| 29 | ; 0 = No 1 = Yes -1 = Error
|
---|
| 30 | ;Notes : It is the responsibility of the calling procedure to
|
---|
| 31 | ; initialize (i.e. KILL) the output array
|
---|
| 32 | ; : Zero (0) is used when a transmission date is not on file
|
---|
| 33 | ; : Zero (0) is used when an acknowledgement date is not on file
|
---|
| 34 | ; : NULL is used when an acknowledgement code is not on file
|
---|
| 35 | ; : Determinating if transmission occured after close-out is
|
---|
| 36 | ; based on the currently stored workload close-out dates
|
---|
| 37 | ;
|
---|
| 38 | ;Check input
|
---|
| 39 | S XMITPTR=+$G(XMITPTR)
|
---|
| 40 | Q:('$D(^SD(409.73,XMITPTR,0))) 0
|
---|
| 41 | S ARRAY=$G(ARRAY)
|
---|
| 42 | S:(ARRAY="") ARRAY=$NA(^TMP("SCDXFU13",$J,"HST4XMIT"))
|
---|
| 43 | S FORMAT=+$G(FORMAT)
|
---|
| 44 | S:((FORMAT<0)!(FORMAT>2)) FORMAT=0
|
---|
| 45 | ;Declare variables
|
---|
| 46 | N HISTPTR,XMITDATE,ACKDATE,ACKCODE,COUNT,NODE,LATE
|
---|
| 47 | ;Find/count entries in history file
|
---|
| 48 | S COUNT=0
|
---|
| 49 | S HISTPTR=0
|
---|
| 50 | F S HISTPTR=+$O(^SD(409.77,"B",XMITPTR,HISTPTR)) Q:('HISTPTR) D
|
---|
| 51 | .;Bad x-ref entry (ignore)
|
---|
| 52 | .Q:('$D(^SD(409.77,HISTPTR,0)))
|
---|
| 53 | .;Increment counter
|
---|
| 54 | .S COUNT=COUNT+1
|
---|
| 55 | .;Get transmission date
|
---|
| 56 | .S XMITDATE=+$G(^SD(409.77,HISTPTR,1))
|
---|
| 57 | .;Get node containing acknowledgement data
|
---|
| 58 | .S NODE=$G(^SD(409.77,HISTPTR,2))
|
---|
| 59 | .;Get ack date
|
---|
| 60 | .S ACKDATE=+$P(NODE,"^",1)
|
---|
| 61 | .;Get ack code
|
---|
| 62 | .S ACKCODE=$P(NODE,"^",2)
|
---|
| 63 | .;Determine if transmitted after close-out
|
---|
| 64 | .S LATE=+$$LATE^SCDXFU11(HISTPTR)
|
---|
| 65 | .;Put into output array
|
---|
| 66 | .I (FORMAT=1) D Q
|
---|
| 67 | ..S NODE=HISTPTR_"^"_ACKDATE_"^"_ACKCODE_"^"_LATE
|
---|
| 68 | ..I ('XMITDATE) S @ARRAY@(0,HISTPTR)=NODE Q
|
---|
| 69 | ..S @ARRAY@(XMITDATE)=NODE
|
---|
| 70 | .I (FORMAT=2) D Q
|
---|
| 71 | ..S NODE=XMITDATE_"^"_HISTPTR_"^"_ACKCODE_"^"_LATE
|
---|
| 72 | ..I ('ACKDATE) S @ARRAY@(0,HISTPTR)=NODE Q
|
---|
| 73 | ..S @ARRAY@(ACKDATE)=NODE
|
---|
| 74 | .S @ARRAY@(HISTPTR)=XMITDATE_"^"_ACKDATE_"^"_ACKCODE_"^"_LATE
|
---|
| 75 | ;Done
|
---|
| 76 | Q COUNT
|
---|
| 77 | ;
|
---|
| 78 | HST4VID(VSITID,ARRAY,FORMAT) ;Return transmission/acknowledgement history
|
---|
| 79 | ; for Unique Visit ID (field #20 of Outpatient Encounter file)
|
---|
| 80 | ;
|
---|
| 81 | ;Input : VSITID - Unique Visit ID
|
---|
| 82 | ; ARRAY - Output array (full global reference)
|
---|
| 83 | ; - Defaults to ^TMP("SCDXFU13",$J,"HST4VID")
|
---|
| 84 | ; FORMAT - Flag denoting subscript for ARRAY
|
---|
| 85 | ; 0 = Subscript ARRAY by pointer to file (Default)
|
---|
| 86 | ; 1 = Subscript ARRAY by transmission date
|
---|
| 87 | ; 2 = Subscript ARRAY by acknowledgement date
|
---|
| 88 | ;Output : X - Number of Unique Visit ID was transmitted
|
---|
| 89 | ; Format 0: ARRAY(HistPtr) = XmitDT ^ AckDT ^ Code ^ Late
|
---|
| 90 | ; Format 1: ARRAY(XmitDT) = HistPtr ^ AckDT ^ Code ^ Late
|
---|
| 91 | ; ARRAY(0 , HistPtr) = HistPtr ^ AckDT ^ Code ^ Late
|
---|
| 92 | ; Used when XmitDT not on file
|
---|
| 93 | ; Format 2: ARRAY(AckDT) = XmitDT ^ HistPtr ^ Code ^ Late
|
---|
| 94 | ; ARRAY(0 , HistPtr) = XmitDT ^ HistPtr ^ Code ^ Late
|
---|
| 95 | ; Used when AckDT not on file
|
---|
| 96 | ; HistPtr = Pointer to ACRP Transmission History file
|
---|
| 97 | ; XmitDT = Date/time of transmission (FileMan)
|
---|
| 98 | ; AckDT = Date/time of acknowledgement (FileMan)
|
---|
| 99 | ; Code = Acknowledgement code received
|
---|
| 100 | ; A = Accepted R = Rejected E = Error
|
---|
| 101 | ; Late = Transmission occur after workload close-out
|
---|
| 102 | ; 0 = No 1 = Yes
|
---|
| 103 | ;Notes : It is the responsibility of the calling procedure to
|
---|
| 104 | ; initialize (i.e. KILL) the output array
|
---|
| 105 | ; : Zero (0) is used when a transmission date is not on file
|
---|
| 106 | ; : Zero (0) is used when an acknowledgement date is not on file
|
---|
| 107 | ; : NULL is used when an acknowledgement code is not on file
|
---|
| 108 | ; : Determinating if transmission occured after close-out is
|
---|
| 109 | ; based on the currently stored workload close-out dates
|
---|
| 110 | ;
|
---|
| 111 | ;Check input
|
---|
| 112 | S VSITID=$G(VSITID)
|
---|
| 113 | Q:(VSITID="") 0
|
---|
| 114 | S ARRAY=$G(ARRAY)
|
---|
| 115 | S:(ARRAY="") ARRAY=$NA(^TMP("SCDXFU13",$J,"HST4VID"))
|
---|
| 116 | S FORMAT=+$G(FORMAT)
|
---|
| 117 | S:((FORMAT<0)!(FORMAT>2)) FORMAT=0
|
---|
| 118 | ;Declare variables
|
---|
| 119 | N HISTPTR,XMITDATE,ACKDATE,ACKCODE,COUNT,NODE,LATE
|
---|
| 120 | ;Find/count entries in history file
|
---|
| 121 | S COUNT=0
|
---|
| 122 | S HISTPTR=0
|
---|
| 123 | F S HISTPTR=+$O(^SD(409.77,"AVID",VSITID,HISTPTR)) Q:('HISTPTR) D
|
---|
| 124 | .;Bad x-ref entry (ignore)
|
---|
| 125 | .Q:('$D(^SD(409.77,HISTPTR,0)))
|
---|
| 126 | .;Increment counter
|
---|
| 127 | .S COUNT=COUNT+1
|
---|
| 128 | .;Get transmission date
|
---|
| 129 | .S XMITDATE=+$G(^SD(409.77,HISTPTR,1))
|
---|
| 130 | .;Get node containing acknowledgement data
|
---|
| 131 | .S NODE=$G(^SD(409.77,HISTPTR,2))
|
---|
| 132 | .;Get ack date
|
---|
| 133 | .S ACKDATE=$P(NODE,"^",1)
|
---|
| 134 | .;Get ack code
|
---|
| 135 | .S ACKCODE=$P(NODE,"^",2)
|
---|
| 136 | .;Determine if transmitted after close-out
|
---|
| 137 | .S LATE=+$$LATE^SCDXFU11(HISTPTR)
|
---|
| 138 | .;Put into output array
|
---|
| 139 | .I (FORMAT=1) D Q
|
---|
| 140 | ..S NODE=HISTPTR_"^"_ACKDATE_"^"_ACKCODE_"^"_LATE
|
---|
| 141 | ..I ('XMITDATE) S @ARRAY@(0,HISTPTR)=NODE Q
|
---|
| 142 | ..S @ARRAY@(XMITDATE)=NODE
|
---|
| 143 | .I (FORMAT=2) D Q
|
---|
| 144 | ..S NODE=XMITDATE_"^"_HISTPTR_"^"_ACKCODE_"^"_LATE
|
---|
| 145 | ..I ('ACKDATE) S @ARRAY@(0,HISTPTR)=NODE Q
|
---|
| 146 | ..S @ARRAY@(ACKDATE)=NODE
|
---|
| 147 | .S @ARRAY@(HISTPTR)=XMITDATE_"^"_ACKDATE_"^"_ACKCODE_"^"_LATE
|
---|
| 148 | ;Done
|
---|
| 149 | Q COUNT
|
---|