source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDCO21.m@ 861

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1SDCO21 ;ALB/RMO - Classification Cont. - Check Out;30 MAR 1993 2:10 pm ; 3/12/04 4:33pm
2 ;;5.3;Scheduling;**150,244,325**;Aug 13, 1993
3 ;
4CL(DFN,SDDT,SDOE,SDCLY) ;Build Classification Array
5 ; Input -- DFN Patient file IEN
6 ; SDDT Date/Time
7 ; SDOE Outpatient Encounter file IEN [Optional]
8 ; Output -- SDCLY Classification Array
9 ; Subscripted by Class. Type file (#409.41) IEN
10 N SDCTI
11 S SDCTI=0 F S SDCTI=$O(^SD(409.41,SDCTI)) Q:'SDCTI I $$SCR(SDCTI,DFN,SDDT,$G(SDOE)) S SDCLY(SDCTI)=""
12CLQ Q
13 ;
14SCR(SDCTI,DFN,SDDT,SDOE) ;Outpatient Classification Type Screen
15 ; Input -- SDCTI Outpatient Classification Type IEN
16 ; DFN Patient file IEN
17 ; SDDT Date/Time
18 ; SDOE Outpatient Encounter file IEN [Optional]
19 ; Output -- 1=Yes and 0=No
20 N Y
21 I $$ACT^SDCODD(SDCTI,SDDT) D
22 .I $D(^SD(409.41,SDCTI,1)) X ^(1) Q:'$T
23 .S Y=1
24SCRQ Q +$G(Y)
25 ;
26CLOE(SDOE,SDCLOEY) ;Set-up Classification Array for Outpatient Encounter
27 ; Input -- SDOE Outpatient Encounter file IEN
28 ; Output -- SDCLOEY Classification Array Set for Outpatient Encounter
29 ; Subscripted by Class Type file IEN
30 ; Null or 409.42 IEN^Internal Value^1=n/a^1=unedt
31 N SDCLY,SDCN0,SDCNI,SDCTI,SDCTIS,SDCTS,SDOE0
32 S SDOE0=$G(^SCE(+SDOE,0))
33 D CL($P(SDOE0,"^",2),+SDOE0,SDOE,.SDCLY)
34 S SDCTI=0 F S SDCTI=$O(^SDD(409.42,"AO",SDOE,SDCTI)) Q:'SDCTI S SDCNI=+$O(^(SDCTI,0)) I $D(^SDD(409.42,SDCNI,0)) S SDCN0=^(0) D
35 .S SDCLY(SDCTI)=SDCNI_"^"_$P(SDCN0,"^",3)_"^"_$S('$D(SDCLY(SDCTI)):1,1:"")_"^"_$S($P(SDOE0,"^",10)=2:1,1:"")
36 S SDCTIS=$$SEQ
37 F SDCTS=1:1 S SDCTI=+$P(SDCTIS,",",SDCTS) Q:'SDCTI I $D(SDCLY(SDCTI)) S SDCLOEY(SDCTI)=SDCLY(SDCTI)
38CLOEQ Q
39 ;
40SC(SDCTI,SDOE,SDSELY,SDCLOEY) ;Service Connected Classification Checks
41 N SDCHGF,SDCLOE,SDSEL
42 S SDSEL=$S(SDCTI=1:2,SDCTI=2:3,SDCTI=4:4,1:"") G SCQ:SDSEL=""
43 D CHK(SDOE,SDCTI,.SDCLOE)
44 I $D(SDCLOE) D G SCQ
45 .I SDCLOE,$P(SDCLOE,"^",3) S SDCHGF=1
46 .I SDCLOE="" S SDCHGF=1
47 .I $G(SDCHGF) S:$D(SDSELY) SDSELY(SDSEL)="" S SDCLOEY(SDCTI)=SDCLOE
48 I '$D(SDCLOE) D
49 .K SDCLOEY(SDCTI)
50SCQ Q
51 ;
52CHK(SDOE,SDCTI,SDCLOE) ;Check One Classification for Outpatient Encounter
53 ; Input -- SDOE Outpatient Encounter file IEN
54 ; SDCTI Outpatient Classification Type IEN
55 ; Output -- SDCLOE Null or 409.42 IEN^Internal Value^1=n/a^1=unedt
56 N DFN,SDCL,SDCNI,SDDT,SDOE0
57 S SDOE0=$G(^SCE(+SDOE,0))
58 S DFN=+$P(SDOE0,"^",2),SDDT=+SDOE0
59 I $$SCR(SDCTI,DFN,SDDT,SDOE) S SDCL=""
60 S SDCNI=+$O(^SDD(409.42,"AO",SDOE,SDCTI,0))
61 I $D(^SDD(409.42,SDCNI,0)) S SDCL=SDCNI_"^"_$P(^(0),"^",3)_"^"_$S('$D(SDCL):1,1:"")_"^"_$S($P(SDOE0,"^",10)=2:1,1:"")
62 I $D(SDCL) S SDCLOE=SDCL
63CHKQ Q
64 ;
65SEQ() ;Classification Type Sequence by IEN
66 ; Input -- None
67 ; Output -- Classification Type Sequence by IEN
68 ; Current Sequence is: SC, CV, AO, IR, EC, MST, HNC
69 Q "3,7,1,2,4,5,6"
Note: See TracBrowser for help on using the repository browser.