ORWGN ;;SLC/JDL/DRP - Group Notes ;09/10/12 19:25
;;3.0;ORDER ENTRY/RESULTS REPORTING;**222,353**;;Build 8
;;Per VHA Directive 2004-038, this routine should not be modified.
;;Uses supported ICR 5679
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
; Begin OR*3.0*353 changes
IDTVALID(IDATE,CSYS) ; Returns Implementation date of the ICD code set
;CSYS = System abbreviation for the coding system
K IDATE
I $G(CSYS)="" S IDATE="-1^CODING SYSTEM PARAMETER MISSING" Q
S IDATE=$$IMPDATE^LEXU(CSYS)
Q
;
MAXFRQ(ORY,ORTRM) ;Checks if frequency of search term is greater than
; max ICD-10 setting
; Input Value: ORTRM = Search term to look up
;
; Return Value: 2 pieces (first piece is 0 or 1, second piece is
; occurrance frequency of search term)
; First piece:
; 0 - Search term frequency is less than
; maximum return
; 1 - Search term frequency is greater
; than maximum return
N ORMAX,ORFRQ
S ORY=0
I ORTRM="" Q ;if search term not sent in, then quit
S ORMAX=+$$MAX^LEXU("10D")
I ORMAX=0 S ORMAX=20000 ;if Max value not set, default to 20,000
S ORFRQ=+$$FREQ^LEXU(ORTRM)
I ORFRQ'>ORMAX Q ;if frequency not greater than Max value
S ORY="1^"_ORFRQ
Q
; End OR*3.0*353 changes
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWGN 2065 printed Nov 22, 2024@17:46:26 Page 2
ORWGN ;;SLC/JDL/DRP - Group Notes ;09/10/12 19:25
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**222,353**;;Build 8
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;;Uses supported ICR 5679
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
+16 ; Begin OR*3.0*353 changes
IDTVALID(IDATE,CSYS) ; Returns Implementation date of the ICD code set
+1 ;CSYS = System abbreviation for the coding system
+2 KILL IDATE
+3 IF $GET(CSYS)=""
SET IDATE="-1^CODING SYSTEM PARAMETER MISSING"
QUIT
+4 SET IDATE=$$IMPDATE^LEXU(CSYS)
+5 QUIT
+6 ;
MAXFRQ(ORY,ORTRM) ;Checks if frequency of search term is greater than
+1 ; max ICD-10 setting
+2 ; Input Value: ORTRM = Search term to look up
+3 ;
+4 ; Return Value: 2 pieces (first piece is 0 or 1, second piece is
+5 ; occurrance frequency of search term)
+6 ; First piece:
+7 ; 0 - Search term frequency is less than
+8 ; maximum return
+9 ; 1 - Search term frequency is greater
+10 ; than maximum return
+11 NEW ORMAX,ORFRQ
+12 SET ORY=0
+13 ;if search term not sent in, then quit
IF ORTRM=""
QUIT
+14 SET ORMAX=+$$MAX^LEXU("10D")
+15 ;if Max value not set, default to 20,000
IF ORMAX=0
SET ORMAX=20000
+16 SET ORFRQ=+$$FREQ^LEXU(ORTRM)
+17 ;if frequency not greater than Max value
IF ORFRQ'>ORMAX
QUIT
+18 SET ORY="1^"_ORFRQ
+19 QUIT
+20 ; End OR*3.0*353 changes