Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: TIUPREF

TIUPREF.m

Go to the documentation of this file.
  1. TIUPREF ; SLC/JER - Enter/edit personal preferences ; 19-AUG-2002 13:10:05
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**10,91,103,111,141**;Jun 20, 1997
  1. ;
  1. GOODLOC(LOC) ; Returns 1 if ^SC hospital location IFN LOC is good, else 0
  1. ; Used in TIUVSIT, in DDs for LOCATION field of 8926
  1. N GOODLOC,INACTIVE,OOS,CLINIC S (GOODLOC,INACTIVE)=0
  1. I +$G(^SC(LOC,"I"))>0,(+$G(^("I"))'>DT) D
  1. . S INACTIVE=1
  1. . ; check if reactivated:
  1. . I +$P($G(^("I")),U,2)>0,$P($G(^("I")),U,2)'>DT S INACTIVE=0
  1. S OOS=+$D(^SC(LOC,"OOS")) ; Occasion of service
  1. S CLINIC=+($P(^SC(LOC,0),U,3)="C")
  1. I 'INACTIVE,'OOS,CLINIC S GOODLOC=1
  1. Q GOODLOC
  1. ;
  1. MAIN ; Control branching
  1. N DA
  1. S DA=+$$GETREC
  1. I +DA'>0 Q
  1. D EDIT(DA)
  1. Q
  1. GETREC() ; Get record in picklist file
  1. N DIC,DLAYGO,TIUNM,X,Y,ASKNEW
  1. S (DIC,DLAYGO)=8926,DIC(0)="NXLZ"
  1. S DIC("S")="I $P(^(0),U)=DUZ" ;TIU*1*91 If user already in file but has same name as another entry, select user
  1. S X="`"_DUZ,TIUNM=$P(^VA(200,+$G(DUZ),0),U)
  1. W !," Enter/edit Personal Preferences"
  1. W !!?5,TIUNM
  1. D ^DIC
  1. ;TIU*1*91 If DIC adds new entry, can get anyone w/ same name:
  1. I Y>0,+Y(0)'=DUZ N DA,DIK D
  1. . W !!," Sorry, you can edit preferences for YOURSELF only. Please try again."
  1. . I $P(Y,U,3)=1 S DA=+Y,DIK="^TIU(8926," D ^DIK S Y=-1
  1. Q +$G(Y)
  1. EDIT(DA) ; Call ^DIE to edit the record
  1. N DIE,DR,TIUCLASS,TIUREQCS,LOC
  1. S DIE=8926,TIUREQCS=+$$REQCOS(DUZ)
  1. S LOC=+$P(^TIU(8926,DA,0),U,2)
  1. I LOC>0,'$$GOODLOC(LOC) W !," Your default location is no longer valid and has been deleted.",!," Please choose a new one." S DR=".02///@" D ^DIE
  1. S DR=".02:.08;.1;.11;I +TIUREQCS'>0 S Y=""@1"";.09;@1;1"
  1. S DR(2,8926.01)=".01;.02;.03" D ^DIE
  1. Q
  1. REQCOS(DUZ) ; Does user require cosignature for any documents
  1. N TIUI,TIUJ,TIUC,TIUY S (TIUI,TIUY)=0
  1. ; Is the user required to have a cosignature on any document?
  1. F S TIUI=$O(^TIU(8925.95,TIUI)) Q:+TIUI'>0!+TIUY D
  1. . S TIUJ=0
  1. . F S TIUJ=$O(^TIU(8925.95,TIUI,5,TIUJ)) Q:+TIUJ'>0!+TIUY D
  1. . . S TIUC=+$G(^TIU(8925.95,TIUI,5,TIUJ,0)) Q:+TIUC'>0
  1. . . S TIUY=+$$ISA^USRLM(DUZ,TIUC)
  1. Q TIUY