| 1 | GMPLEDT4 ; SLC/MKB -- Problem List Edit actions cont ;3-7-96 2:00pm
 | 
|---|
| 2 |  ;;2.0;Problem List;**5**;Aug 25, 1994
 | 
|---|
| 3 | TERM ; edit field 1.01
 | 
|---|
| 4 |  N PROB,TERM,ICD,DUP,Y
 | 
|---|
| 5 | T1 W !,"PROBLEM: "_$P(GMPFLD(.05),U,2)_"//"
 | 
|---|
| 6 |  R PROB:DTIME S:'$T DTOUT=1 I $D(DTOUT)!(PROB="^") S GMPQUIT=1 Q
 | 
|---|
| 7 |  I PROB?1"^".E D JUMP^GMPLEDT3(PROB) Q:$D(GMPQUIT)!($G(GMPLJUMP))  K:$G(GMPIFN) GMPLJUMP G T1
 | 
|---|
| 8 |  Q:PROB=""  Q:PROB=$P(GMPFLD(.05),U,2)  ; no change
 | 
|---|
| 9 |  I PROB["?" D  G T1
 | 
|---|
| 10 |  . W !!?4,"Enter a description of this problem, up to 80 characters.",!
 | 
|---|
| 11 |  I PROB="@",'+$G(GMPIFN) D  S GMPQUIT=1 Q
 | 
|---|
| 12 |  .W !!?5,$C(7),$C(7),"This problem has not yet been saved."
 | 
|---|
| 13 |  .W !?5,"Enter <Q>uit and it will not be added to the list.",!!
 | 
|---|
| 14 |  .K DIR S DIR("A")="Press RETURN to redisplay the problem text"
 | 
|---|
| 15 |  .S DIR(0)="E" D ^DIR K DIR
 | 
|---|
| 16 |  I PROB="@" D DELETE^GMPLEDT2 S:VALMBCK="Q" GMPQUIT=1 Q:$D(GMPQUIT)  G T1
 | 
|---|
| 17 | T2 ; new text -- pass to look-up
 | 
|---|
| 18 |  I '$D(GMPLUSER)!($D(GMPLUSER)&('GMPARAM("CLU"))) S GMPFLD(1.01)="",GMPFLD(.05)=U_PROB Q
 | 
|---|
| 19 |  D SEARCH^GMPLX(.PROB,.Y,"PROBLEM: ","1") ; pass to CLU
 | 
|---|
| 20 |  S TERM=$G(Y),ICD=$G(Y(1)) I +TERM'>0 S GMPQUIT=1 Q
 | 
|---|
| 21 |  S DUP=$$DUPL^GMPLX(+GMPDFN,+TERM,PROB)
 | 
|---|
| 22 |  I DUP,'$$DUPLOK^GMPLX(DUP) W ! G T1
 | 
|---|
| 23 |  S GMPFLD(1.01)=$S(+TERM>1:TERM,1:""),GMPFLD(.05)=U_PROB
 | 
|---|
| 24 |  S GMPFLD(.01)=$S($L(ICD):$O(^ICD9("AB",ICD_" ",0))_U_ICD,1:"")
 | 
|---|
| 25 |  S:'GMPFLD(.01) GMPFLD(.01)=$$NOS^GMPLX
 | 
|---|
| 26 |  Q
 | 
|---|
| 27 |  ;
 | 
|---|
| 28 | TEXT(DFLT) ; Enter/edit provider narrative text (no lookup)
 | 
|---|
| 29 |  N DIR,X,Y
 | 
|---|
| 30 |  S DIR(0)="FAO^2:80",DIR("A")="PROBLEM: " S:$L(DFLT) DIR("B")=DFLT
 | 
|---|
| 31 |  S DIR("?")="Enter a description of this problem, up to 80 characters."
 | 
|---|
| 32 |  D ^DIR S:$D(DTOUT)!(X="^") Y="^" S:'$L(DFLT)&(X="") Y="^"
 | 
|---|
| 33 |  Q Y
 | 
|---|
| 34 |  ;
 | 
|---|
| 35 | NTES ; Edit existing note, display # in XQORNOD(0)
 | 
|---|
| 36 |  N NUM,NOTE,X,Y,PROMPT,DEFAULT,NT
 | 
|---|
| 37 |  S NT=$S(GMPVA:7,1:5) S:$D(^XUSEC("GMPL ICD CODE",DUZ)) NT=NT+1
 | 
|---|
| 38 |  S NUM=+$P(XQORNOD(0),U,3)-NT Q:NUM'>0
 | 
|---|
| 39 |  S NOTE=GMPFLD(10,NUM),DEFAULT=$P(NOTE,U,3)
 | 
