source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORCXPND4.m@ 1800

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1ORCXPND4 ; SLC/MKB,MA - Expanded Display cont ;9/10/99 13:16
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**67**;Dec 17, 1997
3 ;
4PL ; -- problem list
5 N ORPL,X,I,CNT,PROBLEM,II
6 D DETAIL^GMPLUTL2(+ID,.ORPL)
7 S PROBLEM=(LCNT+1)_U_ORPL("NARRATIVE")_" ("_ORPL("DIAGNOSIS")_")" ; #^Text
8 S X(1)=$P(PROBLEM,U,2),X(2)=" "
9 S X(3)=" Onset: "_ORPL("ONSET"),X(3)=X(3)_$J("SC Condition: ",61-$L(X(3)))_ORPL("SC")
10 S X(4)=" Status: "_ORPL("STATUS")_$S($L(ORPL("PRIORITY")):"/"_ORPL("PRIORITY"),1:""),X(4)=X(4)_$J("Exposure: ",61-$L(X(4)))_$S('ORPL("EXPOSURE"):"NONE",1:ORPL("EXPOSURE",1))
11 S X(5)="Provider: "_ORPL("PROVIDER")
12 S:ORPL("EXPOSURE")>1 X(5)=X(5)_$$REPEAT^XLFSTR(" ",61-$L(X(5)))_ORPL("EXPOSURE",2)
13 S X(6)=" Clinic: "_ORPL("CLINIC")
14 S:ORPL("EXPOSURE")>2 X(6)=X(6)_$$REPEAT^XLFSTR(" ",61-$L(X(6)))_ORPL("EXPOSURE",3)
15PL1 S X(7)=" "
16 S X(8)="Recorded: "_$P(ORPL("RECORDED"),U)_", by "_$P(ORPL("RECORDED"),U,2)
17 S X(9)=" Entered: "_$P(ORPL("ENTERED"),U)_", by "_$P(ORPL("ENTERED"),U,2)
18 S X(10)=" Updated: "_ORPL("MODIFIED")
19 S X(11)=" ",X(12)="Comments: ",CNT=12
20 S:ORPL("COMMENT")'>0 X(13)=" <None>",CNT=13
21 I ORPL("COMMENT") F I=1:1:ORPL("COMMENT") D
22 . S CNT=CNT+1,X(CNT)=$J($P(ORPL("COMMENT",I),U),8)_": "_$P(ORPL("COMMENT",I),U,3)
23 . S CNT=CNT+1,X(CNT)=" "_$P(ORPL("COMMENT",I),U,2)
24 S CNT=CNT+1,X(CNT)=" "
25 F I=1:1:CNT S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=X(I)
26 D:$D(IORVON) SETVIDEO^ORCXPND(+PROBLEM,1,$L($P(PROBLEM,U,2)),IORVON,IORVOFF)
27 D:$D(IOUON) SETVIDEO^ORCXPND(12,1,8,IOUON,IOUOFF)
28PL2 ; Changes added to include PROBLEM LIST AUDIT TRAIL 8 Sep 99
29 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)="History:"
30 D:$D(IOUON) SETVIDEO^ORCXPND(LCNT,1,7,IOUON,IOUOFF)
31 I ORPL("AUDIT")=0 S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=" <No Changes>" Q
32 I ORPL("AUDIT")>0 F II=1:1:ORPL("AUDIT") D COVPRT
33 Q
34 ;
35COVPRT ; This will convert GMPL("AUDIT") to printable format and write it
36 ; out to ^TMP("ORXPND",$J)
37 N NODE,DATE,FLD,PROV,OLD,NEW,ROOT,CHNGE
38 S NODE=ORPL("AUDIT",II,0)
39 S DATE=$$DATE^ORCHTAB($P(NODE,U,3)),FLD=+$P(NODE,U),PROV=+$P(NODE,U,8)
40 S:'PROV PROV=$P(NODE,U,4) S PROV=$P($G(^VA(200,PROV,0)),U) ;Entr vs Prov
41 S OLD=$P(NODE,U,5),NEW=$P(NODE,U,6),LCNT=LCNT+1
42 I +FLD=1101 D Q
43 . S NODE=ORPL("AUDIT",II,1) ; old note
44 . S ^TMP("ORXPND",$J,LCNT,0)=$J(DATE,10)_": NOTE "_$$DATE^ORCHTAB($P(NODE,U,5))_" removed by "_PROV
45 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=" "_$P(NODE,U,3)
46 I +FLD=1.02 D Q
47 . S CHNGE=$S(NEW="H":"removed",OLD="T":"verified",1:"placed back on list")
48 . S ^TMP("ORXPND",$J,LCNT,0)=$J(DATE,10)_": PROBLEM "_CHNGE_" by "_PROV
49 S ^TMP("ORXPND",$J,LCNT,0)=$J(DATE,10)_": "_$P(NODE,U,2)_" changed by "_PROV,LCNT=LCNT+1
50 I +FLD=.12 S ^TMP("ORXPND",$J,LCNT,0)=$J("from ",17)_$S(OLD="A":"ACTIVE",OLD="I":"INACTIVE",1:"UNKNOWN")_" to "_$S(NEW="A":"ACTIVE",NEW="I":"INACTIVE",1:"UNKNOWN") Q
51 I (+FLD=.13)!(+FLD=1.07) S ^TMP("ORXPND",$J,LCNT,0)=$J("from ",17)_$$DATE^ORCHTAB(OLD)_" to "_$$DATE^ORCHTAB(NEW) Q
52 I +FLD=1.14 S ^TMP("ORXPND",$J,LCNT,0)=$J("from ",17)_$S(OLD="A":"ACUTE",OLD="C":"CHRONIC",1:"UNSPECIFIED")_" to "_$S(NEW="A":"ACUTE",NEW="C":"CHRONIC",1:"UNSPECIFIED") Q
53 I +FLD>1.09 S ^TMP("ORXPND",$J,LCNT,0)=$J("from ",17)_$S(+OLD:"YES",OLD=0:"NO",1:"UNKNOWN")_" to "_$S(+NEW:"YES",NEW=0:"NO",1:"UNKNOWN") Q
54 I "^.01^.05^1.01^1.04^1.05^1.06^1.08^"[(U_+FLD_U) D
55 . S ROOT=$S(+FLD=.01:"ICD9(",+FLD=.05:"AUTNPOV(",+FLD=1.01:"LEX(757.01,",(+FLD=1.04)!(+FLD=1.05):"VA(200,",+FLD=1.06:"DIC(49,",+FLD=1.08:"SC(",1:"") Q:ROOT=""
56 . S ^TMP("ORXPND",$J,LCNT,0)=$J("from ",17)_$S(OLD:$P(@(U_ROOT_OLD_",0)"),U),1:"UNSPECIFIED")
57 . S LCNT=LCNT+1,^TMP("ORXPND",$J,LCNT,0)=$J("to ",17)_$S(NEW:$P(@(U_ROOT_NEW_",0)"),U),1:"UNSPECIFIED")
58 Q
Note: See TracBrowser for help on using the repository browser.