source: FOIAVistA/trunk/r/SURGERY-SR/SRONOP1.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1SRONOP1 ;BIR/MAM - NON-O.R. PROCEDURES ;06/15/05
2 ;;3.0; Surgery ;**44,56,58,48,67,70,88,100,142**;24 Jun 93
3 S X=$P($G(VADM(6)),"^") I X D I SRSOUT D ^SRSKILL G ^SRONOP
4 .S SRDEATH=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) W @IOF,!,?1,VADM(1)_" "_VA("PID")_" * Died "_SRDEATH_" *"
5 .W !!,$C(7) K DIR S DIR("A",1)=">>> The patient you have selected died on "_SRDEATH_"."
6 .S DIR("A")=" Are you sure this is the correct patient ? ",DIR("B")="NO",DIR(0)="YA" D ^DIR K DIR
7 .I 'Y!$D(DTOUT)!$D(DUOUT) S SRSOUT=1
8 W @IOF,!,"Entering a new non-O.R. procedure for "_SRNM_".",!!
9OP ; principal procedure
10 W ! K DIR S DIR(0)="130,26A",DIR("A")="Enter the Procedure: " D ^DIR K DIR I $D(DTOUT)!(X="^") S SRSOUT=1 G END
11 S SROPER=Y
12DATE W ! K %DT S %DT="AEX",%DT("A")="Select the Date of the Procedure: " D ^%DT I X="" W !!,"The Date of the Procedure MUST be entered." G DATE
13 I Y<0!$D(DTOUT) S SRSOUT=1 G END
14 S SRSDATE=+Y
15DOC W ! K DIR S DIR("A")="Provider",DIR(0)="130,123" D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 G END
16 S SRSDOC=+Y
17SPEC W ! K DIR S DIR("A")="Medical Specialty",DIR(0)="130,125" D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 G END
18 S SRSPEC=+Y
19SUMM ; dictated summary expected?
20 N SREXPT W ! K DIR S DIR("A")="Will a summary of this procedure be dictated? (Y/N)"
21 S DIR("?",1)="This field indicates if the provider will dictate a summary of this",DIR("?",2)="procedure to be electronically signed. Enter YES if a dictated summary"
22 S DIR("?")="is expected. Enter NO or leave blank if no summary is expected.",DIR(0)="Y" D ^DIR K DIR
23 I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 G END
24 S SREXPT=Y
25 K DIC,DO,DA,DD,DINUM,SRTN S X=DFN,DIC="^SRF(",DIC(0)="L",DLAYGO=130 D FILE^DICN K DD,DO,DIC,DLAYGO S SRTN=+Y
26 N SRLCK S SRLCK=$$LOCK^SROUTL(SRTN) I 'SRLCK S Q3("VIEW")=""
27 K DR S DIE=130,DR="120///"_SRSDATE_";26///"_SROPER_";118///Y;123////"_SRSDOC_";125////"_SRSPEC_";1004////"_SREXPT,DA=SRTN D ^DIE K DR,DA,DIE S ^SRF(SRTN,8)=SRSITE("DIV")
28 D RT S SRSOUT=1,SRN=$E(SRNM,1,20),Q3(1)="** NON-O.R. PROCEDURE ** CASE #"_SRTN_" "_SRN_" "
29 S SRDTIME=DTIME,DTIME=3600,ST="NON-O.R. PROCEDURE",DIE=130,DR="[SRNON-OR]",DA=SRTN D ^SRCUSS S DTIME=SRDTIME D ^SROPCE1 S SRSOUT=0
30 S SRSOP=SROPER,SRL=$P(^SRF(SRTN,"NON"),"^",2) S ORL=$S(SRL:SRL_";SC(",1:"") D ^SROERR
31 D ^SRSKILL I $G(SRLCK) D UNLOCK^SROUTL(SRTN)
32 Q
33END I SRSOUT W !!,"No action taken.",!!,"Press RETURN to continue " R X:DTIME
34 D ^SRSKILL K SRTN W @IOF
35 Q
36RT ; start RT logging
37 I $D(XRTL) S ZRTN="SRONOP1" D T0^%ZOSV
38 Q
39DEL ; delete procedure
40 W !!,"Are you sure that you want to remove this procedure from your ",!,"records ? NO// " R X:DTIME I '$T!(X="^") W !!,"No action taken..." Q
41 S X=$E(X) S:X="" X="N" I "YyNn"'[X W !!,"Enter RETURN or 'NO' if this procedure should remain on file. Enter 'YES'",!,"to delete this procedure."
42 I "Nn"[X W !!,"No action taken." Q
43 I $P($G(^SRF(SRTN,"TIU")),"^",3) D EN^DDIOL("This case can't be deleted, there is a Procedure Report (Non-O.R.) associated with it.",,"!!,?2,$C(7)") Q
44 W !!,"Deleting procedure..."
45 S SRX=$P($G(^SRF(SRTN,0)),"^",15) I SRX S SRVSIT=SRX D DEL^SROPCEP ; delete visit
46 I $D(^SRO(136,SRTN,0)) S DA=SRTN,DIK="^SRO(136," D ^DIK K DA,DIK ; remove entry in file 136
47 D DEL^SROERR S DA=SRTN,DIK="^SRF(" D ^DIK
48 Q
Note: See TracBrowser for help on using the repository browser.