source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SDCO20.m@ 1445

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1SDCO20 ;ALB/RMO - Process One Classification - Check Out;30 DEC 1992 1:10 pm
2 ;;5.3;Scheduling;**20**;Aug 13, 1993
3 ;
4ONE(SDCTI,SDATA,SDOE,SDCOQUIT) ;Process One Classification
5 ; Input -- SDCTI Outpatient Classification Type IEN
6 ; SDATA Null or 409.42 IEN^Internal Value^1=n/a^1=unedt
7 ; SDOE Outpatient Encounter file IEN
8 ; Output -- SDCOQUIT User entered '^' or timeout
9 N SDCT0,SDVAL
10 S SDCT0=$G(^SD(409.41,SDCTI,0)) G ONEQ:SDCT0']""
11 I SDATA,$P(SDATA,"^",3) D G ONEQ
12 .W !,*7,">>> ",$P(SDCT0,"^",6)," is no longer applicable..."
13 .S DA=+SDATA,DIK="^SDD(409.42," D ^DIK
14 .W "deleted."
15 I SDATA,$P(SDATA,"^",4) D G ONEQ
16 .W !,$P(SDCT0,"^",6),": ",$$VAL^SDCODD(SDCTI,$P(SDATA,"^",2))," <Uneditable>"
17 S SDVAL=$$VAL(SDCTI,SDCT0,SDATA)
18 I SDVAL="^" S SDCOQUIT="" D G ONEQ
19 .I $P(SDCT0,"^",5),$P(SDATA,"^",2)="",$P($G(^SCE(SDOE,0)),"^",7) D COMDT^SDCODEL(SDOE,1)
20 D FILE(+SDATA,SDVAL)
21ONEQ Q
22 ;
23VAL(SDCTI,SDCT0,SDATA) ;Get Outpatient Classification
24 N DIR,Y
25 I SDCTI=3,$P($G(^SCE(+SDOE,0)),"^",10)=2 D G VALQ
26 .S Y=1
27 .W !,">>> Updating treatment for SC condition to 'Yes'..."
28REASK S DIR("A")=$S($P(SDCT0,"^",2)]"":$P(SDCT0,"^",2),1:$P(SDCT0,"^"))
29 I $P(SDATA,"^",2)]""!($P(SDCT0,"^",4)]"") S DIR("B")=$S($P(SDATA,"^",2)]"":$$VAL^SDCODD(SDCTI,$P(SDATA,"^",2)),1:$P(SDCT0,"^",4))
30 S DIR(0)=$P(SDCT0,"^",3)_"O"
31 I $D(^SD(409.41,SDCTI,2)) S DIR(0)=DIR(0)_"^"_^(2)
32 I SDCTI=3 S DIR("?")="^D SC^SDCO23(DFN)"
33 D ^DIR
34 I $P(SDCT0,"^",5),'$D(DTOUT),$P(SDATA,"^",2)="",Y=""!(Y["^"&('$P($G(^DG(43,1,"SCLR")),"^",24))) D G REASK
35 .W !,*7,"This is a required response." W:Y["^" " An '^' is not allowed."
36 .K DIRUT,DUOUT
37 I $D(DIRUT) S Y="^"
38VALQ K DIRUT,DTOUT,DUOUT
39 Q $G(Y)
40 ;
41FILE(SDCNI,SDCNV) ;File Outpatient Classification
42 ; Input -- SDCNI Outpatient Classification IEN
43 ; SDCNV Outpatient Classification Value
44 ; Output -- File Outpatient Classification
45 N DA,DIE,DR,X
46 I $G(SDCNI)'>0 S SDCNI=$$NEW(SDCTI,SDOE) G FILEQ:SDCNI<0
47 S DA=SDCNI,DIE="^SDD(409.42,",DR=".03////^S X=SDCNV" D ^DIE
48FILEQ Q
49 ;
50NEW(SDCTI,SDOE) ;Add a New Outpatient Classification
51 ; Input -- SDCTI Appointment Outpatient Type file IEN
52 ; SDOE Outpatient Encounter file IEN
53 ; Output -- Outpatient Classification file IEN
54 N DA,DD,DIC,DIK,DINUM,DLAYGO,DO,SDCNI,X,Y
55 S X=SDCTI,(DIC,DIK)="^SDD(409.42,",DIC(0)="L",DLAYGO=409.42
56 D FILE^DICN S SDCNI=+Y
57 I SDCNI>0 L +^SDD(409.42,SDCNI) S $P(^SDD(409.42,SDCNI,0),"^",2)=SDOE,DA=SDCNI D IX1^DIK L -^SDD(409.42,SDCNI)
58NEWQ Q SDCNI
Note: See TracBrowser for help on using the repository browser.