source: FOIAVistA/trunk/r/PROBLEM_LIST-GMPL/GMPLEDIT.m@ 1528

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1GMPLEDIT ; SLC/MKB/KER -- VALM Utilities for Edit sub-list ; 04/15/2002
2 ;;2.0;Problem List;**26**;Aug 25, 1994
3 ;
4 ; External References
5 ; DBIA 10060 ^VA(200
6 ; DBIA 10076 ^XUSEC("GMPL ICD CODE"
7 ; DBIA 10009 YN^DICN
8 ; DBIA 10116 $$SETSTR^VALM1
9 ; DBIA 10117 CLEAN^VALM10
10 ; DBIA 10117 CNTRL^VALM10
11 ; DBIA 10103 $$FMTE^XLFDT
12 ; DBIA 10104 $$REPEAT^XLFSTR
13 ;
14EN ; Init Variables, list array
15 ; Expects GMPIFN IEN of file 900011 (required)
16 ; GMPLNUM Sequence # of Problem Edit (optional)
17 W !!,"Retrieving current data for problem "
18 W $S($G(GMPLNUM):"#"_GMPLNUM_" ",1:"")_"...",! K GMPFLD,GMPORIG
19 ; Set GMPFLD() and GMPORIG() Arrays
20 D GETFLDS^GMPLEDT3(GMPIFN)
21 I '$D(GMPFLD) W !!,"ERROR -- Cannot continue.",! S VALMBCK="Q" G KILL
22INIT ; Build list from GMPFLD()
23 N LCNT,TEXT,I,SP,LINE,STR,NUM,NOTE,ICD
24 S LCNT=1,ICD=$S($D(^XUSEC("GMPL ICD CODE",DUZ)):1,1:0)
25 S SP="" F I=1.11,1.12,1.13,1.15,1.16 S:GMPFLD(I) SP=SP_$P(GMPFLD(I),U,2)_U
26 S:$L(SP) SP=$E(SP,1,$L(SP)-1)
27 K GMPSAVED,GMPREBLD D CLEAN^VALM10
28 D WRAP^GMPLX($P(GMPFLD(.05),U,2),65,.TEXT)
29 ; Line 1
30 S LINE="1 Problem: "_TEXT(1)
31 S ^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,1)
32 I $D(GMPLUSER),GMPARAM("VER"),GMPFLD(1.02)="T" S LINE=$E(LINE,1,12)_"$"_$E(LINE,14,79),^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,13)
33 I TEXT>1 F I=2:1:TEXT S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=" "_TEXT(I)
34 S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=" "
35IN1 ; Line 2
36 S LINE="2 Onset: ",STR=$P(GMPFLD(.13),U,2)
37 S LINE=LINE_$S(STR="":"unknown",1:STR),LCNT=LCNT+1
38 I GMPVA S STR=$S(ICD:7,1:6)_" SC Condition: "_$S(GMPFLD(1.1)="":"unknown",1:$P(GMPFLD(1.1),U,2)),LINE=$$SETSTR^VALM1(STR,LINE,45,34)
39 S ^TMP("GMPLEDIT",$J,LCNT,0)=LINE F I=1,45 D HI(LCNT,I)
40IN2 ; Line 3
41 S LINE="3 Status: "_$P(GMPFLD(.12),U,2),LCNT=LCNT+1
42 I $E(GMPFLD(.12))="A",$L(GMPFLD(1.14)) S LINE=LINE_"/"_$P(GMPFLD(1.14),U,2)
43 I $E(GMPFLD(.12))="I",GMPFLD(1.07) S LINE=LINE_", Resolved "_$P(GMPFLD(1.07),U,2)
44 I GMPVA S STR=$S(ICD:8,1:7)_" Exposure: "_$S('$L(SP):"<None>",1:$P(SP,U)),LINE=$$SETSTR^VALM1(STR,LINE,45,34)
45 S ^TMP("GMPLEDIT",$J,LCNT,0)=LINE F I=1,45 D HI(LCNT,I)
46IN3 ; Line 4
47 S LINE="4 Provider: "_$P(GMPFLD(1.05),U,2),LCNT=LCNT+1
48 I GMPVA,$L(SP,U)>1 S STR=$P(SP,U,2),LINE=$$SETSTR^VALM1(STR,LINE,60,20)
49 S ^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,1)
50 ; Line 5
51 I $E(GMPLVIEW("VIEW"))="S" S LINE="5 Service: "_$P(GMPFLD(1.06),U,2)
52 E S LINE="5 Clinic: "_$P(GMPFLD(1.08),U,2)
53 I GMPVA,$L(SP,U)>2 S STR=$P(SP,U,3),LINE=$$SETSTR^VALM1(STR,LINE,60,20)
54 S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,1) G:'ICD IN4
55 ; Line 6
56 S LINE="6 ICD Code: "_$P(GMPFLD(.01),U,2),LCNT=LCNT+1
57 S ^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,1)
58IN4 ; Line 7/8
59 S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=" "
60 S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)="Comments: "
61 D CNTRL^VALM10(LCNT,1,8,IOUON,IOUOFF)
62 S NUM=$S(GMPVA:7,1:5) S:ICD NUM=NUM+1
63 I GMPFLD(10,0) F I=1:1:GMPFLD(10,0) D
64 . S NUM=NUM+1,NOTE=GMPFLD(10,I)
65 . S LINE=NUM_$E(" ",1,3-$L(NUM))_$J($$EXTDT^GMPLX($P(NOTE,U,5)),8)
66 . I $P(GMPFLD(10,I),U,3)="",$P(GMPORIG(10,I),U,3)'="" S $P(NOTE,U,3)="<Deleted>"
67 . S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=LINE_": "_$P(NOTE,U,3)
68 . D HI(LCNT,1) Q:'$D(GMPLMGR)
69 . S LINE=" "_$P($G(^VA(200,+$P(NOTE,U,6),0)),U)
70 . S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=LINE
71IN5 ; Last Line
72 I $D(GMPFLD(10,"NEW"))>9 S NUM=NUM+1 D
73 . S LINE=NUM_$E(" ",1,3-$L(NUM))_$J($$EXTDT^GMPLX(DT),8)_": "
74 . S I=$O(GMPFLD(10,"NEW",0)),LINE=LINE_GMPFLD(10,"NEW",I)
75 . S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=LINE D HI(LCNT,1)
76 . F S I=$O(GMPFLD(10,"NEW",I)) Q:I'>0 D
77 . . S LINE=" "_GMPFLD(10,"NEW",I)
78 . . S LCNT=LCNT+1,^TMP("GMPLEDIT",$J,LCNT,0)=LINE
79 S VALMCNT=LCNT,^TMP("GMPLEDIT",$J,0)=NUM_U_LCNT,VALMSG=$$MSG^GMPLEDT3
80 Q
81 ;
82HI(LINE,COL) ; Hi-lite #
83 D CNTRL^VALM10(LINE,COL,3,IOINHI,IOINORM)
84 Q
85 ;
86HDR ; Header code
87 N LASTMOD,PAT S PAT=$P(GMPDFN,U,2)_" ("_$P(GMPDFN,U,3)_")"
88 S LASTMOD=$P(^AUPNPROB(GMPIFN,0),U,3)
89 S LASTMOD="Last Updated: "_$$FMTE^XLFDT(LASTMOD)
90 S VALMHDR(1)=PAT_$$REPEAT^XLFSTR(" ",(79-$L(PAT)-$L(LASTMOD)))_LASTMOD
91 Q
92 ;
93HELP ; Help code
94 N X,CNT S CNT=+$G(^TMP("GMPLEDIT",$J,0))
95 W !!?4,"You may change one or more of the above listed values describing"
96 W !?4,"this problem by entering its display number (1-"_CNT_") at the prompt;"
97 W !?4,"you may then enter a new value, or '@' to delete an existing value."
98 W !!?4,"Enter RM to remove this problem from the patient's list completely,"
99 W !?4,"SC to save your changes, or Q to simply return to the problem list."
100 W:VALMCNT>11 !?4,"Enter '+' to see more information, as in the problem list."
101 W !!,"Press <return> to continue ... " R X:DTIME
102 S VALMSG=$$MSG^GMPLEDT3,VALMBCK=$S(VALMCC:"",1:"R")
103 Q
104 ;
105EXIT ; Exit code
106 N DIFFRENT,% G:$D(GMPSAVED) KILL
107 S DIFFRENT=$$EDITED^GMPLEDT2 I 'DIFFRENT G KILL
108 W $C(7),!!,">>> THIS PROBLEM HAS CHANGED!!"
109EX1 ; Ask to Save Changes on Exit
110 W !?5,"Do you want to save these changes"
111 S %=1 D YN^DICN G:(%<0)!(%=2) KILL I %=0 D G EX1
112 . W !!?5,"Enter YES or <return> to save the current values listed above"
113 . W !?5,"describing this problem; enter NO to exit without saving.",!
114 W !!,"Saving ..." D EN^GMPLSAVE W " done."
115KILL ; Clean-up
116 S CNT=+$G(^TMP("GMPLEDIT",$J,0))
117 F I=1:1:CNT K XQORM("KEY",I)
118 D CLEAN^VALM10 K XQORM("KEY","$")
119 K GMPFLD,GMPORIG,GMPQUIT,DUOUT,DTOUT,I,CNT
120 Q
Note: See TracBrowser for help on using the repository browser.