|---|
| 40 |  S PROMPT="NOTE "_$$EXTDT^GMPLX($P(NOTE,U,5))_": "
 | 
|---|
| 41 |  D EDNOTE Q:$D(GMPQUIT)
 | 
|---|
| 42 |  S $P(GMPFLD(10,NUM),U,3)=Y
 | 
|---|
| 43 |  Q
 | 
|---|
| 44 |  ;
 | 
|---|
| 45 | EDNOTE ; Edit note text given PROMPT,DEFAULT (returns X,Y)
 | 
|---|
| 46 |  N DIR S DIR(0)="FAO^1:100",DIR("A")=PROMPT
 | 
|---|
| 47 |  S:$L(DEFAULT) DIR("B")=DEFAULT
 | 
|---|
| 48 |  S DIR("?",1)="Enter any text you wish appended to this problem, up to 60 characters"
 | 
|---|
| 49 |  S DIR("?")="in length.  You may append as many comments to a problem as you wish."
 | 
|---|
| 50 | ED1 D ^DIR I $D(DTOUT)!(Y="^") S GMPQUIT=1,Y="" Q
 | 
|---|
| 51 |  I Y?1"^".E D JUMP^GMPLEDT3(Y) Q:$D(GMPQUIT)!($G(GMPLJUMP))  K:$G(GMPIFN) GMPLJUMP G ED1
 | 
|---|
| 52 |  Q:Y=DEFAULT  I X="@" D  Q:$D(GMPQUIT)!(Y="")  G ED1
 | 
|---|
| 53 |  . N DIR,X S DIR(0)="YAO",DIR("B")="NO"
 | 
|---|
| 54 |  . S DIR("A")="   Are you sure you want to delete this comment? "
 | 
|---|
| 55 |  . S DIR("?")="   Enter YES to completely remove this comment from this patient's problem."
 | 
|---|
| 56 |  . W $C(7) D ^DIR I $D(DUOUT)!($D(DTOUT)) S GMPQUIT=1,Y="" Q
 | 
|---|
| 57 |  . S:Y Y=""
 | 
|---|
| 58 |  I $L(X)>60 W !!,"Text may not exceed 60 characters!",!,$C(7) S DIR("B")=$E(X,1,60) G ED1
 | 
|---|
| 59 |  S Y=X
 | 
|---|
| 60 |  Q
 | 
|---|
| 61 |  ;
 | 
|---|
| 62 | RESOLVED ; edit field 1.07
 | 
|---|
| 63 |  N X,Y,PROMPT,HELPMSG,DEFAULT,ONSET S ONSET=+$G(GMPFLD(.13))
 | 
|---|
| 64 |  S DEFAULT=$G(GMPFLD(1.07)),PROMPT="DATE RESOLVED: "
 | 
|---|
| 65 |  S HELPMSG="Enter the date this problem became resolved or inactive, as precisely as known."
 | 
|---|
| 66 | R1 D DATE^GMPLEDT2 Q:$D(GMPQUIT)!($G(GMPLJUMP))
 | 
|---|
| 67 |  I Y,ONSET,Y<ONSET W !!,"Date Resolved cannot be prior to the Date of Onset!",$C(7) G R1
 | 
|---|
| 68 |  S GMPFLD(1.07)=Y S:Y'="" GMPFLD(1.07)=GMPFLD(1.07)_U_$$EXTDT^GMPLX(Y)
 | 
|---|
| 69 |  Q
 | 
|---|
| 70 |  ;
 | 
|---|
| 71 | PRIORITY ; edit field 1.14
 | 
|---|
| 72 |  N DIR,X,Y
 | 
|---|
| 73 |  S DIR(0)="SAO^A:ACUTE;C:CHRONIC;",DIR("A")="  (A)cute or (C)hronic? "
 | 
|---|
| 74 |  S:$L($G(GMPFLD(1.14))) DIR("B")=$P(GMPFLD(1.14),U,2)
 | 
|---|
| 75 |  S DIR("?",1)="  You may further refine the status of this problem by designating it",DIR("?",2)="  as ACUTE or CHRONIC; problems marked as ACUTE will be flagged on the",DIR("?")="  list display with a '*'."
 | 
|---|
| 76 | PR1 D ^DIR I $D(DTOUT)!(Y="^") S GMPQUIT=1 Q
 | 
|---|
| 77 |  I Y?1"^".E D JUMP^GMPLEDT3(Y) Q:$D(GMPQUIT)!($G(GMPLJUMP))  K:$G(GMPIFN) GMPLJUMP G PR1
 | 
|---|
| 78 |  S:Y'="" Y=Y_U_$S(Y="A":"ACUTE",1:"CHRONIC")
 | 
|---|
| 79 |  S GMPFLD(1.14)=Y
 | 
|---|
| 80 |  Q
 | 
|---|