SCMCHLR5 ;ALB/KCL - PCMM HL7 Reject Processing - Protocols con't ; 10-JAN-2000
;;5.3;Scheduling;**210,272**;AUG 13, 1993
;
;This routine contains the PCMM Transmission Error processing protocols.
;See EN^SCMCHLR2 for additional documentation on 'system wide' variables
;used in this routine.
;
UE ; Description: Entry point for SCMC LE UNCHECK ERROR protocol.
;
; Input: None
;
; Output:
; VALMBCK - 'R'=Refresh screen
;
N NODE,SCLINE,SCNUM,SCTLIEN,SCERIEN,VALMY
;
;Ask user to select transmission errors to uncheck on the list
D EN^VALM2(XQORNOD(0))
D FULL^VALM1
;
;Process user selection
S SCNUM=0
F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
.;invoke call to mark error as new on list
.I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
..D UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
;
;
;Place custom msg in msg window
;S VALMSG=$$MRKMSG^SCMCHLR1
;
;Refresh screen when returning from action
S VALMBCK="R"
Q
;
;
DP ; Description: Entry point for SCMC LE DESELECT PATIENT RETRANSMIT protocol.
;
; Input: None
;
; Output:
; VALMBCK - 'R'=Refresh screen
;
N NODE,SCLINE,SCNUM,SCTLIEN,SCTLOG,VALMY
;
;Ask user to select transmission errors to deselect
D EN^VALM2(XQORNOD(0))
;
;set screen to full scrolling region
D FULL^VALM1
;
;Process user selections
S SCNUM=0
F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
.;
.I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
..;get information for PCMM HL7 Transmission Log entry and invoke code
..;to set patient to 'retransmit'.
..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D DESLPAT(SCARY,SCLINE,.SCTLOG)
;
;Place custom msg in msg window
;S VALMSG=$$MRKMSG^SCMCHLR1
;
;Refresh screen when returning from action
S VALMBCK="R"
Q
;
;
DA ; Description: Entry point for SCMC LE DESELECT ALL protocol.
;
; Input: None
;
; Output:
; VALMBCK - 'R'=Refresh screen
;
N DIR,DTOUT,DUOUT,Y
;
;Set screen to full scrolling region
D FULL^VALM1
;
;Ask user if they want to deselect all patients for retransmit
S DIR(0)="Y"
S DIR("A")="Deselect all patients"
S DIR("A",1)="This action will allow all patients that are currently"
S DIR("A",2)="marked for re-transmission to be deselected."
S DIR("B")="NO"
D ^DIR
;
;Process user response
I '$D(DIRUT) D
.I +Y D
..;set all patients status to rejected
..D UPDALL
;
;Place custom msg in msg window
;S VALMSG=$$MRKMSG^SCMCHLR1
;
;Refresh screen when returning from action
S VALMBCK="R"
Q
;
;
UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN) ;
; Description: Used to uncheck an error on the list.
;
; Input:
; SCARY - Global array subscript
; SCLINE - Line number
; SCTLIEN - PCMM HL7 Transmission Log IEN
; SCERIEN - IEN of record in Error Code (#404.47142) multiple
;
; Output: None
;
N SCERMSG
;
;if status is marked for retransmit error can not be marked as new
I $$STATUS^SCMCHLA(SCTLIEN)="M" D
.W !,^TMP(SCARY,$J,SCLINE,0)
.W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERMSG)
.W !,"...Unable to update error processing status"
.W !,"...Patient already marked for re-transmission"
.D PAUSE^VALM1
E D
.I $$UPDEPS^SCMCHLA(SCTLIEN,SCERIEN,1,.SCERMSG) D
..D FLDTEXT^VALM10(SCLINE,"STATUS","New")
..D FLDCTRL^VALM10(SCLINE,"STATUS",IOINHI,IOINORM)
Q
;
;
DESLPAT(SCARY,SCLINE,SCTLOG) ; Description: Used to set patient to rejected.
;
; Input:
; SCARY - Global array subscript
; SCLINE - Line number
; SCTLOG - Transmission log entry array
;
; Output: None
;
N SCERROR
;
;Set patient to rejected
I $$UPDSTAT^SCMCHLA(SCTLIEN,"RJ",.SCERROR) D
.D UPDPAT(SCARY,$S($G(SCTLOG("DFN")):SCTLOG("DFN"),1:"W"),$S('$G(SCTLOG("DFN")):SCLINE,1:""))
E D
.W !,^TMP(SCARY,$J,SCLINE,0)
.W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERROR)
.W !,"...Unable to deselect patient for re-transmit"
.D PAUSE^VALM1
Q
;
;
UPDPAT(SCARY,SCDFN,LINE) ; Description: Update all PCMM HL7 Transmssion Log
; entries in the list for the patient as 'rejected'.
;
; Input:
; SCARY - Global array subscript
; SCDFN - Patient IEN
;
; Output: None
;
S:'$G(LINE) LINE=999999
N SCLINE,SCTLIEN
;
;Loop thru entries in the list for the patient
S SCLINE=0
I SCDFN="W",LINE'=999999 S SCLINE=LINE-.01
F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:(('SCLINE)!(SCLINE>LINE)) S SCTLIEN=+^(SCLINE) D
.;update entry that was marked for re-transmit to null
.D FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
Q
;
;
UPDALL ; Description: Update all PCMM HL7 Transmssion Log
; entries in the list as 'marked for re-transmit'.
;
; Input: None
; Output: None
;
N SCLINE,SCTLIEN,SCDFN
;
;Loop thru entries in the list for all patients
S SCDFN=""
F S SCDFN=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN)) Q:'SCDFN D
.;Loop thru entries in the list for the patient
.S SCLINE=0
.F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:'SCLINE D
..S NODE=^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)
..S SCTLIEN=+NODE,SCERIEN=+$P(NODE,"^",2)
..;
..;get information for PCMM HL7 Transmission Log entry and invoke code
..;to set patient to 'rejected'.
..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D DESLPAT(SCARY,SCLINE,.SCTLOG)
..;
..;update entry that was marked for re-transmit to null
..D FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCMCHLR5 5602 printed Dec 13, 2024@02:40:37 Page 2
SCMCHLR5 ;ALB/KCL - PCMM HL7 Reject Processing - Protocols con't ; 10-JAN-2000
+1 ;;5.3;Scheduling;**210,272**;AUG 13, 1993
+2 ;
+3 ;This routine contains the PCMM Transmission Error processing protocols.
+4 ;See EN^SCMCHLR2 for additional documentation on 'system wide' variables
+5 ;used in this routine.
+6 ;
UE ; Description: Entry point for SCMC LE UNCHECK ERROR protocol.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; VALMBCK - 'R'=Refresh screen
+6 ;
+7 NEW NODE,SCLINE,SCNUM,SCTLIEN,SCERIEN,VALMY
+8 ;
+9 ;Ask user to select transmission errors to uncheck on the list
+10 DO EN^VALM2(XQORNOD(0))
+11 DO FULL^VALM1
+12 ;
+13 ;Process user selection
+14 SET SCNUM=0
+15 FOR
SET SCNUM=$ORDER(VALMY(SCNUM))
if 'SCNUM
QUIT
Begin DoDot:1
+16 ;invoke call to mark error as new on list
+17 IF $DATA(^TMP(SCARY_"IDX",$JOB,SCNUM))
Begin DoDot:2
+18 SET NODE=$GET(^TMP(SCARY_"IDX",$JOB,SCNUM))
+19 SET SCLINE=+NODE
SET SCTLIEN=+$PIECE(NODE,"^",2)
SET SCERIEN=+$PIECE(NODE,"^",3)
+20 DO UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
End DoDot:2
End DoDot:1
+21 ;
+22 ;
+23 ;Place custom msg in msg window
+24 ;S VALMSG=$$MRKMSG^SCMCHLR1
+25 ;
+26 ;Refresh screen when returning from action
+27 SET VALMBCK="R"
+28 QUIT
+29 ;
+30 ;
DP ; Description: Entry point for SCMC LE DESELECT PATIENT RETRANSMIT protocol.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; VALMBCK - 'R'=Refresh screen
+6 ;
+7 NEW NODE,SCLINE,SCNUM,SCTLIEN,SCTLOG,VALMY
+8 ;
+9 ;Ask user to select transmission errors to deselect
+10 DO EN^VALM2(XQORNOD(0))
+11 ;
+12 ;set screen to full scrolling region
+13 DO FULL^VALM1
+14 ;
+15 ;Process user selections
+16 SET SCNUM=0
+17 FOR
SET SCNUM=$ORDER(VALMY(SCNUM))
if 'SCNUM
QUIT
Begin DoDot:1
+18 ;
+19 IF $DATA(^TMP(SCARY_"IDX",$JOB,SCNUM))
Begin DoDot:2
+20 SET NODE=$GET(^TMP(SCARY_"IDX",$JOB,SCNUM))
+21 SET SCLINE=+NODE
SET SCTLIEN=+$PIECE(NODE,"^",2)
SET SCERIEN=+$PIECE(NODE,"^",3)
+22 ;get information for PCMM HL7 Transmission Log entry and invoke code
+23 ;to set patient to 'retransmit'.
+24 IF $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG)
DO DESLPAT(SCARY,SCLINE,.SCTLOG)
End DoDot:2
End DoDot:1
+25 ;
+26 ;Place custom msg in msg window
+27 ;S VALMSG=$$MRKMSG^SCMCHLR1
+28 ;
+29 ;Refresh screen when returning from action
+30 SET VALMBCK="R"
+31 QUIT
+32 ;
+33 ;
DA ; Description: Entry point for SCMC LE DESELECT ALL protocol.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; VALMBCK - 'R'=Refresh screen
+6 ;
+7 NEW DIR,DTOUT,DUOUT,Y
+8 ;
+9 ;Set screen to full scrolling region
+10 DO FULL^VALM1
+11 ;
+12 ;Ask user if they want to deselect all patients for retransmit
+13 SET DIR(0)="Y"
+14 SET DIR("A")="Deselect all patients"
+15 SET DIR("A",1)="This action will allow all patients that are currently"
+16 SET DIR("A",2)="marked for re-transmission to be deselected."
+17 SET DIR("B")="NO"
+18 DO ^DIR
+19 ;
+20 ;Process user response
+21 IF '$DATA(DIRUT)
Begin DoDot:1
+22 IF +Y
Begin DoDot:2
+23 ;set all patients status to rejected
+24 DO UPDALL
End DoDot:2
End DoDot:1
+25 ;
+26 ;Place custom msg in msg window
+27 ;S VALMSG=$$MRKMSG^SCMCHLR1
+28 ;
+29 ;Refresh screen when returning from action
+30 SET VALMBCK="R"
+31 QUIT
+32 ;
+33 ;
UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN) ;
+1 ; Description: Used to uncheck an error on the list.
+2 ;
+3 ; Input:
+4 ; SCARY - Global array subscript
+5 ; SCLINE - Line number
+6 ; SCTLIEN - PCMM HL7 Transmission Log IEN
+7 ; SCERIEN - IEN of record in Error Code (#404.47142) multiple
+8 ;
+9 ; Output: None
+10 ;
+11 NEW SCERMSG
+12 ;
+13 ;if status is marked for retransmit error can not be marked as new
+14 IF $$STATUS^SCMCHLA(SCTLIEN)="M"
Begin DoDot:1
+15 WRITE !,^TMP(SCARY,$JOB,SCLINE,0)
+16 if $GET(SCERMSG)'=""
WRITE !,"...",$$LOWER^VALM1(SCERMSG)
+17 WRITE !,"...Unable to update error processing status"
+18 WRITE !,"...Patient already marked for re-transmission"
+19 DO PAUSE^VALM1
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 IF $$UPDEPS^SCMCHLA(SCTLIEN,SCERIEN,1,.SCERMSG)
Begin DoDot:2
+22 DO FLDTEXT^VALM10(SCLINE,"STATUS","New")
+23 DO FLDCTRL^VALM10(SCLINE,"STATUS",IOINHI,IOINORM)
End DoDot:2
End DoDot:1
+24 QUIT
+25 ;
+26 ;
DESLPAT(SCARY,SCLINE,SCTLOG) ; Description: Used to set patient to rejected.
+1 ;
+2 ; Input:
+3 ; SCARY - Global array subscript
+4 ; SCLINE - Line number
+5 ; SCTLOG - Transmission log entry array
+6 ;
+7 ; Output: None
+8 ;
+9 NEW SCERROR
+10 ;
+11 ;Set patient to rejected
+12 IF $$UPDSTAT^SCMCHLA(SCTLIEN,"RJ",.SCERROR)
Begin DoDot:1
+13 DO UPDPAT(SCARY,$SELECT($GET(SCTLOG("DFN")):SCTLOG("DFN"),1:"W"),$SELECT('$GET(SCTLOG("DFN")):SCLINE,1:""))
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 WRITE !,^TMP(SCARY,$JOB,SCLINE,0)
+16 if $GET(SCERMSG)'=""
WRITE !,"...",$$LOWER^VALM1(SCERROR)
+17 WRITE !,"...Unable to deselect patient for re-transmit"
+18 DO PAUSE^VALM1
End DoDot:1
+19 QUIT
+20 ;
+21 ;
UPDPAT(SCARY,SCDFN,LINE) ; Description: Update all PCMM HL7 Transmssion Log
+1 ; entries in the list for the patient as 'rejected'.
+2 ;
+3 ; Input:
+4 ; SCARY - Global array subscript
+5 ; SCDFN - Patient IEN
+6 ;
+7 ; Output: None
+8 ;
+9 if '$GET(LINE)
SET LINE=999999
+10 NEW SCLINE,SCTLIEN
+11 ;
+12 ;Loop thru entries in the list for the patient
+13 SET SCLINE=0
+14 IF SCDFN="W"
IF LINE'=999999
SET SCLINE=LINE-.01
+15 FOR
SET SCLINE=$ORDER(^TMP(SCARY_"IDX",$JOB,"PT",SCDFN,SCLINE))
if (('SCLINE)!(SCLINE>LINE))
QUIT
SET SCTLIEN=+^(SCLINE)
Begin DoDot:1
+16 ;update entry that was marked for re-transmit to null
+17 DO FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
End DoDot:1
+18 QUIT
+19 ;
+20 ;
UPDALL ; Description: Update all PCMM HL7 Transmssion Log
+1 ; entries in the list as 'marked for re-transmit'.
+2 ;
+3 ; Input: None
+4 ; Output: None
+5 ;
+6 NEW SCLINE,SCTLIEN,SCDFN
+7 ;
+8 ;Loop thru entries in the list for all patients
+9 SET SCDFN=""
+10 FOR
SET SCDFN=$ORDER(^TMP(SCARY_"IDX",$JOB,"PT",SCDFN))
if 'SCDFN
QUIT
Begin DoDot:1
+11 ;Loop thru entries in the list for the patient
+12 SET SCLINE=0
+13 FOR
SET SCLINE=$ORDER(^TMP(SCARY_"IDX",$JOB,"PT",SCDFN,SCLINE))
if 'SCLINE
QUIT
Begin DoDot:2
+14 SET NODE=^TMP(SCARY_"IDX",$JOB,"PT",SCDFN,SCLINE)
+15 SET SCTLIEN=+NODE
SET SCERIEN=+$PIECE(NODE,"^",2)
+16 ;
+17 ;get information for PCMM HL7 Transmission Log entry and invoke code
+18 ;to set patient to 'rejected'.
+19 IF $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG)
DO DESLPAT(SCARY,SCLINE,.SCTLOG)
+20 ;
+21 ;update entry that was marked for re-transmit to null
+22 DO FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
End DoDot:2
End DoDot:1
+23 ;
+24 QUIT