VAFCDD01 ;ALB/JRP,LTL-DATA DICTIONARY UTILITIES ;05-SEP-1996
;;5.3;Registration;**91,149**;Jun 06, 1996
AVAFC(DFN) ;AVAFC* cross reference for PATIENT file (#2)
;
;Input : IFN - Pointer to entry in PATIENT file (#2)
;Output : None
; VAFCFLG will be set to 1 if the cross reference is
; not executed because the change is being made from
; within the Registration process. This notifies
; Registration that a change was made and that this
; cross reference should be executed if the Registration
; process is aborted.
;
;Notes : The AVAFC* cross references are used to remember that
; changes were made to the PATIENT file (#2) outside of
; the Registration process. Execution of this cross
; reference will create an entry in the ADT/HL7 PIVOT
; file (#391.71) and mark it as requiring transmission
; of an HL7 ADT-A08 message.
;
; : Execution of this cross reference can be prevented by
; setting the local variables: VAFCA08 equal to 1
; VAFHCA08 equal to 1
;
; : If only one of the CA08 variables is set to 1 an entry
; will be made in the pivot file (#391.71) but the
; corresponding transmission flag will not be set. In this
; case setting VAFCA08=1 will prevent the REQUIRES TRANSMISSION
; flag from being set and setting VAFHCA08=1 will prevent the
; TRANSMITTED-REQUIRES TRANSMISSION flag from being set.
; This allows control for sending HL7 and/or HL7v2.3
;
;Check input
I +$G(DFN),$D(^DPT(DFN,0))
E Q
;quit if re-indexing
Q:$D(DIU(0))
;
N VARPTR,PIVOTNUM ;Declare variables
;
DO K VAFCF ; do HL7 V2.3 MESSAGING
.;CHECK TURNOFF FLAG
.Q:$D(VAFCA08)
.;IF SEND HL7 V2.3 MESSAGES IN MAS PARAMETER FILE IS SET
.;TO SEND/SUSPEND THEN DO IT, ELSE QUIT
.I '$P($$SEND^VAFHUTL(),"^",2) Q
.;IF in Registration option, save fields edited
.I $$REG() D Q
. . Q:$G(VAFCF)=""
. . S VAFCFLDS(VAFCF)=""
.;IF NOT IN REGISTRATION DO THIS
.D PVT4A08(DFN)
.I PIVOTNUM<0 Q
.; set need to transmit flag
.D XMITFLAG(0,PIVOTNUM)
;
DO ; do HL7 V2.2 MESSAGING
.Q:$G(VAFHCA08)
.Q:$G(VAFCFLG)
.I $$EN^VAFHREG() S VAFCFLG=1 Q
.I '$$SEND^VAFHUTL() Q
.I +$G(PIVOTNUM)<0 Q ; its already been called and failed quit
.I '$G(PIVOTNUM) D PVT4A08(DFN) ; set ac xref and pivot
.I PIVOTNUM<0 Q
.; set requires transmission-Yes flag
.D SETTFLAG(0,PIVOTNUM)
.;done
QUIT
;
PVT4A08(DFN) ;Create entry in ADT/HL7 PIVOT file for an ADT-A08 event
; and mark it for transmission
;
;Input : IFN - Pointer to entry in PATIENT file (#2)
;Output : None
;Notes : There are no checks to determine if the entry should be
; created (other than input of a valid DFN)
;
;Check input
I +$G(DFN),$D(^DPT(DFN,0))
E QUIT
;Declare variables don't new for call from top
;N VARPTR,PIVOTNUM
;Set variable pointer used by ADT/HL7 PIVOT file
S VARPTR=DFN_";DPT("
;Create entry
S PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,$P(DT,"."),4,VARPTR)
Q:(PIVOTNUM<0)
;Mark entry as requires transmission
I $P($$SEND^VAFHUTL(),"^",2) D XMITFLAG(0,PIVOTNUM)
;Mark entry as transmitted field YES
I $G(VAFCFLG),$$SEND^VAFHUTL() D SETTFLAG(0,PIVOTNUM)
;Done
Q
;
PROCESS() ;
;This call simply processes the array elements in the VAFCFLDS
;variable into a string
Q:'$D(VAFCFLDS) -1
N INDEX,RETURN S INDEX="",RETURN=""
F S INDEX=$O(VAFCFLDS(INDEX)) Q:INDEX="" D
. S RETURN=RETURN_INDEX
Q:$G(RETURN)="" -1
Q RETURN
;
REGEDIT(PIVOTNUM,FIELDS) ;
;This call is used to generate an HL7 VERSION 2.3 A04 or A08 message
;from the pivot file the A04 is generated from DGREG00 when a
;Registration is known to have been completed. The A08 message
;is generated from DGREG0 when the Registration option was used
;to edit some fields, but the Registration was never completed.
;FIELDS variable contains the fields edited during the session.
S DIE="391.71",DA=PIVOTNUM
S DR="2.1///^S X=FIELDS"
D ^DIE
K DIE,DA,DR
Q
TRANSMIT(PIVOTNUM) ;
;This call is used to simply set the 'Requires Transmission'
;flag in the pivot file
S DIE="391.71",DA=PIVOTNUM
S DR=".08///^S X=1"
D ^DIE
K DIE,DA,DR
Q
;
MESSAGE(PIVOTPTR,NUMBER) ;
;This tag stuffs the message id from hl7 into pivot file
S DIE="391.71",DA=PIVOTPTR
S DR="1.1///^S X=NUMBER"
D ^DIE
K DIE,DA,DR
Q
;
REG() ;
;this tag looks at what option the user is in at the time
;
I $P($G(XQY0),"^")="DG REGISTER PATIENT" Q 1
I $P($G(XQY0),"^")="DGRPT 10-10T REGISTRATION" Q 1
Q 0
;
HL7A08 ;
I $D(VAFHMRG) D KILL^VAFHUTL2(DFN,VAFHBEF)
;Registration process was aborted and changes were made
;to key demographic data. Create an HL7 V2.3 entry in
;the ADT/HL PIVOT file so that demographic changes will be
;broadcast. VAFCFLDS is set in routine VAFCDD01. It contains the
;fields that were edited.
I $D(VAFCFLDS) D
. N PIVOTNUM,IEN,PTR
. S PTR=DFN_";DPT("
. S PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,DT,4,PTR)
. Q:PIVOTNUM'>0
. S IEN=$O(^VAT(391.71,"D",PIVOTNUM,""))
. Q:IEN'>0
. S VAFCFLDS=$$PROCESS^VAFCDD01()
. I VAFCFLDS'=-1 D
. . D REGEDIT^VAFCDD01(IEN,VAFCFLDS)
. . D TRANSMIT^VAFCDD01(IEN)
K VAFCFLDS
Q
;
SECA08(DFN) ;PUT ENTRY IN PIVOT FILE WHEN USER FLAGS A PT AS SENSITIVE IN
;FILE 38.1 THIS IS TRIGGERED OUT OF ROUTINE DGSEC1
N PIVOTNUM,IEN,PTR
S PTR=DFN_";DPT("
S PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,DT,4,PTR)
Q:PIVOTNUM'>0
S IEN=$O(^VAT(391.71,"D",PIVOTNUM,""))
Q:IEN'>0
;SET EVENT CODE FIELD TO 97 INDICATING A SENSITIVITY UPDATE
S DIE="391.71",DA=IEN
S DR=".1///^S X=97"
D ^DIE
K DIE,DA,DR
D TRANSMIT^VAFCDD01(IEN)
Q
;
XMITFLAG(PIVOTPTR,PIVOTNUM,TURNOFF) ;Turn transmission flag for entry
; in ADT/HL7 PIVOT file on/off
;
;Input : PIVOTPTR - Pointer to entry in ADT/HL7 PIVOT file (#391.71)
; - Use this parameter if the entry number is known
; - Not required if using PIVOTNUM parameter
; - Use of this parameter takes precedence over use
; the PIVOTNUM parameter
; PIVOTNUM - PIVOT NUMBER value (field #.02) for entry
; in ADT/HL7 PIVOT file (#391.71)
; - Use this parameter if the pivot number is known
; - Not required if using PIVOTPTR parameter
; TURNOFF - Denotes if REQUIRES TRANSMISSION field (#.08) should
; be turned on (set to 'YES') or off (set to 'NO')
; 1 = Turns transmission off
; 0 = Turns transmission on (default)
;Output : None
;
;Check input
S PIVOTPTR=+$G(PIVOTPTR)
S PIVOTNUM=+$G(PIVOTNUM)
Q:(('PIVOTPTR)&('PIVOTNUM))
S TURNOFF=+$G(TURNOFF)
;Declare variables
N VALUE,NODE,XREFNUM,DA,X
;Passed pointer - validate
I (PIVOTPTR) Q:('$D(^VAT(391.71,PIVOTPTR,0)))
;Passed pivot number - convert to pointer
I ('PIVOTPTR) S PIVOTPTR=+$O(^VAT(391.71,"D",PIVOTNUM,0)) Q:('PIVOTPTR)
;Set FileMan variables
S DA=PIVOTPTR
S X='TURNOFF
;If already transmitted, empty field(s) edited, can't do 8th piece ""
;I $G(VAFCF),'$P($G(^VAT(391.71,DA,0)),U,8),$G(^VAT(391.71,DA,2)) S $P(^VAT(391.71,DA,2),U)=""
;Hard set field
S $P(^VAT(391.71,DA,0),"^",8)=X
;Hard set fields edited
S:$G(VAFCF)&($P($G(^VAT(391.71,DA,2)),U)'[$G(VAFCF)) $P(^VAT(391.71,DA,2),U)=$P($G(^VAT(391.71,DA,2)),U)_$G(VAFCF)
;Execute cross references
S XREFNUM=0
F S XREFNUM=+$O(^DD(391.71,.08,1,XREFNUM)) Q:('XREFNUM) D
.;Execute kill logic
.S NODE=$G(^DD(391.71,.08,1,XREFNUM,2))
.I (NODE'="") X NODE
.;Execute set logic
.S NODE=$G(^DD(391.71,.08,1,XREFNUM,1))
.I (NODE'="") X NODE
Q
;
SETTFLAG(PIVOTPTR,PIVOTNUM,TURNOFF) ;Turn transmission flag for entry
; in ADT/HL7 PIVOT file on/off
;
;Input : PIVOTPTR - Pointer to entry in ADT/HL7 PIVOT file (#391.71)
; - Use this parameter if the entry number is known
; - Not required if using PIVOTNUM parameter
; - Use of this parameter takes precedence over use
; the PIVOTNUM parameter
; PIVOTNUM - PIVOT NUMBER value (field #.02) for entry
; in ADT/HL7 PIVOT file (#391.71)
; - Use this parameter if the pivot number is known
; - Not required if using PIVOTPTR parameter
; TURNOFF - Denotes if TRANSMITTED field (#.06) should
; be turned on (set to 'YES') or off (set to 'NO')
; 1 = Turns transmission off
; 0 = Turns transmission on (default)
;Output : None
;
;Check input
S PIVOTPTR=+$G(PIVOTPTR)
S PIVOTNUM=+$G(PIVOTNUM)
Q:(('PIVOTPTR)&('PIVOTNUM))
S TURNOFF=+$G(TURNOFF)
;Declare variables
N VALUE,NODE,XREFNUM,DA,X
;Passed pointer - validate
I (PIVOTPTR) Q:('$D(^VAT(391.71,PIVOTPTR,0)))
;Passed pivot number - convert to pointer
I ('PIVOTPTR) S PIVOTPTR=+$O(^VAT(391.71,"D",PIVOTNUM,0)) Q:('PIVOTPTR)
;Set FileMan variables
S DA=PIVOTPTR
S X='TURNOFF
;Hard set field
S $P(^VAT(391.71,DA,0),"^",6)=X
;Execute cross references
S XREFNUM=0
F S XREFNUM=+$O(^DD(391.71,.06,1,XREFNUM)) Q:('XREFNUM) D
.;Execute kill logic
.S NODE=$G(^DD(391.71,.06,1,XREFNUM,2))
.I (NODE'="") X NODE
.;Execute set logic
.S NODE=$G(^DD(391.71,.06,1,XREFNUM,1))
.I (NODE'="") X NODE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAFCDD01 9616 printed Oct 16, 2024@19:02:08 Page 2
VAFCDD01 ;ALB/JRP,LTL-DATA DICTIONARY UTILITIES ;05-SEP-1996
+1 ;;5.3;Registration;**91,149**;Jun 06, 1996
AVAFC(DFN) ;AVAFC* cross reference for PATIENT file (#2)
+1 ;
+2 ;Input : IFN - Pointer to entry in PATIENT file (#2)
+3 ;Output : None
+4 ; VAFCFLG will be set to 1 if the cross reference is
+5 ; not executed because the change is being made from
+6 ; within the Registration process. This notifies
+7 ; Registration that a change was made and that this
+8 ; cross reference should be executed if the Registration
+9 ; process is aborted.
+10 ;
+11 ;Notes : The AVAFC* cross references are used to remember that
+12 ; changes were made to the PATIENT file (#2) outside of
+13 ; the Registration process. Execution of this cross
+14 ; reference will create an entry in the ADT/HL7 PIVOT
+15 ; file (#391.71) and mark it as requiring transmission
+16 ; of an HL7 ADT-A08 message.
+17 ;
+18 ; : Execution of this cross reference can be prevented by
+19 ; setting the local variables: VAFCA08 equal to 1
+20 ; VAFHCA08 equal to 1
+21 ;
+22 ; : If only one of the CA08 variables is set to 1 an entry
+23 ; will be made in the pivot file (#391.71) but the
+24 ; corresponding transmission flag will not be set. In this
+25 ; case setting VAFCA08=1 will prevent the REQUIRES TRANSMISSION
+26 ; flag from being set and setting VAFHCA08=1 will prevent the
+27 ; TRANSMITTED-REQUIRES TRANSMISSION flag from being set.
+28 ; This allows control for sending HL7 and/or HL7v2.3
+29 ;
+30 ;Check input
+31 IF +$GET(DFN)
IF $DATA(^DPT(DFN,0))
+32 IF '$TEST
QUIT
+33 ;quit if re-indexing
+34 if $DATA(DIU(0))
QUIT
+35 ;
+36 ;Declare variables
NEW VARPTR,PIVOTNUM
+37 ;
+38 ; do HL7 V2.3 MESSAGING
Begin DoDot:1
+39 ;CHECK TURNOFF FLAG
+40 if $DATA(VAFCA08)
QUIT
+41 ;IF SEND HL7 V2.3 MESSAGES IN MAS PARAMETER FILE IS SET
+42 ;TO SEND/SUSPEND THEN DO IT, ELSE QUIT
+43 IF '$PIECE($$SEND^VAFHUTL(),"^",2)
QUIT
+44 ;IF in Registration option, save fields edited
+45 IF $$REG()
Begin DoDot:2
+46 if $GET(VAFCF)=""
QUIT
+47 SET VAFCFLDS(VAFCF)=""
End DoDot:2
QUIT
+48 ;IF NOT IN REGISTRATION DO THIS
+49 DO PVT4A08(DFN)
+50 IF PIVOTNUM<0
QUIT
+51 ; set need to transmit flag
+52 DO XMITFLAG(0,PIVOTNUM)
End DoDot:1
KILL VAFCF
+53 ;
+54 ; do HL7 V2.2 MESSAGING
Begin DoDot:1
+55 if $GET(VAFHCA08)
QUIT
+56 if $GET(VAFCFLG)
QUIT
+57 IF $$EN^VAFHREG()
SET VAFCFLG=1
QUIT
+58 IF '$$SEND^VAFHUTL()
QUIT
+59 ; its already been called and failed quit
IF +$GET(PIVOTNUM)<0
QUIT
+60 ; set ac xref and pivot
IF '$GET(PIVOTNUM)
DO PVT4A08(DFN)
+61 IF PIVOTNUM<0
QUIT
+62 ; set requires transmission-Yes flag
+63 DO SETTFLAG(0,PIVOTNUM)
+64 ;done
End DoDot:1
+65 QUIT
+66 ;
PVT4A08(DFN) ;Create entry in ADT/HL7 PIVOT file for an ADT-A08 event
+1 ; and mark it for transmission
+2 ;
+3 ;Input : IFN - Pointer to entry in PATIENT file (#2)
+4 ;Output : None
+5 ;Notes : There are no checks to determine if the entry should be
+6 ; created (other than input of a valid DFN)
+7 ;
+8 ;Check input
+9 IF +$GET(DFN)
IF $DATA(^DPT(DFN,0))
+10 IF '$TEST
QUIT
+11 ;Declare variables don't new for call from top
+12 ;N VARPTR,PIVOTNUM
+13 ;Set variable pointer used by ADT/HL7 PIVOT file
+14 SET VARPTR=DFN_";DPT("
+15 ;Create entry
+16 SET PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,$PIECE(DT,"."),4,VARPTR)
+17 if (PIVOTNUM<0)
QUIT
+18 ;Mark entry as requires transmission
+19 IF $PIECE($$SEND^VAFHUTL(),"^",2)
DO XMITFLAG(0,PIVOTNUM)
+20 ;Mark entry as transmitted field YES
+21 IF $GET(VAFCFLG)
IF $$SEND^VAFHUTL()
DO SETTFLAG(0,PIVOTNUM)
+22 ;Done
+23 QUIT
+24 ;
PROCESS() ;
+1 ;This call simply processes the array elements in the VAFCFLDS
+2 ;variable into a string
+3 if '$DATA(VAFCFLDS)
QUIT -1
+4 NEW INDEX,RETURN
SET INDEX=""
SET RETURN=""
+5 FOR
SET INDEX=$ORDER(VAFCFLDS(INDEX))
if INDEX=""
QUIT
Begin DoDot:1
+6 SET RETURN=RETURN_INDEX
End DoDot:1
+7 if $GET(RETURN)=""
QUIT -1
+8 QUIT RETURN
+9 ;
REGEDIT(PIVOTNUM,FIELDS) ;
+1 ;This call is used to generate an HL7 VERSION 2.3 A04 or A08 message
+2 ;from the pivot file the A04 is generated from DGREG00 when a
+3 ;Registration is known to have been completed. The A08 message
+4 ;is generated from DGREG0 when the Registration option was used
+5 ;to edit some fields, but the Registration was never completed.
+6 ;FIELDS variable contains the fields edited during the session.
+7 SET DIE="391.71"
SET DA=PIVOTNUM
+8 SET DR="2.1///^S X=FIELDS"
+9 DO ^DIE
+10 KILL DIE,DA,DR
+11 QUIT
TRANSMIT(PIVOTNUM) ;
+1 ;This call is used to simply set the 'Requires Transmission'
+2 ;flag in the pivot file
+3 SET DIE="391.71"
SET DA=PIVOTNUM
+4 SET DR=".08///^S X=1"
+5 DO ^DIE
+6 KILL DIE,DA,DR
+7 QUIT
+8 ;
MESSAGE(PIVOTPTR,NUMBER) ;
+1 ;This tag stuffs the message id from hl7 into pivot file
+2 SET DIE="391.71"
SET DA=PIVOTPTR
+3 SET DR="1.1///^S X=NUMBER"
+4 DO ^DIE
+5 KILL DIE,DA,DR
+6 QUIT
+7 ;
REG() ;
+1 ;this tag looks at what option the user is in at the time
+2 ;
+3 IF $PIECE($GET(XQY0),"^")="DG REGISTER PATIENT"
QUIT 1
+4 IF $PIECE($GET(XQY0),"^")="DGRPT 10-10T REGISTRATION"
QUIT 1
+5 QUIT 0
+6 ;
HL7A08 ;
+1 IF $DATA(VAFHMRG)
DO KILL^VAFHUTL2(DFN,VAFHBEF)
+2 ;Registration process was aborted and changes were made
+3 ;to key demographic data. Create an HL7 V2.3 entry in
+4 ;the ADT/HL PIVOT file so that demographic changes will be
+5 ;broadcast. VAFCFLDS is set in routine VAFCDD01. It contains the
+6 ;fields that were edited.
+7 IF $DATA(VAFCFLDS)
Begin DoDot:1
+8 NEW PIVOTNUM,IEN,PTR
+9 SET PTR=DFN_";DPT("
+10 SET PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,DT,4,PTR)
+11 if PIVOTNUM'>0
QUIT
+12 SET IEN=$ORDER(^VAT(391.71,"D",PIVOTNUM,""))
+13 if IEN'>0
QUIT
+14 SET VAFCFLDS=$$PROCESS^VAFCDD01()
+15 IF VAFCFLDS'=-1
Begin DoDot:2
+16 DO REGEDIT^VAFCDD01(IEN,VAFCFLDS)
+17 DO TRANSMIT^VAFCDD01(IEN)
End DoDot:2
End DoDot:1
+18 KILL VAFCFLDS
+19 QUIT
+20 ;
SECA08(DFN) ;PUT ENTRY IN PIVOT FILE WHEN USER FLAGS A PT AS SENSITIVE IN
+1 ;FILE 38.1 THIS IS TRIGGERED OUT OF ROUTINE DGSEC1
+2 NEW PIVOTNUM,IEN,PTR
+3 SET PTR=DFN_";DPT("
+4 SET PIVOTNUM=+$$PIVNW^VAFHPIVT(DFN,DT,4,PTR)
+5 if PIVOTNUM'>0
QUIT
+6 SET IEN=$ORDER(^VAT(391.71,"D",PIVOTNUM,""))
+7 if IEN'>0
QUIT
+8 ;SET EVENT CODE FIELD TO 97 INDICATING A SENSITIVITY UPDATE
+9 SET DIE="391.71"
SET DA=IEN
+10 SET DR=".1///^S X=97"
+11 DO ^DIE
+12 KILL DIE,DA,DR
+13 DO TRANSMIT^VAFCDD01(IEN)
+14 QUIT
+15 ;
XMITFLAG(PIVOTPTR,PIVOTNUM,TURNOFF) ;Turn transmission flag for entry
+1 ; in ADT/HL7 PIVOT file on/off
+2 ;
+3 ;Input : PIVOTPTR - Pointer to entry in ADT/HL7 PIVOT file (#391.71)
+4 ; - Use this parameter if the entry number is known
+5 ; - Not required if using PIVOTNUM parameter
+6 ; - Use of this parameter takes precedence over use
+7 ; the PIVOTNUM parameter
+8 ; PIVOTNUM - PIVOT NUMBER value (field #.02) for entry
+9 ; in ADT/HL7 PIVOT file (#391.71)
+10 ; - Use this parameter if the pivot number is known
+11 ; - Not required if using PIVOTPTR parameter
+12 ; TURNOFF - Denotes if REQUIRES TRANSMISSION field (#.08) should
+13 ; be turned on (set to 'YES') or off (set to 'NO')
+14 ; 1 = Turns transmission off
+15 ; 0 = Turns transmission on (default)
+16 ;Output : None
+17 ;
+18 ;Check input
+19 SET PIVOTPTR=+$GET(PIVOTPTR)
+20 SET PIVOTNUM=+$GET(PIVOTNUM)
+21 if (('PIVOTPTR)&('PIVOTNUM))
QUIT
+22 SET TURNOFF=+$GET(TURNOFF)
+23 ;Declare variables
+24 NEW VALUE,NODE,XREFNUM,DA,X
+25 ;Passed pointer - validate
+26 IF (PIVOTPTR)
if ('$DATA(^VAT(391.71,PIVOTPTR,0)))
QUIT
+27 ;Passed pivot number - convert to pointer
+28 IF ('PIVOTPTR)
SET PIVOTPTR=+$ORDER(^VAT(391.71,"D",PIVOTNUM,0))
if ('PIVOTPTR)
QUIT
+29 ;Set FileMan variables
+30 SET DA=PIVOTPTR
+31 SET X='TURNOFF
+32 ;If already transmitted, empty field(s) edited, can't do 8th piece ""
+33 ;I $G(VAFCF),'$P($G(^VAT(391.71,DA,0)),U,8),$G(^VAT(391.71,DA,2)) S $P(^VAT(391.71,DA,2),U)=""
+34 ;Hard set field
+35 SET $PIECE(^VAT(391.71,DA,0),"^",8)=X
+36 ;Hard set fields edited
+37 if $GET(VAFCF)&($PIECE($GET(^VAT(391.71,DA,2)),U)'[$GET(VAFCF))
SET $PIECE(^VAT(391.71,DA,2),U)=$PIECE($GET(^VAT(391.71,DA,2)),U)_$GET(VAFCF)
+38 ;Execute cross references
+39 SET XREFNUM=0
+40 FOR
SET XREFNUM=+$ORDER(^DD(391.71,.08,1,XREFNUM))
if ('XREFNUM)
QUIT
Begin DoDot:1
+41 ;Execute kill logic
+42 SET NODE=$GET(^DD(391.71,.08,1,XREFNUM,2))
+43 IF (NODE'="")
XECUTE NODE
+44 ;Execute set logic
+45 SET NODE=$GET(^DD(391.71,.08,1,XREFNUM,1))
+46 IF (NODE'="")
XECUTE NODE
End DoDot:1
+47 QUIT
+48 ;
SETTFLAG(PIVOTPTR,PIVOTNUM,TURNOFF) ;Turn transmission flag for entry
+1 ; in ADT/HL7 PIVOT file on/off
+2 ;
+3 ;Input : PIVOTPTR - Pointer to entry in ADT/HL7 PIVOT file (#391.71)
+4 ; - Use this parameter if the entry number is known
+5 ; - Not required if using PIVOTNUM parameter
+6 ; - Use of this parameter takes precedence over use
+7 ; the PIVOTNUM parameter
+8 ; PIVOTNUM - PIVOT NUMBER value (field #.02) for entry
+9 ; in ADT/HL7 PIVOT file (#391.71)
+10 ; - Use this parameter if the pivot number is known
+11 ; - Not required if using PIVOTPTR parameter
+12 ; TURNOFF - Denotes if TRANSMITTED field (#.06) should
+13 ; be turned on (set to 'YES') or off (set to 'NO')
+14 ; 1 = Turns transmission off
+15 ; 0 = Turns transmission on (default)
+16 ;Output : None
+17 ;
+18 ;Check input
+19 SET PIVOTPTR=+$GET(PIVOTPTR)
+20 SET PIVOTNUM=+$GET(PIVOTNUM)
+21 if (('PIVOTPTR)&('PIVOTNUM))
QUIT
+22 SET TURNOFF=+$GET(TURNOFF)
+23 ;Declare variables
+24 NEW VALUE,NODE,XREFNUM,DA,X
+25 ;Passed pointer - validate
+26 IF (PIVOTPTR)
if ('$DATA(^VAT(391.71,PIVOTPTR,0)))
QUIT
+27 ;Passed pivot number - convert to pointer
+28 IF ('PIVOTPTR)
SET PIVOTPTR=+$ORDER(^VAT(391.71,"D",PIVOTNUM,0))
if ('PIVOTPTR)
QUIT
+29 ;Set FileMan variables
+30 SET DA=PIVOTPTR
+31 SET X='TURNOFF
+32 ;Hard set field
+33 SET $PIECE(^VAT(391.71,DA,0),"^",6)=X
+34 ;Execute cross references
+35 SET XREFNUM=0
+36 FOR
SET XREFNUM=+$ORDER(^DD(391.71,.06,1,XREFNUM))
if ('XREFNUM)
QUIT
Begin DoDot:1
+37 ;Execute kill logic
+38 SET NODE=$GET(^DD(391.71,.06,1,XREFNUM,2))
+39 IF (NODE'="")
XECUTE NODE
+40 ;Execute set logic
+41 SET NODE=$GET(^DD(391.71,.06,1,XREFNUM,1))
+42 IF (NODE'="")
XECUTE NODE
End DoDot:1
+43 QUIT