source: WorldVistAEHR/trunk/r/PROBLEM_LIST-GMPL/GMPLEDT1.m@ 691

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

revised back to 6/30/08 version

File size: 6.1 KB
RevLine 
[623]1GMPLEDT1 ; SLC/MKB/KER/AJB -- Edit Problem List fields ; 04/21/2003
2 ;;2.0;Problem List;**17,20,26,28**;Aug 25, 1994
3 ;
4 ; External References
5 ; DBIA 10006 ^DIC
6 ; DBIA 10026 ^DIR
7 ; DBIA 341 DIS^SDROUT2
8 ;
9ONSET ; Edit Date of Onset - field .13
10 N X,Y,ENTERED,PROMPT,HELPMSG,DEFAULT
11 S ENTERED=$S($G(GMPFLD(.08)):+GMPFLD(.08),1:DT),DEFAULT=$G(GMPFLD(.13))
12 S PROMPT="DATE OF ONSET: ",HELPMSG="Enter the date this problem was first observed, as precisely as known."
13O1 ; Get Date of Onset
14 D DATE^GMPLEDT2 Q:$D(GMPQUIT)!($G(GMPLJUMP))
15 I Y>ENTERED W !!,"Date of Onset cannot be later than the date the problem was entered!",$C(7) G O1
16 I +$P(GMPDFN,U,4),Y>$P(GMPDFN,U,4) W !!,"Date of Onset cannot be later than the date of death!",$C(7) G O1
17 S GMPFLD(.13)=Y S:Y'="" GMPFLD(.13)=GMPFLD(.13)_U_$$EXTDT^GMPLX(Y)
18 Q
19STATUS ; Edit Status - field .12
20 ; Then Edit Date Resolved - Field 1.07, if inactive
21 N DIR,X,Y
22 S DIR(0)="9000011,.12"
23 S:$L($G(GMPFLD(.12))) DIR("B")=$P(GMPFLD(.12),U,2)
24ST1 ; Get Status
25 D ^DIR I $D(DTOUT)!(Y="^") S GMPQUIT=1 Q
26 I Y?1"^".E D JUMP^GMPLEDT3(Y) Q:$D(GMPQUIT)!($G(GMPLJUMP)) K:$G(GMPIFN) GMPLJUMP G ST1
27 S:Y'="" Y=Y_U_$S(Y="A":"ACTIVE",1:"INACTIVE") S GMPFLD(.12)=Y
28 S:$E(Y)'="I" GMPFLD(1.07)="" S:$E(Y)'="A" GMPFLD(1.14)=""
29 D:$E(GMPFLD(.12))="I" RESOLVED^GMPLEDT4
30 D:$E(GMPFLD(.12))="A" PRIORITY^GMPLEDT4
31 Q
32RECORDED ; Edit Date Recorded - field 1.09
33 N X,Y,PROMPT,HELPMSG,DEFAULT,ENTERED
34 S ENTERED=$S($G(GMPFLD(.08)):+GMPFLD(.08),1:DT),DEFAULT=$G(GMPFLD(1.09))
35 S PROMPT="DATE RECORDED: ",HELPMSG="Enter the date this problem was first recorded, as precisely as known."
36RC1 ; Get Date
37 D DATE^GMPLEDT2 Q:$D(GMPQUIT)!($G(GMPLJUMP))
38 I Y>ENTERED W !!,"Date Recorded cannot be later than the problem was entered!",$C(7) G RC1
39 S GMPFLD(1.09)=Y S:Y'="" GMPFLD(1.09)=GMPFLD(1.09)_U_$$EXTDT^GMPLX(Y)
40 Q
41SC ; Edit Service Connected - field 1.1
42 N DFN,DIR,X,Y
43 ;
44 ; The following allows changing a problem's SC/NSC to
45 ; NSC if there is no SC on file for patient and Problem
46 ; original SC was set to "YES"
47 ;
48 I +$G(GMPORIG(1.1))=1 D
49 . W !!,">>> Currently known service-connection data for "_$P(GMPDFN,U,2)_":"
50 ELSE Q:'GMPSC
51 S DFN=+GMPDFN D DIS^SDROUT2
52 I +GMPSC=0,+$G(GMPORIG(1.1))=1 D
53 . S DIR("A")="Patient has no service-connected condition !! "
54 . S DIR("B")="NO"
55 ELSE D
56 . S DIR("A")="Is this problem related to a service-connected condition? "
57 . S:$L($G(GMPFLD(1.1))) DIR("B")=$P(GMPFLD(1.1),U,2) W !
58 S DIR("?",1)="If this problem is due to a service-connected condition, enter YES;",DIR("?")="press <return> and leave blank if this is unknown.",DIR(0)="YAO"
59SC1 ; Get Service Connection
60 D ^DIR I $D(DTOUT)!(Y="^") S GMPQUIT=1 Q
61 I Y?1"^".E D JUMP^GMPLEDT3(Y) Q:$D(GMPQUIT)!($G(GMPLJUMP)) K:$G(GMPIFN) GMPLJUMP G SC1
62 I X="@" G:'$$SURE^GMPLX SC1 S Y=""
63 S GMPFLD(1.1)=Y S:Y'="" GMPFLD(1.1)=GMPFLD(1.1)_U_$S(Y:"YES",1:"NO")
64 Q
65SP ; Edit Exposures/Conditions
66 ; Agent Orange - field 1.11
67 ; Ionizing Radiation - field 1.12
68 ; Persian Gulf/Environmental Contaminants - field 1.13
69 ; Head and/or Neck Cancer - field 1.15
70 ; Military Sexual Trauma - field 1.16
71 G SPEXP^GMPLEDT2
72 Q
73SOURCE ; Edit Service - field 1.06
74 ; or Clinic - field 1.08
75 N DIC,X,Y,HELPMSG,PROMPT,DEFAULT,VIEW S VIEW=$E(GMPLVIEW("VIEW"))
76 S DIC=$S(VIEW="S":"^DIC(49,",1:"^SC("),DIC(0)="EMQ"
77 S DIC("S")="I $P(^(0),U,"_$S(VIEW="S":9,1:3)_")=""C"""
78 I VIEW="S" S PROMPT="SERVICE: ",DEFAULT=$P(GMPFLD(1.06),U,2)
79 E S PROMPT="CLINIC: ",DEFAULT=$P(GMPFLD(1.08),U,2)
80 S HELPMSG="Enter the clinic"_$S(VIEW="S":"al service",1:"")_" to be associated with this problem."
81S1 ; Get Service/Clinic
82 W !,PROMPT_$S($L(DEFAULT):DEFAULT_"//",1:"")
83 R X:DTIME S:'$T X="^",DTOUT=1 S:X="^" GMPQUIT=1 Q:(X="^")!(X="")
84 I X?1"^".E D JUMP^GMPLEDT3(X) Q:$D(GMPQUIT)!($G(GMPLJUMP)) K:$G(GMPIFN) GMPLJUMP G S1
85 I X="?" W !!,HELPMSG,! G S1
86 I X["??" D @("LIST"_$S(VIEW="S":"SERV",1:"CLIN")_"^GMPLMGR1") W !,HELPMSG G S1
87 I X="@" G:'$$SURE^GMPLX S1 S Y="" G SQ
88 D ^DIC I Y'>0 W !?5,"Only clinic"_$S(VIEW="S":"al service",1:"")_"s are allowed!",! G S1
89SQ ; Quit Service/Clinic
90 S:VIEW'="S" GMPFLD(1.08)=Y S:VIEW="S" GMPFLD(1.06)=Y
91 Q
92AUTHOR ; Edit Recording Provider - field 1.04
93 N X,Y,PROMPT,HELPMSG,DEFAULT S PROMPT="RECORDING PROVIDER: "
94 S DEFAULT=$G(GMPFLD(1.04)),HELPMSG="Enter the name of the provider responsible for the recording of this data."
95 D NPERSON^GMPLEDT2 Q:$D(GMPQUIT)!($G(GMPLJUMP))
96 S GMPFLD(1.04)=$S(+Y>0:Y,1:"")
97 Q
98PROV ; Edit Responsible Provider - field 1.05
99 N X,Y,PROMPT,DEFAULT,HELPMSG S DEFAULT=$G(GMPFLD(1.05))
100 S PROMPT="PROVIDER: ",HELPMSG="Enter the name of the local provider treating this problem."
101 D NPERSON^GMPLEDT2 Q:$D(GMPQUIT)!($G(GMPLJUMP))
102 S GMPFLD(1.05)=$S(+Y>0:Y,1:"")
103 Q
104ICD ; Edit ICD-9-CM Code - field .01
105 N DIC,DIR,X,Y
106ICD0 ; Prompt for ICD Code
107 K DIR S DIR(0)="FAO^2:6",DIR("A")="ICD CODE: "
108 S:$P($G(GMPFLD(.01)),U,2)="799.9" DIR("A")=IORVON_"ICD CODE: "
109 S:+$G(GMPFLD(.01)) DIR("B")=$P(GMPFLD(.01),U,2)
110 S DIR("?")="Enter the ICD code to be associated with this problem"
111ICD1 ; Get ICD Code
112 D ^DIR W IORVOFF I $D(DTOUT)!(Y="^") S GMPQUIT=1 Q
113 I Y?1"^".E D JUMP^GMPLEDT3(Y) Q:$D(GMPQUIT)!($G(GMPLJUMP)) K:$G(GMPIFN) GMPLJUMP G ICD1
114 I X="@" W !!,"ICD Code may not be deleted!",!,$C(7) G ICD1
115 Q:X="" Q:$P($G(GMPFLD(.01)),U,2)=Y
116 S DIC=80,DIC(0)="EQM" D ^DIC G:Y'>0 ICD0
117 S GMPFLD(.01)=Y
118 Q
119NOTE ; Attach a note to problem - field 11
120 N X,Y,I,DEFAULT,PROMPT,DONE,NXT,NCNT S (I,NCNT,DONE)=0
121 ; added for Code Set Versioning (CSV)
122 I $G(GMPICD),'+$$STATCHK^ICDAPIU(GMPICD,DT) D Q
123 . W !!,"This problem has an inactive ICD code. Please edit the problem before using.",! H 3
124 I $G(GMPIFN),'$$CODESTS^GMPLX(GMPIFN,DT) D Q
125 . W !!,"This problem has an inactive ICD code. Please edit the problem before using.",! H 3
126 F D Q:$D(GMPQUIT)!($G(GMPLJUMP))!DONE
127 . S NXT=$O(GMPFLD(10,"NEW",I)) S:'NXT NXT=I+1
128 . S I=NXT,NCNT=NCNT+1
129 . S PROMPT=$S(NCNT=1:"",1:"ANOTHER ")_"COMMENT"_$S(NCNT=1:" (<60 char): ",1:": "),DEFAULT=$G(GMPFLD(10,"NEW",I))
130 . D EDNOTE^GMPLEDT4 Q:$D(GMPQUIT)!($G(GMPLJUMP))
131 . I X="@" K GMPFLD(10,"NEW",I) Q
132 . I Y="" S DONE=1 Q
133 . S GMPFLD(10,"NEW",I)=Y
134 Q
135TERM ; Edit Problem - field 1.01
136 G TERM^GMPLEDT4
137 Q
138Q ; No Editing
139 Q
Note: See TracBrowser for help on using the repository browser.