source: FOIAVistA/trunk/r/MEDICINE-MC/MCARGES.m@ 1671

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

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1MCARGES ;WISC/TJK-SCREEN ENTER/EDIT-ENDOSCOPY,HEMATOLOGY,PACEMAKER ;4/7/97 14:14
2 ;;2.3;Medicine;**8,15,16**;09/13/1996
3START ;
4 K EXIT,MCDEMO,MCESFL S MCESFL=1
5 D ENTER I '$D(MCFILE)!('$D(MCARGDA)) D EXIT Q
6 I '$D(^MCAR(MCFILE,MCARGDA,0)),$D(MCBACK) D BACKSS^MCESEDT K MCBACK S EXIT=1
7 K:'$D(^MCAR(MCFILE,MCARGDA,0)) MCESFL D EXIT
8 Q
9ENTER ; edit a GI procedure record and display/edit history if selected
10 D DPT^MCARGE I $D(EXIT) Q
11 I MCARCODE="G"!(MCARCODE="P") S MCDEMO=1 D DEMO^MCARGE
12 ;if user wants to edit patient history in patient file
13 I $D(MCDEMO) D
14 .S DJSC="MCGDEM",DIC="MCAR(690,",DJDN=DFN,DIC(0)="EQ" D EN^MCARD
15 .S:$D(DUOUT) EXIT=1
16 .I '$D(EXIT),$D(^DIC(120.8)) N VADM D EN2^GMRAPEM0
17 .K MCDEMO
18 .;restore the procedure record number after patient lookup in 690
19 .S MCARGDA=+$G(MCARDA)
20 Q:$D(EXIT) D EDIT Q
21EDIT D:MCARCODE="G" SETVAR^MCARGE K DIC
22 S DJSC=MCEPROC
23 S DJDN=MCARGDA,DIC="^MCAR("_MCFILE_","
24 S DIC(0)="EQ"
25 D IN^MCEO
26 I $D(DTOUT)!$D(DUOUT) S EXIT=1 Q
27 D EN^MCARD
28 I $D(DUOUT) S EXIT=1 Q
29 I '$D(^MCAR(MCFILE,MCARGDA,0)) S EXIT=1 Q
30 S MCDFLAG="" I MCARGNAM'="NON-ENDO" D ^MCARGD
31 D OUT^MCEO
32 Q
33CONSULT ;
34 K DIC S MCDFLAG="" D CONSULT^MCARGE
35 G EXIT:$D(DTOUT),EXIT:$D(DUOUT) I $D(Y),Y<0 G EXIT
36 S DJSC=$S($G(MCBS)=1:"MCCONSULTBR",1:"MCCONSULT")
37 S DIC="^MCAR(699.5,",DJDN=MCARGDA,DIC(0)="EQ",MCFILE=699.5 D IN^MCEO G EXIT:$D(DTOUT)!$D(DUOUT) D EN^MCARD,OUT^MCEO
38EXIT ;
39 I '$D(DTOUT),'$D(DUOUT),$D(MCESFL),$D(MCFILE),$D(MCARGDA),MCESON D:MCESFL=0 ESRC^MCESSCR(MCFILE,MCARGDA)
40 K AV,MULTI,EXIT,X,MCPRO,MCEPROC,MCPATNM D EXIT^MCARGE
41 Q
42GENEX(MCARGDA,GENEX) ;Check and resolve non-associated procedures
43 I ('$P(^MCAR(699.5,MCARGDA,0),U,2)!'$P(^(0),U,6)) S DIK="^MCAR(699.5,",DA=MCARGDA,GENEX=1 D ^DIK Q
44 Q
45GENERIC ;Generic Medicine Enter/Edit
46 W !,"GENERIC EDIT"
47 N GENEX S GENEX=0
48 D MCEPROC^MCARE,^MCAREH
49 S DIC="^MCAR(699.5,",DIC(0)="AEQLM",(DLAYGO,DIDEL,MCFILE)=699.5,DIC("S")="I '$P(^MCAR(699.5,+Y,0),U,3)"
50 S DR=".01;.02;.05" D ^DIC G EXIT:Y<0 S MCARGDA=+Y,MCESFL=0
51 D GENEX(MCARGDA,.GENEX) G:GENEX EXIT
52 ; allow user to edit .01 field
53 I MCESON,("125"'[$$ESTONUM^MCESSCR(MCFILE,MCARGDA)) D ESRC^MCESSCR(MCFILE,.MCARGDA) G:$D(MCBACK) SETUP K DIC Q
54SUPS S DIE="^MCAR(699.5,",DA=MCARGDA,DR=".01;.02;.05" D ^DIE
55 I $D(DA) D GENEX(MCARGDA,.GENEX) G:GENEX EXIT
56 I $D(DTOUT)!$D(DUOUT)!'$D(DA) G EXIT
57 S MCARGNUM=$P(^MCAR(699.5,MCARGDA,0),U,6),DFN=$P(^(0),U,2)
58 S DJSC=MCEPROC
59 S MCARGNAM=$P(^MCAR(699.5,MCARGDA,0),U),DJDN=MCARGDA,DIC="^MCAR(699.5,",DIC(0)="EQ"
60 S MCHOLD=MCARGDA
61 ;D IN^MCEO G EXIT:$D(DTOUT)!$D(DUOUT) D EN^MCARD S MCARGDA=MCHOLD D GENEX(MCARGDA,.GENEX) K MCHOLD G:GENEX EXIT
62 D IN^MCEO G EXIT:$D(DUOUT) D EN^MCARD S MCARGDA=MCHOLD D GENEX(MCARGDA,.GENEX) K MCHOLD ;MC*2.3*8
63 D OUT^MCEO,QTASK^MCPARAM G EXIT
64 ;
65HEM S DIC="^MCAR(694,",DIC(0)="AEQLM",(DLAYGO,DIDEL,MCFILE)=694 D ^DIC G EXIT:Y<0
66 S MCARGDA=+Y I $D(DTOUT),('$P(^MCAR(694,+Y,0),U,2))!('$P(^(0),U,3)) S DIK="^MCAR(694,",DA=MCARGDA D ^DIK W "??" G EXIT
67 S MCARGNUM=$P(^MCAR(694,MCARGDA,0),U,3),DFN=$P(^(0),U,2),DJSC=MCEPROC
68 S MCARGNAM=$P(^MCAR(697.2,MCARGNUM,0),U),DJDN=MCARGDA,DIC="^MCAR(694,",DIC(0)="EQ"
69 G EXIT:$D(DTOUT)!$D(DUOUT) D EN^MCARD,QTASK^MCPARAM G EXIT
70MULTI K MULTI S MULTI="",MCARGDA=-1 D GEN G EXIT:$D(DTOUT),EXIT:$D(DUOUT),EXIT:'$G(MCARGDA)
71 S AV=$G(^MCAR(698,MCARGDA,0)),DFN=$P(AV,U,2),AV=$P(AV,U,7) G EXIT:AV=""!("AV"'[AV)
72 K DIC S DIC("S")="I $P(^(0),U,2)=DFN" D ALEAD:AV["A" G EXIT:$D(DUOUT)!($D(DTOUT))
73 K DIC S DIC("S")="I $P(^(0),U,2)=DFN" D VLEAD:AV["V" G EXIT
74GEN S MCFILE=698
75 S MCPRO="GEN.IMPL." D MCEPROC^MCARE S MCARGNUM=MCARGNAM,MCARGNAM="GENERATOR IMPLANT" G LOOK
76VLEAD S MCFILE=698.1
77 D:$D(MULTI) LAST^MCARPACE
78 S MCPRO="V-LEAD IMP" D MCEPROC^MCARE S MCARGNUM=MCARGNAM,MCARGNAM="VENTRICAL LEAD IMPLANT" G LOOK
79ALEAD S MCFILE=698.2
80 D:$D(MULTI) LAST^MCARPACE
81 S MCPRO="A-LEAD IMP" D MCEPROC^MCARE S MCARGNUM=MCARGNAM,MCARGNAM="ATRIAL LEAD IMPLANT" G LOOK
82DEMO ;
83 W @IOF,!!!,"DEMOGRAPHIC INFORMATION *** SCREEN EDIT ***",!!!
84 D
85 .N DLAYGO
86 .S DLAYGO=690,DIC="^MCAR(690,",DIC(0)="AEQLM",DIC("B")=$G(MCPATNM)
87 .D ^DIC
88 .Q
89 G EXIT:Y<0
90 S (DJDN,MCARGDA)=+Y,DJSC="MCPACEDEMO",DIC(0)="EQ" D EN^MCARD
91 ;get new default patient name
92 S MCX=$$VALUE^MCENDIQ1(690,MCARGDA,.01)
93 I MCX'="" S MCPATNM=MCX
94 G EXIT
95LOOK ;
96 W @IOF,!!!,MCARGNAM," PROCEDURES *** SCREEN EDIT ***",!!!
97 S DIC="^MCAR("_MCFILE_",",DIC(0)="AEQLM"
98 S DIC("A")="Enter patient name, or date and time: "
99 ;S DIC("B")=$G(MCPATNM)
100 S (DLAYGO,DIDEL)=MCFILE D ^DIC G EX:Y<0
101 ;
102 ; NOTE: next line must define DFN for Order Entry to work
103 S MCARGDA=+Y,DFN=$P($G(^MCAR(MCFILE,MCARGDA,0)),U,2) I $D(DTOUT),'DFN S DIK=DIC,DA=MCARGDA D ^DIK G EX
104 S MCARGNUM=$O(^MCAR(697.2,"BA",MCARGNAM,0))
105 S DJSC=MCEPROC
106 S MCARGNAM=$P(^MCAR(697.2,MCARGNUM,0),U),DJDN=MCARGDA,DIC(0)="EQ" D IN^MCEO G EXIT:$D(DTOUT)!$D(DUOUT) D EN^MCARD,OUT^MCEO
107 ;get new default patient name
108 S MCX=$$VALUE^MCENDIQ1(MCFILE,MCARGDA,1)
109 I MCX'="" S MCPATNM=MCX
110EX Q:$D(MULTI) G EXIT
111SETUP ; If the record is superseded, the user will be allow to edit the superseded record.
112 S Y=MCY,DA=Y,Y(0)=MCY(0),Y(0,0)=MCY(0,0),MCARGDA=+MCY K MCY,DTOUT,DIROUT,DUOUT,DIC
113 G SUPS
Note: See TracBrowser for help on using the repository browser.