source: WorldVistAEHR/trunk/r/SURGERY-SR/SROACOM.m@ 1444

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

revised back to 6/30/08 version

File size: 4.0 KB
Line 
1SROACOM ;BIR/MAM - COMPLETE ASSESSMENT ;02/08/07
2 ;;3.0; Surgery ;**38,55,63,65,88,93,95,102,100,125,134,142,160**;24 Jun 93;Build 7
3 I '$D(SRTN) Q
4 S (SRSFLG,SRSOUT,SROVER)=0,SRA=$G(^SRF(SRTN,"RA")),Y=$P(SRA,"^") I Y'="I" W !!,"This assessment has a "_$S(Y="C":"'COMPLETE'",1:"'TRANSMITTED'")_" status.",!!,"No action taken." G END
5 I $P(SRA,"^",2)="N",$P(SRA,"^",6)="Y" D CHK^SROAUTL
6 I $P(SRA,"^",2)="N",$P(SRA,"^",6)="N" D CHK^SROAUTL3
7 I $P(SRA,"^",2)="C" D CHK^SROAUTLC
8 S SRFLD="" I $O(SRX(SRFLD))'="" D LIST
9 I $P(SRA,"^",2)="C" D CHCK G:SRSOUT END
10YEP I '$P($G(^SRO(136,SRTN,10)),"^")!('$P($G(^SRO(136,SRTN,0)),"^",2))!('$P($G(^SRO(136,SRTN,0)),"^",3)) W !!,?6,"The coding for Procedure and Diagnosis is not complete."
11 W ! S SRFLD="" K DIR S DIR("A")="Are you sure you want to complete this assessment ? ",DIR("B")=$S($O(SRX(SRFLD)):"NO",1:"YES"),DIR(0)="YA"
12 S DIR("?",1)="Enter YES to complete this assessment, or enter NO to leave the status",DIR("?")="unchanged." D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 G END
13 I 'Y W !!,"No action taken." G END
14 I $$LOCK^SROUTL(SRTN) D COMPLT Q
15 E W !!,"No action taken." G END
16 Q
17COMPLT W !!,"Updating the current status to 'COMPLETE'..." K DR,DIE S DA=SRTN,DIE=130,DR="235///C" D ^DIE K STATUS
18 I $P(SRA,"^",5)="" K DR,DIE S DA=SRTN,DIE=130,DR="272///"_DT D ^DIE K STATUS
19 I $P(SRA,"^",2)="C" K DA,DIE,DIK,DR S DIK="^SRF(",DIK(1)=".232^AQ",DA=SRTN D EN1^DIK K DA,DIK
20 D UNLOCK^SROUTL(SRTN)
21PRINT W !!,"Do you want to print the completed assessment ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 Q
22 S SRYN=$E(SRYN) S:SRYN="" SRYN="Y" I "Nn"[SRYN S SRSOUT=1 Q
23 I "Yy"'[SRYN W !!,"Enter <RET> to print the completed assessment, or 'NO' to return to the menu." G PRINT
24 W ! K %ZIS,IO("Q"),POP S %ZIS("A")="Print the Completed Assessment on which Device: ",%ZIS="Q" D ^%ZIS I POP S SRSOUT=1 Q
25 I $D(IO("Q")) K IO("Q") S ZTDESC="Completed Surgery Risk Assessment",(ZTSAVE("SRSITE*"),ZTSAVE("SRTN"))="",ZTRTN="EN^SROACOM" D ^%ZTLOAD S SRSOUT=1 G END
26 D EN,END
27 Q
28EN U IO S SRABATCH=1 D ^SROAPAS Q
29END I 'SRSOUT,$E(IOST)'="P" D RET
30 W @IOF I $E(IOST)="P" D ^%ZISC W @IOF
31 D ^SRSKILL K SRSFLG
32 Q
33LIST W @IOF,!,"This assessment is missing the following items:",! S SRZ="",SRCNT=1
34 ;I '$P($G(^SRO(136,SRTN,10)),"^")!('$P($G(^SRO(136,SRTN,0)),"^",2))!('$P($G(^SRO(136,SRTN,0)),"^",3)) W !,?6,"The coding for Procedure and Diagnosis is",!,?6,"not complete.",!
35 F S SRZ=$O(SRX(SRZ)) Q:SRZ="" D:$Y+5>IOSL RET Q:SRSOUT W !,?5,$J(SRCNT,2)_". "_$P(SRX(SRZ),"^") S SRCNT=SRCNT+1
36 S SRSOUT=0 W ! K DIR S DIR(0)="Y",DIR("A")="Do you want to enter the missing items at this time",DIR("B")="NO" D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
37 Q:'Y I $$LOCK^SROUTL(SRTN) D PRT,UNLOCK^SROUTL(SRTN)
38 Q
39PRT S SRSOUT=0,(SRMD,SRMD1)="",SRCNT=0 F S SRMD=$O(SRX(SRMD)) Q:SRMD="" S SRMD1=$P(SRX(SRMD),"^",2) D Q:$G(SRSFLG)
40 .I $E(SRMD,1,10)="ANESTHESIA" D ANES Q
41 .I $E(SRMD,1,6)="POSTOP"!($E(SRMD,1,6)="SEPSIS") D POST^SROCMPS Q
42 .I SRMD=240 D FUNCT Q
43 .I SRMD=492 D FUNCTI^SROAPRE Q
44 .I SRMD=485 W @IOF,! D PRIOR^SROACL2 K DR,DIE S DA=SRTN,DR="485///"_$S(X="@":"@",1:$P(Y,"^")),DIE=130 D ^DIE K DR S:$D(Y) SRSFLG=1 Q
45 .K DR,DIE S DA=SRTN,DIE=130,DR=$S($G(SRMD1):SRMD1,1:SRMD)_"T" D ^DIE K DR I $D(Y) S SRSFLG=1
46 S:'$G(SRSOUT) SRSOUT=0
47 Q
48FUNCT I $P($G(^SRF(SRTN,"RA")),"^",2)="C" D FUNCT^SROACLN Q
49 D FUNCTJ^SROAPRE
50 Q
51ANES K DR,DIE,DA S DA=SRTN,DR=.37,DR(2,130.06)=".01T;.05T;42T",DIE=130 D ^DIE S:$D(Y) SRSFLG=1 K DR
52 Q
53CHCK ; cardiac checks added by SR*3*93
54 N SRADM,SRDIS,SRISCH,SRCPB,SRRET S SRRET=0,X=$G(^SRF(SRTN,208)),SRADM=$P(X,"^",14),SRDIS=$P(X,"^",15),X=$G(^SRF(SRTN,206)),SRISCH=$P(X,"^",36),SRCPB=$P(X,"^",37)
55 I SRADM,SRDIS,SRADM'<SRDIS W !!," *** NOTE: Discharge Date precedes Admission Date!! Please check. ***" S SRRET=1,SRX(418)=""
56 I SRISCH,SRCPB,SRISCH>SRCPB W !!," *** NOTE: Ischemic Time is greater than CPB Time!! Please check. ***",! S SRRET=1,SRX(450)=""
57 I SRRET W ! K DIR S DIR(0)="E" D ^DIR K DIR S:$D(DTOUT)!$D(DUOUT) SRSOUT=1 W !
58 Q
59RET W !! K DIR S DIR(0)="E" D ^DIR K DIR W @IOF I $D(DTOUT)!$D(DUOUT) S SRSOUT=1
60 Q
61PAGE I $E(IOST)'="P" D RET Q
62 W @IOF,!!!
63 Q
Note: See TracBrowser for help on using the repository browser.