Changeset 623 for WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPRES1.m
- Timestamp:
- Dec 4, 2009, 12:11:15 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPRES1.m
r613 r623 1 LRAPRES1 ;DALOI/WTY/KLL/CKA- AP ESIG RELEASE REPORT/ALERT;11/13/012 ;;5.2;LAB SERVICE;**259,336,369,365**;Sep 27, 1994;Build 9 3 4 ;Referenceto FILE^TIUSRVP supported by IA #35405 ;Referenceto ^TIULQ supported by IA #26936 ;Reference to ^ORB3LAB supported by IA #4287 7 ;Reference to DIC lookup on MAIL GROUP file (#3.8) supported by IA #10111 8 ; 9 MAIN(LRDFN,LRSS,LRI,LRSF,LRP,LRAC) ;Main subroutine 10 Q:'$D(LRDFN)!('$D(LRSS))!('$D(LRP))!('$D(LRAC)) 11 N LRDOCS,LRMSG,LRC,LRDOCSN,LRNUM,LRADL,LRMORE,LRQUIT,LRXQA 12 N DIR,DIRUT,DTOUT,DUOUT,X,Y,DIC,XQA,XQAMSG 13 S LRQUIT=0 14 I $G(LRAU) D 15 .S LRA=^LR(LRDFN,"AU") 16 .S LRI=$P(LRA,U) 17 D DOCS 18 Q:LRQUIT 19 D MORE 20 I LRMORE D LOOKUP 21 D SEND 22 Q 23 DOCS ;GET ORDERING PROVIDER AND PCP TO SEND ALERT 24 W ! 25 S:$G(LRSF)="" LRSF=63 26 D GETDOCS^LRAPUTL(.LRDOCS,LRDFN,LRSS,$G(LRI),LRSF) 27 S:LRDOCS(1)=LRDOCS(2) LRDOCS(2)=0 28 F LRC=1:1:2 D 29 .I LRDOCS(LRC) D 30 ..S LRDOCSN(LRC)=$$NAME^XUSER(LRDOCS(LRC),"F") 31 ..I LRDOCSN(LRC)'="" S LRXQA(LRDOCS(LRC))="" 32 S LRNUM=1 33 K LRMSG 34 D 35 .S LRMSG(LRNUM)="Alert will be sent to:",LRMSG(LRNUM,"F")="!!" 36 .I LRDOCS(1) D 37 ..S LRNUM=LRNUM+1,LRMSG(LRNUM)=LRDOCSN(1),LRMSG(LRNUM,"F")="?24" 38 .I LRDOCS(2)D39 ..S LRNUM=LRNUM+1,LRMSG(LRNUM)=LRDOCSN(2) 40 ..S LRMSG(LRNUM,"F")=$S(LRDOCS(1):"!",1:"")_"?24" 41 I LRQUIT D 42 .S LRMSG(LRNUM)="No Ordering Provider or PCP for alert" 43 .S LRMSG(LRNUM,"F")="!!" 44 D EN^DDIOL(.LRMSG) 45 Q 46 MORE ;Add names or mail groups to the lookup list? 47 N DIR,DIRUT,DTOUT,DUOUT,X,Y 48 W ! 49 S LRMORE=1 50 S DIR(0)="Y" 51 S DIR("A")="Send the alert to additional names or mail groups" 52 S X=$$GET^XPAR("USR^DIV^PKG","LRAPRES1 AP ALERT",1,"Q") 53 S X=$S(X=1:"YES",X=0:"NO",1:"NO") 54 S DIR("B")=X 55 D ^DIR 56 I Y=0 S LRMORE=0 Q 57 I $D(DUOUT)!($D(DTOUT)) S LRQUIT=1,LRMORE=0 58 Q 59 LOOKUP ;Add additional names or mail groups to alert list. 60 F D Q:LRQUIT 61 .W ! 62 .K DIR 63 .;S DIR(0)="F^3:30^I X'?1""U."".E&(X'?1""G."".E) K X" 64 .S DIR(0)="FO^3:30^I X["".""&((X'?1""G."".E)&(X'?1""g."".E)) K X"65 .S DIR("A")="Enter name or mail group"66 .S DIR("?")="Enter lastname,firstname OR G.mailgroup OR ^ to exit"67 .D ^DIR 68 .I $D(DIRUT) S LRQUIT=1 Q 69 .S X=Y,LRADL="" 70 .I Y["." S LRADL=$P(Y,"."),X=$P(Y,".",2) 71 .S Y=$$UP^XLFSTR(Y)72 .I LRADL="g" S LRADL="G" 73 .K DIC 74 .S DIC(0)="QEZ" 75 .S DIC=$S(LRADL="G":3.8,1:200) 76 .D ^DIC 77 .Q:Y=-1 78 .S:LRADL="" XQA($P(Y,"^"))=""79 .S:LRADL="G" XQA("G."_$P(Y,"^",2))="" 80 Q 81 SEND ;Send the alert 82 ;S XQAMSG=$E(LRP,1,9)_" ("_$E(LRP,1)_VA("BID")_"): Pathology report signed for "_LRAC_"." 83 ;D SETUP^XQALERT 84 M XQA=LRXQA 85 D LAB^ORB3LAB(DFN,LRDFN,LRI,$G(LRA),LRSS,.XQA)86 I $D(LRADL) D 87 .S LRMSG="Alerts have been sent to the specified additional users."88 .D EN^DDIOL(LRMSG,"","!!")89 .K LRMSG90 91 AHELP 92 93 94 95 S LRMSG(2)="provider andthe surgeon/physician that this report has"96 S LRMSG(3)="been electronically signed and is nowavailable for"97 S LRMSG(4)="viewing.You will also have the opportunity to send the"98 99 100 101 RETRACT(LRDFN,LRSS,LRI,LRTIUPTR) 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 CLSSCHK(DUZ,LREND) 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 1 LRAPRES1 ;DALOI/WTY/KLL - AP ESIG RELEASE REPORT/ALERT;11/13/01 2 ;;5.2;LAB SERVICE;**259,336,369**;Sep 27, 1994;Build 2 3 ; 4 ;Reference to FILE^TIUSRVP supported by IA #3540 5 ;Reference to ^TIULQ supported by IA #2693 6 ; 7 MAIN(LRDFN,LRSS,LRI,LRSF,LRP,LRAC) ;Main subroutine 8 Q:'$D(LRDFN)!('$D(LRSS))!('$D(LRP))!('$D(LRAC)) 9 N LRDOCS,LRMSG,XQA,LRC,LRDOCSN,LRNUM,LRADL,LRMORE,LRQUIT 10 N DIR,DIRUT,DTOUT,DUOUT,X,Y,DIC,XQA,XQAMSG 11 S LRQUIT=0 12 D ASK 13 Q:LRQUIT 14 D MORE 15 Q:LRQUIT 16 D:LRMORE LOOKUP 17 D ALERT 18 Q 19 ASK ;Ask if alert is to be sent 20 W ! 21 S DIR(0)="Y",DIR("B")="NO" 22 S DIR("A")="Do you wish to send an alert" 23 S DIR("??")="^D AHELP^LRAPRES1" 24 D ^DIR 25 I 'Y S LRQUIT=1 Q 26 S:$G(LRSF)="" LRSF=63 27 D GETDOCS^LRAPUTL(.LRDOCS,LRDFN,LRSS,$G(LRI),LRSF) 28 S:LRDOCS(1)=LRDOCS(2) LRDOCS(2)=0 29 S LRQUIT=1 30 F LRC=1:1:2 D 31 .I LRDOCS(LRC) D 32 ..S LRQUIT=0 33 ..S X=LRDOCS(LRC) D D^LRUA S LRDOCSN(LRC)=X 34 ..I LRDOCSN(LRC)'="" S XQA(LRDOCS(LRC))="" 35 ;Q:LRQUIT 36 S LRNUM=1 37 K LRMSG 38 I 'LRQUIT D 39 .S LRMSG(LRNUM)="Alert will be sent to:",LRMSG(LRNUM,"F")="!!" 40 .I LRDOCS(1) D 41 ..S LRNUM=LRNUM+1,LRMSG(LRNUM)=LRDOCSN(1),LRMSG(LRNUM,"F")="?24" 42 .I LRDOCS(2) D 43 ..S LRNUM=LRNUM+1,LRMSG(LRNUM)=LRDOCSN(2) 44 ..S LRMSG(LRNUM,"F")=$S(LRDOCS(1):"!",1:"")_"?24" 45 I LRQUIT D 46 .S LRMSG(LRNUM)="No Physician or PCP selected for alert" 47 .S LRMSG(LRNUM,"F")="!!" 48 .S LRQUIT=0 49 D EN^DDIOL(.LRMSG) 50 Q 51 MORE ;Add names or mail groups to the lookup list? 52 W ! 53 S LRMORE=1 54 S DIR(0)="Y",DIR("B")="NO" 55 S DIR("A")="Send the alert to additional names or mail groups" 56 D ^DIR 57 I Y=0 S LRMORE=0 Q 58 I $D(DUOUT)!($D(DTOUT)) S LRQUIT=1 59 Q 60 LOOKUP ;Add additional names or mail groups to alert list. 61 F D Q:LRQUIT 62 .W ! 63 .K DIR 64 .;S DIR(0)="F^3:30^I X'?1""U."".E&(X'?1""G."".E) K X" 65 .S DIR(0)="F^3:30^I X["".""&(X'?1""G."".E) K X" 66 .S DIR("A")="Enter name or mail group" 67 .S DIR("?")="Enter lastname,firstname OR G.mailgroup OR ^ to exit" 68 .D ^DIR 69 .I $D(DUOUT)!($D(DTOUT)) S LRQUIT=1 Q 70 .S X=Y,LRADL="" 71 .I Y["." S LRADL=$P(Y,"."),X=$P(Y,".",2) 72 .K DIC 73 .S DIC(0)="QEZ" 74 .S DIC=$S(LRADL="G":3.8,1:200) 75 .D ^DIC 76 .Q:Y=-1 77 .S:LRADL="" XQA($P(Y,"^"))="" 78 .S:LRADL="G" XQA("G."_$P(Y,"^",2))="" 79 .K LRMSG 80 .S LRMSG=$S(LRADL="G":"Mail group ",1:"User ")_$P(Y,"^",2) 81 .S LRMSG=LRMSG_" added to alert list." 82 .D EN^DDIOL(LRMSG,"","!!") 83 Q 84 ALERT ;Send the alert 85 S XQAMSG="Pathology report signed for "_LRAC_" - "_$E(LRP,1,30) 86 D SETUP^XQALERT 87 S LRMSG="Alerts have been sent." 88 D EN^DDIOL(LRMSG,"","!!") 89 K LRMSG 90 Q 91 AHELP ;Help Frame 92 K LRMSG 93 S LRMSG(1)="If answered 'Yes', the alert will notify the primary care" 94 S LRMSG(1,"F")="!" 95 S LRMSG(2)="provider and the surgeon/physician that this report has" 96 S LRMSG(3)="been electronically signed and is now available for" 97 S LRMSG(4)="viewing. You will also have the opportunity to send the" 98 S LRMSG(5)="alert to additional names or mail groups." 99 D EN^DDIOL(.LRMSG) 100 Q 101 RETRACT(LRDFN,LRSS,LRI,LRTIUPTR) ; 102 ;Change prior TIU versions of report to RETRACTED status 103 N LRROOT,LRIENS,LRFILE,LRTIUP,LRTIUAR,LRERR,LRSTAT,LRTIUX,LREXRR 104 I LRSS=""!("AUSPEMCY"'[LRSS) S LRPTR=0 Q 105 I LRSS="AU" D 106 .S LRROOT="^LR(LRDFN,101,""C""",LRIENS=LRDFN_"," 107 .S LRFILE=63.101 108 I LRSS'="AU" D 109 .S LRROOT="^LR(LRDFN,LRSS,LRI,.05,""C""" 110 .S LRIENS=LRI_","_LRDFN_"," 111 .S LRFILE=$S(LRSS="SP":63.19,LRSS="CY":63.47,LRSS="EM":63.49,1:"") 112 Q:'$D(@(LRROOT_")")) 113 S LRTIUP=0,LRTIUX(.05)=15 114 F S LRTIUP=$O(@(LRROOT_",LRTIUP)")) Q:LRTIUP'>0!(LRTIUP=LRTIUPTR) D 115 .K LRTIUAR S (LRSTAT,LRERR)=0 116 .D EXTRACT^TIULQ(LRTIUP,"LRTIUAR",.LRERR,".05",,,"I") 117 .Q:+LRERR 118 .M LRSTAT=LRTIUAR(LRTIUP,.05,"I") 119 .Q:LRSTAT'=7 ;Quit if current status is not COMPLETED 120 .D FILE^TIUSRVP(.LREXRR,LRTIUP,.LRTIUX) 121 .;Update new TIU version of report with previous TIU pointer value 122 .N LREXRR,LRTIUX 123 .S LRTIUX(1406)=LRTIUP 124 .D FILE^TIUSRVP(.LREXRR,LRTIUPTR,.LRTIUX) 125 Q 126 CLSSCHK(DUZ,LREND) ;Determine if user has the proper class settings and 127 ;PROVIDER key 128 N LRMSG,LRPRCLSS,LRPCEXP,LRVCDE,LRPCSTR,LRMTCH 129 ;First, check for PROVIDER key 130 I '$D(^XUSEC("PROVIDER",DUZ)) D Q 131 .K LRMSG S LRMSG=$C(7)_"Electronic signature not authorized. Missing " 132 .S LRMSG=LRMSG_"PROVIDER key." 133 .D EN^DDIOL(LRMSG,"","!!") 134 .K LRMSG S LREND=1 135 ;Next, check the provider class 136 S LRPRCLSS=$$GET1^DIQ(200,DUZ_",",53.5) 137 ;PROVIDER CL MUST CONTAIN PHYSICIAN, OR CYTOTECH ONLY FOR CY SECTION 138 ;OR DENTIST FOR ORAL AND MAXILLOFACIAL PATHOLOGY 139 S LRMTCH=0 140 I LRPRCLSS'["PHYSICIAN",LRPRCLSS'["DENTIST" D 141 .I LRPRCLSS'["CYTOTECH" S LRMTCH=1 142 .I LRSS'="CY" S LRMTCH=1 143 I LRMTCH=1 D Q 144 .K LRMSG 145 .S LRMSG(1)=$C(7)_"You are not authorized to electronically sign " 146 .S LRMSG(1)=LRMSG(1)_"reports." 147 .S LRMSG(1,"F")="!!" 148 .S LRMSG(2)="PROVIDER CLASS must include PHYSICIAN," 149 .S LRMSG(2,"F")="!" 150 .S LRMSG(3)=" OR CYTOTECHNOLOGIST FOR CY SECTIONS ONLY," 151 .S LRMSG(3,"F")="!" 152 .S LRMSG(4)=" OR DENTIST FOR ORAL AND MAXILLOFACIAL PATHOLOGY." 153 .S LRMSG(4,"F")="!" 154 .D EN^DDIOL(.LRMSG) K LRMSG 155 .S LREND=1 156 ;Finally, check the person class 157 S LRPCSTR=$$GET^XUA4A72(DUZ) ;Supported reference #1625 158 I LRPCSTR<0 D Q 159 .K LRMSG 160 .S LRMSG="PERSON CLASS is inactive or undefined. Electronic signature" 161 .S LRMSG=LRMSG_" is not authorized." 162 .D EN^DDIOL(LRMSG,"","!!") 163 .K LRMSG 164 .S LREND=1 165 S LRPCEXP=+$P(LRPCSTR,"^",6) 166 I LRPCEXP D Q 167 .K LRMSG 168 .S LRMSG="PERSON CLASS has expired. Electronic signature" 169 .S LRMSG=LRMSG_" is not authorized." 170 .D EN^DDIOL(LRMSG,"","!!") K LRMSG 171 .S LREND=1 172 S LRVCDE=$P(LRPCSTR,"^",7),LRMTCH=0 173 ;CORRECT PERSON CLASS SHOULD MATCH PROVIDER CLASS 174 I LRPRCLSS["PHYSICIAN" D 175 .I $E(LRVCDE,1,6)="V11370","123568"[+$E(LRVCDE,7) S LRMTCH=1 176 .I $E(LRVCDE,1,6)="V11371","03"[+$E(LRVCDE,7) S LRMTCH=1 177 .I $E(LRVCDE,1,6)="V18240","124579"[+$E(LRVCDE,7) S LRMTCH=1 178 .I LRVCDE="V182413" S LRMTCH=1 179 I LRPRCLSS["CYTOTECH" D 180 .I LRVCDE="V150113" S LRMTCH=1 181 I LRPRCLSS["DENTIST" D 182 .I LRVCDE="V030503" S LRMTCH=1 183 I 'LRMTCH D 184 .K LRMSG 185 .S LRMSG="Invalid PERSON CLASS. Electronic Signature is not " 186 .S LRMSG=LRMSG_"authorized." 187 .D EN^DDIOL(LRMSG,"","!!") 188 .K LRMSG 189 .S LREND=1 190 Q
Note:
See TracChangeset
for help on using the changeset viewer.