ORWGN ;;SLC/JDL- Group Notes
;;3.0;ORDER ENTRY/RESULTS REPORTING;**222**
AUTHUSR(ORY) ;Does user has permission to access GN?
S ORY=0
I $D(^XUSEC("OR GN ACCESS",DUZ)) S ORY=1
Q
;
GNLOC(ORY,ORFROM,DIR) ;Is valid GN location? 1: true 0: false
; .ORY=returned list, ORFROM=text to $O from, DIR=$O direction.
N IX,ORLST,CHKVAL,ORERR,ORX
K ^TMP("ORGN",$J)
S (ORLST,ORERR)="",CHKVAL=0
D GETLST^XPAR(.ORLST,"ALL","OR GN LOCATIONS","N",.ORERR)
I ORERR S ORY=ORERR Q
Q:$D(ORLST)=1
S IX=0 F S IX=$O(ORLST(IX)) Q:'IX D
. S CHKVAL=ORLST(IX)
. S:($$ACTLOC^ORWU(+CHKVAL)) ^TMP("ORGN",$J,$P(CHKVAL,U,2))=ORLST(IX)
N I,CNT S I=0,CNT=44,ORY=""
Q:$D(^TMP("ORGN",$J))<10
F Q:I'<CNT S ORFROM=$O(^TMP("ORGN",$J,ORFROM),DIR) Q:ORFROM="" D
. S I=I+1,ORY(I)=^TMP("ORGN",$J,ORFROM)
Q
ORWGN ;;SLC/JDL- Group Notes
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**222**
AUTHUSR(ORY) ;Does user has permission to access GN?
+1 SET ORY=0
+2 IF $DATA(^XUSEC("OR GN ACCESS",DUZ))
SET ORY=1
+3 QUIT
+4 ;
GNLOC(ORY,ORFROM,DIR) ;Is valid GN location? 1: true 0: false
+1 ; .ORY=returned list, ORFROM=text to $O from, DIR=$O direction.
+2 NEW IX,ORLST,CHKVAL,ORERR,ORX
+3 KILL ^TMP("ORGN",$JOB)
+4 SET (ORLST,ORERR)=""
SET CHKVAL=0
+5 DO GETLST^XPAR(.ORLST,"ALL","OR GN LOCATIONS","N",.ORERR)
+6 IF ORERR
SET ORY=ORERR
QUIT
+7 IF $DATA(ORLST)=1
QUIT
+8 SET IX=0
FOR
SET IX=$ORDER(ORLST(IX))
IF 'IX
QUIT
Begin DoDot:1
+9 SET CHKVAL=ORLST(IX)
+10 IF ($$ACTLOC^ORWU(+CHKVAL))
SET ^TMP("ORGN",$JOB,$PIECE(CHKVAL,U,2))=ORLST(IX)
End DoDot:1
+11 NEW I,CNT
SET I=0
SET CNT=44
SET ORY=""
+12 IF $DATA(^TMP("ORGN",$JOB))<10
QUIT
+13 FOR
IF I'<CNT
QUIT
SET ORFROM=$ORDER(^TMP("ORGN",$JOB,ORFROM),DIR)
IF ORFROM=""
QUIT
Begin DoDot:1
+14 SET I=I+1
SET ORY(I)=^TMP("ORGN",$JOB,ORFROM)
End DoDot:1
+15 QUIT