source: FOIAVistA/tag/r/SURGERY-SR/SROERR0.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1SROERR0 ;B'HAM ISC/ADM - ORDER ENTRY ROUTINE ;02/03/05
2 ;;3.0; Surgery ;**4,67,73,41,86,107,147,144**;24 Jun 93
3 ;
4 ; Reference to RETURN^ORX supported by DBIA #866
5 ; Reference to ^TMP("CSLSUR1" supported by DBIA #3498
6 ; Reference to UPD^VPRSR supported by DBIA #4750
7 ;
8 N SROP,SROPER,SRDYNOTE,SRTYPE S SRTYPE=0
9 I $P($G(^SRO(133,SRSITE,0)),"^",22)="Y",$D(^TMP("CSLSUR1",$J)) D
10 .S SROP=SROERR,SROPER="" D ^SROP1 S SRDYNOTE=$P($G(^SRF(SROERR,31)),"^",10)
11 .I SROPER["REQUESTED",'SRDYNOTE Q
12 .I SROPER["CANCELLED"!(SROPER["ABORTED") S SRTYPE=3
13 .I 'SRTYPE,'SRDYNOTE S SRTYPE=1
14 .I 'SRTYPE,SRDYNOTE=1 S SRTYPE=2
15 .I '$P($G(^SRF(SROERR,.2)),"^",10),'$P($G(^SRF(SROERR,"OP")),"^",2) D
16 ..W !!," This Surgery case does not have a Principal CPT Code entered. The ",!," information sent to SPD for creation of a case cart may not contain ",!," enough information for processing."
17 .D ST^SRSCOR(SROERR)
18 D SERR^SROPFSS(SROERR,"SROERR0")
19 D STATUS
20 I '$D(SREVENT) N SREVENT S SREVENT=$S(SRSTATUS="(CANCELLED)":"S15",1:"S14")
21 D MSG^SRHLZIU(SROERR,SRSTATUS,SREVENT)
22 I SRSTATUS="(COMPLETED)"!(SRSTATUS="(NOT COMPLETE)")!(SRSTATUS="(ABORTED)") D MSG^SRHLOORU(SROERR,SRSTATUS,SREVENT)
23 I $L($T(UPD^VPRSR)) D UPD^VPRSR(SROERR,$G(DFN),SRSTATUS) Q ;CPRS-R
24 I +$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 D END Q
25 S:'$G(ORIFN) ORIFN=$P(^SRF(SROERR,0),"^",14) I 'ORIFN K ORIFN D END Q
26 S ORNP=$S($P($G(^SRF(SROERR,"NON")),"^")="Y":$P(^("NON"),"^",6),1:$P(^(.1),"^",4)),SRSOP=$P(^("OP"),"^")
27 S ORTX=SRSOP_"|>> Case #"_SROERR_" "_SRSTATUS,ORSTRT=$P(^SRF(SROERR,0),"^",9)
28 I DT<$E(ORSTRT,1,7) S X1=ORSTRT,X2=DT D ^%DTC S ORPURG=X+30
29 D RETURN^ORX
30END K SROERR
31 Q
32STATUS ; case status
33 I $P($G(^SRF(SROERR,"NON")),"^")="Y" S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=2 S SRSTATUS=$S($P($G(^(30)),"^"):"(ABORTED)",$P($G(^("NON")),"^",5):"(COMPLETED)",1:"(NOT COMPLETE)") Q
34 I $P($G(^SRF(SROERR,30)),"^")'="" D CAN Q
35 I $P($G(^SRF(SROERR,31)),"^",8)'="" D CAN Q
36 I $P($G(^SRF(SROERR,.2)),"^",12) S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=2 S SRSTATUS="(COMPLETED)" Q
37 I $D(^SRF(SROERR,.2)),$P(^(.2),"^",12)="" S SRSTAT=0 D SCH I SRST=0 D REQ Q:SRST G NO
38 I '$D(^SRF(SROERR,.2)) S SRSTAT=0 D SCH I SRST=0 D REQ Q:SRST=1 G NO
39 Q
40NO ; not requested or scheduled
41 I +$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 S ORSTS=9
42 S SRSTATUS="(NOT COMPLETE)"
43 Q
44CAN ; cancelled or aborted
45 I +$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 S ORSTS=1
46 S SR(.2)=$G(^SRF(SROERR,.2)) I $P(SR(.2),"^")!($P(SR(.2),"^",10)) S SRSTATUS="(ABORTED)" Q
47 S SRSTATUS="(CANCELLED)"
48 Q
49SCH ; check to see if case is scheduled
50 I '$D(^SRF(SROERR,31)) S SRST=0 Q
51 I $P($G(^SRF(SROERR,31)),"^",4)="" S SRST=0 Q
52 I $P($G(^SRF(SROERR,31)),"^",4) D:SRSTAT=0 TIM0 D:SRSTAT=1 TIM1 S SRST=1 Q
53 Q
54TIM0 I '$D(^SRF(SROERR,.2)) S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=8 S SRSTATUS="(SCHEDULED)" Q
55 I $P(^SRF(SROERR,.2),"^",2) S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=9 S SRSTATUS="(NOT COMPLETE)" Q
56 I $P(^SRF(SROERR,.2),"^",2)="" S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=8 S SRSTATUS="(SCHEDULED)"
57 Q
58TIM1 S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=8 S SRSTATUS="(SCHEDULED)" Q
59REQ ; check to see if case has been requested
60 I $P($G(^SRF(SROERR,"REQ")),"^")=1,'$D(^SRF(SROERR,.2)) S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=5 S SRSTATUS="(REQUESTED)",SRST=1 Q
61 I $P($G(^SRF(SROERR,"REQ")),"^")=1,$P($G(^(.2)),"^",2)="" S:+$$VERSION^XPDUTL("ORDER ENTRY/RESULTS REPORTING")>2.5 ORSTS=5 S SRSTATUS="(REQUESTED)",SRST=1
62 Q
Note: See TracBrowser for help on using the repository browser.