ORWU1 ;SLC/GRE - General Utilities for Windows Calls [2/25/04 11:10am]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**149,187,195,215**;Dec 17, 1997
;
Q
;
NP1 ; Return a set of names from the NEW PERSON file.
; (PKS/8/5/2003: Now called by NEWPERS^ORWU; internal mods made.)
; (Keep GETCOS^ORWTPN up to date with matching logic/code, too.)
;
; PARAMS from NEWPERS^ORWU call:
; .ORY=returned list.
; ORDATE=Checks for an active person class on this date (optional).
; ORDIR=Direction to move through the x-ref with $O.
; ORFROM=Starting name for this set.
; ORKEY=Screen users by security key (optional).
; ORVIZ=If true, includes RDV users; otherwise not (optional).
;
N ORDD,ORDIV,ORDUP,ORGOOD,ORI,ORIEN1,ORIEN2,ORLAST,ORMAX,ORMRK,ORMULTI,ORPREV,ORSRV,ORTTL
;
S ORI=0,ORMAX=44,(ORLAST,ORPREV)="",ORKEY=$G(ORKEY),ORDATE=$G(ORDATE)
S ORMULTI=$$ALL^VASITE ; IA# 10112. Do once at beginning of call.
;
; NP3 tag includes visitors, uses full "B" x-ref.
I +$G(ORVIZ)=1 D NP3(0) Q ; Use alt. version, skip rest.
; User requested ALL users, both active and inactive. Same call, but skip $$PROVIDER^XUSER screen
I +$G(ORALL)=1 D NP3(0) Q
;
F Q:ORI'<ORMAX S ORFROM=$O(^VA(200,"AUSER",ORFROM),ORDIR) Q:ORFROM="" D
.S ORIEN1=""
.F S ORIEN1=$O(^VA(200,"AUSER",ORFROM,ORIEN1),ORDIR) Q:'ORIEN1 D
..;
..I $L(ORKEY),'$D(^XUSEC(ORKEY,+ORIEN1)) Q ; Check for key?
..I ORDATE>0,$$GET^XUA4A72(ORIEN1,ORDATE)<1 Q ; Check date?
..S ORI=ORI+1,ORY(ORI)=ORIEN1_"^"_$$NAMEFMT^XLFNAME(ORFROM,"F","DcMPC")
..S ORDUP=0 ; Init flag, check dupe.
..I ($P(ORPREV_" "," ")=$P(ORFROM_" "," ")) S ORDUP=1
..;
..; Append Title if not duplicated:
..I 'ORDUP D
...S ORIEN2=ORIEN1
...D NP4(0) ; Get Title.
...I ORTTL="" Q
...S ORY(ORI)=ORY(ORI)_U_"- "_ORTTL
..;
..; Get data in case of dupes:
..I ORDUP D
...S ORIEN2=ORLAST ; Prev IEN for NP2 call.
...;
...; Reset, use previous array element, call for extended data:
...S ORI=ORI-1,ORY(ORI)=$P(ORY(ORI),U)_U_$P(ORY(ORI),U,2) D NP2
...;
...; Then return to current user for second extended data call:
...S ORIEN2=ORIEN1,ORI=ORI+1 D NP2
..S ORLAST=ORIEN1,ORPREV=ORFROM ; Reassign vars for next pass.
;
Q
;
NP2 ; Retrieve subset of data for dupes in NP1.
; (Assumes certain vars already set/new'd in calling code.)
;
; Variables used:
; ORZ = Memory array storage variable.
; ORZERR = Error storage for LIST^DIC call.
;
N ORZ,ORZERR ; Initialize variables.
S ORDIV="" ; Reset each time.
D NP4(1) ; Get Title, Service/Section.
;
; For multi-divisional site, get Division if determinable:
I ORMULTI D
.D LIST^DIC(200.02,","_ORIEN2_",","@;.01;1","QP","","","","","","","ORZ","ORZERR")
.S (ORDD,ORGOOD)=0 ; Initialize variables.
.I $P(ORZ("DILIST",0),U)=0 Q ; Division not listed.
.I $P(ORZ("DILIST",0),U)=1 D Q ; Only one, so use it.
..S ORDD=$O(ORZ("DILIST",ORDD)) ; Get the node's entry.
..S ORDIV=$P(ORDD,U,2) ; Get actual name value.
.;
.; More than one Division entry, so:
.F S ORDD=$O(ORZ("DILIST",ORDD)) Q:+ORDD=0!'($L(ORDD)) D Q:ORGOOD
..;
..; See if current entry being processed is "Default" (done if so):
..I $P(ORZ("DILIST",ORDD,0),U,3)["Y" S ORDIV=$P(ORZ("DILIST",ORDD,0),U,2),ORGOOD=1 Q ; Division text.
;
; Append new pieces to array string:
S ORMRK=""
I (ORTTL="")&(ORSRV="")&(ORDIV="") Q ; Nothing to append.
S ORY(ORI)=ORY(ORI)_U_"- " ; At least something exists.
I (ORTTL'="") S ORY(ORI)=ORY(ORI)_ORTTL,ORMRK=", " ; Title.
I (ORSRV'="") S ORY(ORI)=ORY(ORI)_ORMRK_ORSRV,ORMRK=", " ; Service.
I (ORDIV'="") S ORY(ORI)=ORY(ORI)_ORMRK_ORDIV ; Division.
;
Q
;
NP3(COSFLAG) ; Retrieve diff. data when all users are involved, using "B" x-ref.
;
; COSFLAG=If TRUE, called by ORWTPN.
; (Assumes certain vars already set/new'd in calling code.)
;
N ORNODE,COSQUIT
S COSQUIT=0 ; Flag used in section for COSFLAG.
;
F Q:ORI'<ORMAX S ORFROM=$O(^VA(200,"B",ORFROM),ORDIR) Q:ORFROM="" D
.S ORIEN1=""
.F S ORIEN1=$O(^VA(200,"B",ORFROM,ORIEN1),ORDIR) Q:'ORIEN1 D
..;
..; Screen default cosigner if appropriate (ORUSER set in ORWTPN):
..I COSFLAG D
...S COSQUIT=0
...I '$$SCRDFCS^TIULA3(ORUSER,ORIEN1) S COSFLAG=1 Q
...S ORNODE=$P($G(^VA(200,ORIEN1,0)),U)
...I '$L(ORNODE) S COSFLAG=1 Q
..I COSQUIT Q
..;
..I +$G(ORALL)=0,'$$PROVIDER^XUSER(ORIEN1,1) Q ; Terminated? Skip if ALL requested
..I ORDATE>0,$$GET^XUA4A72(ORIEN1,ORDATE)<1 Q ; Check date?
..I $L(ORKEY),'$D(^XUSEC(ORKEY,+ORIEN1)) Q ; Check for key?
..S ORI=ORI+1,ORY(ORI)=ORIEN1_"^"_$$NAMEFMT^XLFNAME(ORFROM,"F","DcMPC")
..S ORDUP=0 ; Init flag, check duplication.
..I ($P(ORPREV_" "," ")=$P(ORFROM_" "," ")) S ORDUP=1
..;
..; Append Title if not duplicated:
..I 'ORDUP D
...S ORIEN2=ORIEN1
...D NP4(0) ; Get Title.
...I ORTTL="" Q
...S ORY(ORI)=ORY(ORI)_U_"- "_ORTTL
..;
..; Get data in case of dupes:
..I ORDUP D
...S ORIEN2=ORLAST ; Set to prev. IEN for NP2.
...;
...; Reset, use previous array element, call for extended data:
...S ORI=ORI-1,ORY(ORI)=$P(ORY(ORI),U)_U_$P(ORY(ORI),U,2) D NP2
...;
...; Now return to current user for second extended data call:
...S ORIEN2=ORIEN1,ORI=ORI+1 D NP2
..S ORLAST=ORIEN1,ORPREV=ORFROM ; Reassign vars for next pass.
;
Q
;
NP4(ORSS) ; Retrieve Title or Title and Service/Section.
; (Assumes certain vars already set/new'd in calling code.)
;
; Passed variable ORSS: If true, get Service/Section also.
;
S (ORTTL,ORSRV)="" ; Init each time.
; DBIA# 4329:
S ORTTL=$P($G(^VA(200,ORIEN2,0)),U,9) ; Get Title pointer.
I ORTTL<1 S ORTTL="" ; Reset var if none.
; DBIA# 1234:
I ORTTL>0 S ORTTL=$G(^DIC(3.1,ORTTL,0)) ; Actual Title value.
S ORSS=$G(ORSS)
I ORSS D ; Get Service/Section?
.; DBIA# 4329:
.S ORSRV=$P($G(^VA(200,ORIEN2,5)),U,1) ; Get S/S pointer.
.I ORSRV<1 S ORSRV="" ; Reset var if none.
.; DBIA# 4330:
.I ORSRV>0 S ORSRV=$P($G(^DIC(49,ORSRV,0)),U) ; Actual S/S value.
;
Q
;
NAMECVT(Y,IEN) ; Returns text name(mixed-case) derived from IEN xref.
; GRE/2002
; PKS-12/20/2002 Tag not presently used.
; Y=Returned value, IEN=Internal number
N ORNAME
S IEN=IEN_","
S ORNAME=$$GET1^DIQ(200,IEN,20.2)
S Y=$$NAMEFMT^XLFNAME(.ORNAME,"F","DcMPC")
Q
;
DEFDIV(Y) ; Return user's default division, if specified.
;
; Variables used:
; ORDD = Default division.
; ORDIV = Division holder variable.
; ORGOOD = Flag for successful default division found.
; ORIEN = IEN of user.
; ORZ = Memory array storage variable.
; ORZERR = Error storage for LIST^DIC call.
; Y = Returned value.
;
N ORDD,ORDIV,ORGOOD,ORIEN,ORZ,ORZERR
;
S ORIEN=DUZ,ORDIV=""
S Y=0,(ORDD,ORGOOD)=0 ; Initialize variables.
;
; Get list of divisions from NEW PERSON file multiple:
D LIST^DIC(200.02,","_ORIEN_",","@;.01;1","QP","","","","","","","ORZ","ORZERR")
I $P(ORZ("DILIST",0),U)=0 Q ; No Divisions listed.
;
; Iterate through list:
F S ORDD=$O(ORZ("DILIST",ORDD)) Q:+ORDD=0!'($L(ORDD)) D Q:ORGOOD
.;
.; See if current entry being processed is "Default" (done if so):
.I $P(ORZ("DILIST",ORDD,0),U,3)["Y" S ORDIV=$P(ORZ("DILIST",ORDD,0),U,2),ORGOOD=1 ; Division text.
.;
I (ORDIV="") Q ; Punt if no default division.
I $$UP^XLFSTR(ORDIV)="SALT LAKE CITY OIFO" S Y=1
;
Q
;
NEWLOC(Y,ORFROM,DIR) ; Return "CZ" locations from HOSPITAL LOCATION file.
; C=Clinics, Z=Other, screened by $$ACTLOC^ORWU.
; .Y=returned list, ORFROM=text to $O from, DIR=$O direction.
N I,IEN,CNT S I=0,CNT=44
F Q:I'<CNT S ORFROM=$O(^SC("B",ORFROM),DIR) Q:ORFROM="" D ; IA# 10040.
. S IEN="" F S IEN=$O(^SC("B",ORFROM,IEN),DIR) Q:'IEN D
. . Q:("C"'[$P($G(^SC(IEN,0)),U,3)!('$$ACTLOC^ORWU(IEN)))
. . S I=I+1,Y(I)=IEN_"^"_ORFROM
Q
;
ORWU1 ;SLC/GRE - General Utilities for Windows Calls [2/25/04 11:10am]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**149,187,195,215**;Dec 17, 1997
+2 ;
+3 QUIT
+4 ;
NP1 ; Return a set of names from the NEW PERSON file.
+1 ; (PKS/8/5/2003: Now called by NEWPERS^ORWU; internal mods made.)
+2 ; (Keep GETCOS^ORWTPN up to date with matching logic/code, too.)
+3 ;
+4 ; PARAMS from NEWPERS^ORWU call:
+5 ; .ORY=returned list.
+6 ; ORDATE=Checks for an active person class on this date (optional).
+7 ; ORDIR=Direction to move through the x-ref with $O.
+8 ; ORFROM=Starting name for this set.
+9 ; ORKEY=Screen users by security key (optional).
+10 ; ORVIZ=If true, includes RDV users; otherwise not (optional).
+11 ;
+12 NEW ORDD,ORDIV,ORDUP,ORGOOD,ORI,ORIEN1,ORIEN2,ORLAST,ORMAX,ORMRK,ORMULTI,ORPREV,ORSRV,ORTTL
+13 ;
+14 SET ORI=0
SET ORMAX=44
SET (ORLAST,ORPREV)=""
SET ORKEY=$GET(ORKEY)
SET ORDATE=$GET(ORDATE)
+15 ; IA# 10112. Do once at beginning of call.
SET ORMULTI=$$ALL^VASITE
+16 ;
+17 ; NP3 tag includes visitors, uses full "B" x-ref.
+18 ; Use alt. version, skip rest.
IF +$GET(ORVIZ)=1
DO NP3(0)
QUIT
+19 ; User requested ALL users, both active and inactive. Same call, but skip $$PROVIDER^XUSER screen
+20 IF +$GET(ORALL)=1
DO NP3(0)
QUIT
+21 ;
+22 FOR
IF ORI'<ORMAX
QUIT
SET ORFROM=$ORDER(^VA(200,"AUSER",ORFROM),ORDIR)
IF ORFROM=""
QUIT
Begin DoDot:1
+23 SET ORIEN1=""
+24 FOR
SET ORIEN1=$ORDER(^VA(200,"AUSER",ORFROM,ORIEN1),ORDIR)
IF 'ORIEN1
QUIT
Begin DoDot:2
+25 ;
+26 ; Check for key?
IF $LENGTH(ORKEY)
IF '$DATA(^XUSEC(ORKEY,+ORIEN1))
QUIT
+27 ; Check date?
IF ORDATE>0
IF $$GET^XUA4A72(ORIEN1,ORDATE)<1
QUIT
+28 SET ORI=ORI+1
SET ORY(ORI)=ORIEN1_"^"_$$NAMEFMT^XLFNAME(ORFROM,"F","DcMPC")
+29 ; Init flag, check dupe.
SET ORDUP=0
+30 IF ($PIECE(ORPREV_" "," ")=$PIECE(ORFROM_" "," "))
SET ORDUP=1
+31 ;
+32 ; Append Title if not duplicated:
+33 IF 'ORDUP
Begin DoDot:3
+34 SET ORIEN2=ORIEN1
+35 ; Get Title.
DO NP4(0)
+36 IF ORTTL=""
QUIT
+37 SET ORY(ORI)=ORY(ORI)_U_"- "_ORTTL
End DoDot:3
+38 ;
+39 ; Get data in case of dupes:
+40 IF ORDUP
Begin DoDot:3
+41 ; Prev IEN for NP2 call.
SET ORIEN2=ORLAST
+42 ;
+43 ; Reset, use previous array element, call for extended data:
+44 SET ORI=ORI-1
SET ORY(ORI)=$PIECE(ORY(ORI),U)_U_$PIECE(ORY(ORI),U,2)
DO NP2
+45 ;
+46 ; Then return to current user for second extended data call:
+47 SET ORIEN2=ORIEN1
SET ORI=ORI+1
DO NP2
End DoDot:3
+48 ; Reassign vars for next pass.
SET ORLAST=ORIEN1
SET ORPREV=ORFROM
End DoDot:2
End DoDot:1
+49 ;
+50 QUIT
+51 ;
NP2 ; Retrieve subset of data for dupes in NP1.
+1 ; (Assumes certain vars already set/new'd in calling code.)
+2 ;
+3 ; Variables used:
+4 ; ORZ = Memory array storage variable.
+5 ; ORZERR = Error storage for LIST^DIC call.
+6 ;
+7 ; Initialize variables.
NEW ORZ,ORZERR
+8 ; Reset each time.
SET ORDIV=""
+9 ; Get Title, Service/Section.
DO NP4(1)
+10 ;
+11 ; For multi-divisional site, get Division if determinable:
+12 IF ORMULTI
Begin DoDot:1
+13 DO LIST^DIC(200.02,","_ORIEN2_",","@;.01;1","QP","","","","","","","ORZ","ORZERR")
+14 ; Initialize variables.
SET (ORDD,ORGOOD)=0
+15 ; Division not listed.
IF $PIECE(ORZ("DILIST",0),U)=0
QUIT
+16 ; Only one, so use it.
IF $PIECE(ORZ("DILIST",0),U)=1
Begin DoDot:2
+17 ; Get the node's entry.
SET ORDD=$ORDER(ORZ("DILIST",ORDD))
+18 ; Get actual name value.
SET ORDIV=$PIECE(ORDD,U,2)
End DoDot:2
QUIT
+19 ;
+20 ; More than one Division entry, so:
+21 FOR
SET ORDD=$ORDER(ORZ("DILIST",ORDD))
IF +ORDD=0!'($LENGTH(ORDD))
QUIT
Begin DoDot:2
+22 ;
+23 ; See if current entry being processed is "Default" (done if so):
+24 ; Division text.
IF $PIECE(ORZ("DILIST",ORDD,0),U,3)["Y"
SET ORDIV=$PIECE(ORZ("DILIST",ORDD,0),U,2)
SET ORGOOD=1
QUIT
End DoDot:2
IF ORGOOD
QUIT
End DoDot:1
+25 ;
+26 ; Append new pieces to array string:
+27 SET ORMRK=""
+28 ; Nothing to append.
IF (ORTTL="")&(ORSRV="")&(ORDIV="")
QUIT
+29 ; At least something exists.
SET ORY(ORI)=ORY(ORI)_U_"- "
+30 ; Title.
IF (ORTTL'="")
SET ORY(ORI)=ORY(ORI)_ORTTL
SET ORMRK=", "
+31 ; Service.
IF (ORSRV'="")
SET ORY(ORI)=ORY(ORI)_ORMRK_ORSRV
SET ORMRK=", "
+32 ; Division.
IF (ORDIV'="")
SET ORY(ORI)=ORY(ORI)_ORMRK_ORDIV
+33 ;
+34 QUIT
+35 ;
NP3(COSFLAG) ; Retrieve diff. data when all users are involved, using "B" x-ref.
+1 ;
+2 ; COSFLAG=If TRUE, called by ORWTPN.
+3 ; (Assumes certain vars already set/new'd in calling code.)
+4 ;
+5 NEW ORNODE,COSQUIT
+6 ; Flag used in section for COSFLAG.
SET COSQUIT=0
+7 ;
+8 FOR
IF ORI'<ORMAX
QUIT
SET ORFROM=$ORDER(^VA(200,"B",ORFROM),ORDIR)
IF ORFROM=""
QUIT
Begin DoDot:1
+9 SET ORIEN1=""
+10 FOR
SET ORIEN1=$ORDER(^VA(200,"B",ORFROM,ORIEN1),ORDIR)
IF 'ORIEN1
QUIT
Begin DoDot:2
+11 ;
+12 ; Screen default cosigner if appropriate (ORUSER set in ORWTPN):
+13 IF COSFLAG
Begin DoDot:3
+14 SET COSQUIT=0
+15 IF '$$SCRDFCS^TIULA3(ORUSER,ORIEN1)
SET COSFLAG=1
QUIT
+16 SET ORNODE=$PIECE($GET(^VA(200,ORIEN1,0)),U)
+17 IF '$LENGTH(ORNODE)
SET COSFLAG=1
QUIT
End DoDot:3
+18 IF COSQUIT
QUIT
+19 ;
+20 ; Terminated? Skip if ALL requested
IF +$GET(ORALL)=0
IF '$$PROVIDER^XUSER(ORIEN1,1)
QUIT
+21 ; Check date?
IF ORDATE>0
IF $$GET^XUA4A72(ORIEN1,ORDATE)<1
QUIT
+22 ; Check for key?
IF $LENGTH(ORKEY)
IF '$DATA(^XUSEC(ORKEY,+ORIEN1))
QUIT
+23 SET ORI=ORI+1
SET ORY(ORI)=ORIEN1_"^"_$$NAMEFMT^XLFNAME(ORFROM,"F","DcMPC")
+24 ; Init flag, check duplication.
SET ORDUP=0
+25 IF ($PIECE(ORPREV_" "," ")=$PIECE(ORFROM_" "," "))
SET ORDUP=1
+26 ;
+27 ; Append Title if not duplicated:
+28 IF 'ORDUP
Begin DoDot:3
+29 SET ORIEN2=ORIEN1
+30 ; Get Title.
DO NP4(0)
+31 IF ORTTL=""
QUIT
+32 SET ORY(ORI)=ORY(ORI)_U_"- "_ORTTL
End DoDot:3
+33 ;
+34 ; Get data in case of dupes:
+35 IF ORDUP
Begin DoDot:3
+36 ; Set to prev. IEN for NP2.
SET ORIEN2=ORLAST
+37 ;
+38 ; Reset, use previous array element, call for extended data:
+39 SET ORI=ORI-1
SET ORY(ORI)=$PIECE(ORY(ORI),U)_U_$PIECE(ORY(ORI),U,2)
DO NP2
+40 ;
+41 ; Now return to current user for second extended data call:
+42 SET ORIEN2=ORIEN1
SET ORI=ORI+1
DO NP2
End DoDot:3
+43 ; Reassign vars for next pass.
SET ORLAST=ORIEN1
SET ORPREV=ORFROM
End DoDot:2
End DoDot:1
+44 ;
+45 QUIT
+46 ;
NP4(ORSS) ; Retrieve Title or Title and Service/Section.
+1 ; (Assumes certain vars already set/new'd in calling code.)
+2 ;
+3 ; Passed variable ORSS: If true, get Service/Section also.
+4 ;
+5 ; Init each time.
SET (ORTTL,ORSRV)=""
+6 ; DBIA# 4329:
+7 ; Get Title pointer.
SET ORTTL=$PIECE($GET(^VA(200,ORIEN2,0)),U,9)
+8 ; Reset var if none.
IF ORTTL<1
SET ORTTL=""
+9 ; DBIA# 1234:
+10 ; Actual Title value.
IF ORTTL>0
SET ORTTL=$GET(^DIC(3.1,ORTTL,0))
+11 SET ORSS=$GET(ORSS)
+12 ; Get Service/Section?
IF ORSS
Begin DoDot:1
+13 ; DBIA# 4329:
+14 ; Get S/S pointer.
SET ORSRV=$PIECE($GET(^VA(200,ORIEN2,5)),U,1)
+15 ; Reset var if none.
IF ORSRV<1
SET ORSRV=""
+16 ; DBIA# 4330:
+17 ; Actual S/S value.
IF ORSRV>0
SET ORSRV=$PIECE($GET(^DIC(49,ORSRV,0)),U)
End DoDot:1
+18 ;
+19 QUIT
+20 ;
NAMECVT(Y,IEN) ; Returns text name(mixed-case) derived from IEN xref.
+1 ; GRE/2002
+2 ; PKS-12/20/2002 Tag not presently used.
+3 ; Y=Returned value, IEN=Internal number
+4 NEW ORNAME
+5 SET IEN=IEN_","
+6 SET ORNAME=$$GET1^DIQ(200,IEN,20.2)
+7 SET Y=$$NAMEFMT^XLFNAME(.ORNAME,"F","DcMPC")
+8 QUIT
+9 ;
DEFDIV(Y) ; Return user's default division, if specified.
+1 ;
+2 ; Variables used:
+3 ; ORDD = Default division.
+4 ; ORDIV = Division holder variable.
+5 ; ORGOOD = Flag for successful default division found.
+6 ; ORIEN = IEN of user.
+7 ; ORZ = Memory array storage variable.
+8 ; ORZERR = Error storage for LIST^DIC call.
+9 ; Y = Returned value.
+10 ;
+11 NEW ORDD,ORDIV,ORGOOD,ORIEN,ORZ,ORZERR
+12 ;
+13 SET ORIEN=DUZ
SET ORDIV=""
+14 ; Initialize variables.
SET Y=0
SET (ORDD,ORGOOD)=0
+15 ;
+16 ; Get list of divisions from NEW PERSON file multiple:
+17 DO LIST^DIC(200.02,","_ORIEN_",","@;.01;1","QP","","","","","","","ORZ","ORZERR")
+18 ; No Divisions listed.
IF $PIECE(ORZ("DILIST",0),U)=0
QUIT
+19 ;
+20 ; Iterate through list:
+21 FOR
SET ORDD=$ORDER(ORZ("DILIST",ORDD))
IF +ORDD=0!'($LENGTH(ORDD))
QUIT
Begin DoDot:1
+22 ;
+23 ; See if current entry being processed is "Default" (done if so):
+24 ; Division text.
IF $PIECE(ORZ("DILIST",ORDD,0),U,3)["Y"
SET ORDIV=$PIECE(ORZ("DILIST",ORDD,0),U,2)
SET ORGOOD=1
+25 ;
End DoDot:1
IF ORGOOD
QUIT
+26 ; Punt if no default division.
IF (ORDIV="")
QUIT
+27 IF $$UP^XLFSTR(ORDIV)="SALT LAKE CITY OIFO"
SET Y=1
+28 ;
+29 QUIT
+30 ;
NEWLOC(Y,ORFROM,DIR) ; Return "CZ" locations from HOSPITAL LOCATION file.
+1 ; C=Clinics, Z=Other, screened by $$ACTLOC^ORWU.
+2 ; .Y=returned list, ORFROM=text to $O from, DIR=$O direction.
+3 NEW I,IEN,CNT
SET I=0
SET CNT=44
+4 ; IA# 10040.
FOR
IF I'<CNT
QUIT
SET ORFROM=$ORDER(^SC("B",ORFROM),DIR)
IF ORFROM=""
QUIT
Begin DoDot:1
+5 SET IEN=""
FOR
SET IEN=$ORDER(^SC("B",ORFROM,IEN),DIR)
IF 'IEN
QUIT
Begin DoDot:2
+6 IF ("C"'[$PIECE($GET(^SC(IEN,0)),U,3)!('$$ACTLOC^ORWU(IEN)))
QUIT
+7 SET I=I+1
SET Y(I)=IEN_"^"_ORFROM
End DoDot:2
End DoDot:1
+8 QUIT
+9 ;