source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LROSPLG.m@ 1226

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

initial load of WorldVistAEHR

File size: 2.7 KB
RevLine 
[613]1SROSPLG ;B'HAM ISC/ADM - MOVE SP DATA FROM SURGICAL RECORD ;4/12/94 08:54
2 ;;3.0; Surgery ;**28**;24 Jun 93
3 Q:$P(^LR(LRDFN,0),"^",2)'=2 D END
4 S:'$D(DFN) DFN=$P(^LR(LRDFN,0),"^",3) D DEM^VADPT S PNM=VADM(1),SSN=VA("PID")
5 S X1=DT,X2=-7 D C^%DTC S SREND=9999999.999999-X D NOW^%DTC S SRDT=9999999.999999-%
6 W !!,"Checking surgical record for this patient...",!
7 S CNT=0 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!(SRDT>SREND) S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!$D(SRTN) D LIST
8 I CNT=0 W !,"No operations on record in the past 7 days for this patient.",! D END Q
9 I CNT=1 K DIR W ! S DIR("A",1)="Only one operation on record in the past 7 days.",DIR("A")="Is this the correct operation for the specimen(s) (Y/N)",DIR(0)="Y" D ^DIR I $D(DTOUT)!$D(DUOUT)!'Y D NOOP Q
10 I CNT=1,Y=1 S SRTN=+SRCASE(1) D DOC Q
11OPT K DIR S DIR("?",1)="Enter the number of the operation associated with the specimen(s)",DIR("?")="or press RETURN to bypass operation selection."
12 W ! S DIR("A")="Select operation associated with the specimen(s)",DIR(0)="NO^1:"_CNT
13 D ^DIR I $D(DTOUT)!$D(DUOUT)
14 I +Y S SRTN=+SRCASE(+Y),CNT=+Y
15NOOP I '$D(SRTN) W !!,"No operation selected.",! D END Q
16DOC S SRDOC=$S($P($G(^SRF(SRTN,"NON")),"^")="Y":$P(^("NON"),"^",6),1:$P($G(^SRF(SRTN,.1)),"^",4)) Q
17DISP I $D(SRTN) S SROP=SRTN,SRSDATE=$P(^SRF(SRTN,0),"^",9) D ^SROSPLG2
18END K CNT,DIR,DR,I,J,K,LOOP,M,MM,MMM,SR,SRABORT,SRCASE,SRD,SRDOC,SRDT,SREND,SRJ,SRK,SRLONG,SRN,SROP,SROPER,SROPERS,SROPS,SROTHER,SRSCAN,SRSDATE,SRSTAT,SRSTATUS,SRTN,VA,VADM,VAERR,X,%
19 Q
20LIST ; list cases
21 S SRSCAN=1 I $P($G(^SRF(SROP,.2)),"^",10)!$P($G(^SRF(SROP,.2)),"^",12)!($P($G(^SRF(SROP,"NON")),"^")="Y") K SRSCAN
22 I $D(SRSCAN),$D(^SRF(SROP,30)),$P(^(30),"^") Q
23 I $D(SRSCAN),$D(^SRF(SROP,31)),$P(^(31),"^",8) Q
24 I $D(^SRF(SROP,37)),$P(^(37),"^") Q
25 S CNT=CNT+1,SRSDATE=$P(^SRF(SROP,0),"^",9) W !,CNT_". "
26CASE W $E(SRSDATE,4,5)_"-"_$E(SRSDATE,6,7)_"-"_$E(SRSDATE,2,3)
27 S SROPER=$P(^SRF(SROP,"OP"),"^") I $O(^SRF(SROP,13,0)) S SROTHER=0 F I=0:0 S SROTHER=$O(^SRF(SROP,13,SROTHER)) Q:'SROTHER D OTHER
28 S SROPER="Case #"_SROP_" >> "_SROPER D ^SROSPLG1 K SROPS,MM,MMM S:$L(SROPER)<65 SROPS(1)=SROPER I $L(SROPER)>64 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
29 W ?14,SROPS(1) I $D(SROPS(2)) W !,?14,SROPS(2) I $D(SROPS(3)) W !,?14,SROPS(3) W:$D(SROPS(4)) !,?14,SROPS(4)
30 S SRCASE(CNT)=SROP_"^"_SRDT
31 Q
32OTHER ; other operations
33 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,SROTHER,0),"^"))>235 S SRLONG=0,SROTHER=999,SROPERS=" ..."
34 I SRLONG S SROPERS=$P(^SRF(SROP,13,SROTHER,0),"^")
35 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
36 Q
37LOOP ; break procedures
38 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<65 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
39 Q
Note: See TracBrowser for help on using the repository browser.