source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNMAIN.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1SPNMAIN ;SAN/WDE/Display/edit divison of the user./2/15/2000
2 ;;2.0;Spinal Cord Dysfunction;**12,13,15,20**;01/02/1997
3 ;
4EN(DUZ) ;
5 Q:'$D(DUZ)
6 ;returns the 3 or 5 digit station number ie 644 or 665BY.
7 S SPNDIV=$P($G(^SPNL(154.91,1,1,DUZ,0)),U,2)
8 Q SPNDIV
9 ;
10EN2(DUZ) ;
11 Q:'$D(DUZ)
12 ;returns the division name
13 S SPNDIV1=$P($G(^SPNL(154.91,1,1,DUZ,0)),U,2) I SPNDIV1="" Q SPNDIV1
14 S SPNDIV2="",SPNDIV2=$O(^DG(40.8,"C",SPNDIV1,SPNDIV2))
15 I SPNDIV2="" S SPNDIV1="ERROR" K SPNDIV2 Q SPNDIV1
16 S SPNDIV1=$P($G(^DG(40.8,SPNDIV2,0)),U,1)
17 K SPNDIV2
18 Q SPNDIV1
19DISP ;display the site prefix and name to the user
20 I $D(IOF) W @IOF
21 Q:'$D(DUZ)
22 S SPNUSE1=$P($G(^VA(200,DUZ,0)),U,1) S SPNUSE1=$P(SPNUSE1,",",2)_" "_$P(SPNUSE1,",",1)
23 W !!?5,"Hello "_SPNUSE1
24 I $$EN^SPNMAIN(DUZ)="" W !?10,"You need to select a division that you work under." D NEW D EDIT Q
25 W !?5,"You are working under the division of ",$$EN^SPNMAIN(DUZ)," / ",$$EN2(DUZ),"."
26 S SPNTST=$G(^SPNL(154.91,1,1,DUZ,0)),SPNTST=$P(SPNTST,U,4)
27 I SPNTST'="Y" D LOAD^SPNDIV(DUZ) K SPNTST ;ONE TIME LOAD INTO 154
28 Q
29EDIT ;
30 ;used to change if user has an entry on file
31 W !
32 S DIE="^SPNL(154.91,1,1," ; global root of subfile
33 S DA(1)=1 ; entry number in file
34 S DA=DUZ ;Sub entry number
35 I $D(DR)=0 S DR="1"
36 S DIE(0)="AEMNQ"
37 D ^DIE
38 K DIE,DA,DR,X,Y
39 I $$EN^SPNMAIN(DUZ)="" W !,"You are required to enter a Medical Center Division." H 2 D EDIT
40 Q
41NEW ;user did not have a division selected and we will add
42 S DR=10
43 S DR(1,154.91)="10;"
44 S DIC="^SPNL(154.91,1,1,"
45 S DIC(0)="AEMNQ"
46 S DIC("P")=$P(^DD(154.91,10,0),U,2)
47 S DA=1
48 S DA(1)=1
49 S X=DUZ,DINUM=DUZ
50 D FILE^DICN
51 K DIC,DR,DA,Y,X
52 Q
Note: See TracBrowser for help on using the repository browser.