1 | GMTSPLSZ ;SLC/SBW - Updated Problem List 2.0 extract routine. in HS namespace ;18/Apr/95
|
---|
2 | ;;2.7;Health Summary;;Oct 20, 1995
|
---|
3 | GMPLHS ;SLC/MKB,DJP,SBW - Extract for Prob List-Health Summary 2.7 ;15/APR/95
|
---|
4 | ;;2.0;Problem List;;Aug 25, 1994
|
---|
5 | GETLIST(GMPDFN,STATUS) ; Define list
|
---|
6 | N GMPLIST,GMPLVIEW,GMPARAM,GMPTOTAL
|
---|
7 | K ^TMP("GMPLHS",$J)
|
---|
8 | Q:+GMPDFN'>0
|
---|
9 | S GMPARAM("QUIET")=1,GMPARAM("REV")=$P($G(^GMPL(125.99,1,0)),U,5)="R"
|
---|
10 | S GMPLVIEW("ACT")=STATUS,GMPLVIEW("PROV")=0,GMPLVIEW("VIEW")=""
|
---|
11 | D GETPLIST^GMPLMGR1(.GMPLIST,.GMPTOTAL,.GMPLVIEW)
|
---|
12 | BUILD ; Build list for selected patient
|
---|
13 | ; Returns ^TMP("GMPLHS",$J,STATUS,0) = GMPCNT ^ GMPTOTAL
|
---|
14 | N IFN,GMPCNT,NUM
|
---|
15 | S (NUM,GMPCNT)=0
|
---|
16 | F S NUM=$O(GMPLIST(NUM)) Q:NUM'>0 D
|
---|
17 | . S IFN=+GMPLIST(NUM) Q:IFN'>0
|
---|
18 | . D GETPROB(IFN)
|
---|
19 | I $G(GMPCNT)'>0 K ^TMP("GMPLHS",$J) Q
|
---|
20 | S ^TMP("GMPLHS",$J,STATUS,0)=GMPCNT_U_GMPTOTAL ; # entries extracted ^ # entries that exist
|
---|
21 | Q
|
---|
22 | GETPROB(IFN) ; Get problem data and set it to ^TMP array
|
---|
23 | ; Returns ^TMP("GMPLHS",$J,CNT,0)
|
---|
24 | ; Returns ^TMP("GMPLHS",$J,CNT,IFN,"N")
|
---|
25 | N DIC,DIQ,DR,DA,REC,DIAG,LASTMDT,NARR,SITE,ENTDT,STAT,ONSETDT,RPROV
|
---|
26 | N SERV,SERVABB,RESDT,CLIN,RECDT
|
---|
27 | S DIC=9000011,DA=IFN,DIQ="REC(",DIQ(0)="IE"
|
---|
28 | S DR=".01;.03;.05;.06;.08;.12;.13;1.05;1.06;1.07;1.08;1.09"
|
---|
29 | D EN^DIQ1
|
---|
30 | S DIAG=REC(9000011,DA,.01,"I")
|
---|
31 | S LASTMDT=REC(9000011,DA,.03,"I")
|
---|
32 | S NARR=REC(9000011,DA,.05,"E")
|
---|
33 | S SITE=REC(9000011,DA,.06,"E")
|
---|
34 | S ENTDT=REC(9000011,DA,.08,"I")
|
---|
35 | S STAT=REC(9000011,DA,.12,"I")
|
---|
36 | S ONSETDT=REC(9000011,DA,.13,"I")
|
---|
37 | S RPROV=REC(9000011,DA,1.05,"E")
|
---|
38 | S SERV=REC(9000011,DA,1.06,"E")
|
---|
39 | S SERVABB=$$SERV(REC(9000011,DA,1.06,"I"),SERV)
|
---|
40 | S RESDT=REC(9000011,DA,1.07,"I")
|
---|
41 | S CLIN=REC(9000011,DA,1.08,"E")
|
---|
42 | S RECDT=REC(9000011,DA,1.09,"I")
|
---|
43 | S GMPCNT=GMPCNT+1 ; # of problems included in the extract
|
---|
44 | S ^TMP("GMPLHS",$J,GMPCNT,0)=DIAG_U_LASTMDT_U_SITE_U_ENTDT_U_STAT_U_ONSETDT_U_RPROV_U_SERV_U_SERVABB_U_RESDT_U_CLIN_U_RECDT
|
---|
45 | S ^TMP("GMPLHS",$J,GMPCNT,"N")=NARR
|
---|
46 | D GETCOMM(IFN,GMPCNT)
|
---|
47 | Q
|
---|
48 | GETCOMM(IFN,CNT) ;Get active comments for a note
|
---|
49 | ; Returns ^TMP("GMPLHS",$J,CNT,"C",LOCATION,NOTE NMBR,0))
|
---|
50 | N IFN2,IFN3,LOC,NODE
|
---|
51 | S LOC=0
|
---|
52 | Q:$D(^AUPNPROB(IFN,11))'>0
|
---|
53 | S IFN2=0
|
---|
54 | F S IFN2=$O(^AUPNPROB(IFN,11,IFN2)) Q:IFN2'>0 D
|
---|
55 | . Q:$D(^AUPNPROB(IFN,11,IFN2,11))'>0
|
---|
56 | . S LOC=+$G(^AUPNPROB(IFN,11,IFN2,0))
|
---|
57 | . S IFN3=0
|
---|
58 | . F S IFN3=$O(^AUPNPROB(IFN,11,IFN2,11,IFN3)) Q:IFN3'>0 D
|
---|
59 | . . S NODE=$G(^AUPNPROB(IFN,11,IFN2,11,IFN3,0))
|
---|
60 | . . Q:$P(NODE,U,4)']""
|
---|
61 | . . S ^TMP("GMPLHS",$J,CNT,"C",LOC,$P(NODE,U),0)=$P(NODE,U,3)_U_$P(NODE,U,5)_U_$P($G(^VA(200,+$P(NODE,U,6),0)),U)
|
---|
62 | Q
|
---|
63 | SERV(X,SERV) ; Return service name abbreviation
|
---|
64 | N ABBREV
|
---|
65 | S ABBREV=$P($G(^DIC(49,+X,0)),U,2)
|
---|
66 | I ABBREV="" S ABBREV=$E($G(SERV),1,5)
|
---|
67 | Q ABBREV
|
---|