source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPXU1.m@ 1800

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1GMTSPXU1 ; SLC/SBW - PCE Utilities sub-routines ; 03/24/2004 [8/24/04 8:28am]
2 ;;2.7;Health Summary;**10,37,71**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 3390 $$ICDDX^ICDCODE
6 ; DBIA 3390 $$ICDOP^ICDCODE
7 ; DBIA 3390 $$ICDD^ICDCODE
8 ; DBIA 1995 $$CPT^ICPTCOD
9 ; DBIA 10026 ^DIR
10 ; DBIA 10011 ^DIWP
11 ;
12GETICDDX(GMTSICD,GMTSICF,GMMOD) ; Entry point to get ICD9 data
13 N REC,CODE,NAME,DESC,ICDX,ICDI,ICDA
14 S GMTSICD=$G(GMTSICD),GMTSICF=$G(GMTSICF),GMMOD=$G(GMMOD)
15 S ICDX=$$ICDDX^ICDCODE(+GMTSICD)
16 S REC(80,GMTSICD,.01,"E")=$P(ICDX,"^",2)
17 S REC(80,GMTSICD,.01,"I")=$P(ICDX,"^",2)
18 S REC(80,GMTSICD,3,"E")=$P(ICDX,"^",4)
19 S REC(80,GMTSICD,3,"I")=$P(ICDX,"^",4)
20 S ICDI=$$ICDD^ICDCODE($P(ICDX,"^",2),"ICDA")
21 S REC(80,GMTSICD,10,"E")=$G(ICDA(1))
22 S REC(80,GMTSICD,10,"I")=$G(ICDA(1))
23 S CODE=REC(80,GMTSICD,.01,"I")
24 S NAME=REC(80,GMTSICD,3,"E")
25 S DESC=REC(80,GMTSICD,10,"E")
26 S:GMTSICF="L"!(GMTSICF="") GMTSICD=CODE_"-"_DESC
27 S:GMTSICF="S" GMTSICD=CODE_"-"_NAME
28 S:GMTSICF="C" GMTSICD=CODE
29 S:GMTSICF="T" GMTSICD=DESC
30 I $G(GMMOD)]"" S GMMOD=$P(GMMOD,","),GMTSICD=GMMOD_" "_GMTSICD
31 S:GMTSICF="N" GMTSICD=""
32 Q
33 ;
34GETICDOP(GMTSICD,GMTSICF,GMMOD) ; Entry point to get ICD0 data
35 S GMTSICD=$G(GMTSICD),GMTSICF=$G(GMTSICF),GMMOD=$G(GMMOD)
36 N REC,CODE,NAME,DESC,ICDX,ICDI,ICDA
37 S ICDX=$$ICDOP^ICDCODE(+GMTSICD)
38 S REC(80.1,GMTSICD,.01,"E")=$P(ICDX,"^",2)
39 S REC(80.1,GMTSICD,.01,"I")=$P(ICDX,"^",2)
40 S REC(80.1,GMTSICD,4,"E")=$P(ICDX,"^",5)
41 S REC(80.1,GMTSICD,4,"I")=$P(ICDX,"^",5)
42 S ICDI=$$ICDD^ICDCODE($P(ICDX,"^",2),"ICDA")
43 S REC(80.1,GMTSICD,10,"E")=$G(ICDA(1))
44 S REC(80.1,GMTSICD,10,"I")=$G(ICDA(1))
45 S CODE=REC(80.1,GMTSICD,.01,"I")
46 S NAME=REC(80.1,GMTSICD,4,"E")
47 S DESC=REC(80.1,GMTSICD,10,"E")
48 S:GMTSICF="L"!(GMTSICF="") GMTSICD=CODE_"-"_DESC
49 S:GMTSICF="S" GMTSICD=CODE_"-"_NAME
50 S:GMTSICF="C" GMTSICD=CODE
51 S:GMTSICF="T" GMTSICD=DESC
52 S:GMTSICF="N" GMTSICD=""
53 Q
54 ;
55GETCPT(GMTSCPT) ; Entry point to get CPT data
56 N ICPT S GMTSCPT=+($G(GMTSCPT)) Q:GMTSCPT=0 ""
57 S ICPT=$$CPT^ICPTCOD(+GMTSCPT),ICPT=$P(ICPT,"^",2)_"-"_$P(ICPT,"^",3)
58 Q ICPT
59 ;
60TXTFMT(GMTSICD,GMTSNARR,GMICL,GMTAB,DIWL,GMTSQTY,GMTSPRIM) ; Formats GMTSICD & GMTSNARR together
61 I GMTSICD="",GMTSNARR="" Q
62 N DIWR,DIWF,X
63 S DIWR=80-(GMICL+GMTAB)
64 K ^UTILITY($J,"W")
65 I $G(GMTSICD)]"" S X=GMTSICD S:$G(GMTSNARR)]"" X=X_"; "
66 I $G(GMTSNARR)]"" S X=$G(X)_GMTSNARR D
67 . I $G(GMTSPRIM)]"" S X=X_GMTSPRIM
68 . I $G(GMTSQTY)]"" S X=X_GMTSQTY
69 . D ^DIWP
70 I $G(GMTSNARR)']"" D
71 . I $G(GMTSQTY)]"" S X=$G(X)_GMTSQTY
72 . I $G(GMTSPRIM)]"" S X=X_GMTSPRIM
73 . D ^DIWP
74 Q
75 ;
76ORDERPRO(GMPROV,GMLEN) ; Re-order and format providers for visit
77 N GMCNT,GMTSP,GMNODE,GMP
78 S GMCNT=0
79 F GMP="P","S","Z" S GMTSP="" F S GMTSP=$O(^TMP("PXHSV",$J,GMTSIVD,GMTSVDF,"P",GMP,GMTSP)) Q:GMTSP'>0 D
80 . S GMNODE=^TMP("PXHSV",$J,GMTSIVD,GMTSVDF,"P",GMP,GMTSP)
81 . Q:GMNODE']""
82 . S GMCNT=GMCNT+1
83 . S GMPROV(GMCNT)=$E($P(GMNODE,U),1,GMLEN-4)_$S(GMP="P"!(GMP="S"):" ("_GMP_")",1:"")
84 Q
85 ;
86 ; The following code segments are called from "ROUTINE" type
87 ; Menu Options to display items in a file
88 ;
89LM ; Entry Point - for GMTS Measurement Panel
90 S GMTSLST="^GMT(142.7," G DSPLST
91 ;
92DSPLST ; Common code for Health Summary MNX Lists
93 K DIR
94 I '$D(@(GMTSLST_"""B"")")) W !,"NO ",$P(@(GMTSLST_"0)"),U),"S DEFINED.",! Q
95 W @IOF,!!,"Existing ",$P(@(GMTSLST_"0)"),U),"S:",! S GMTSCNT=""
96CONT ; Continue
97 F S GMTSCNT=$O(@(GMTSLST_"""B"",GMTSCNT)")) Q:GMTSCNT="" D G:1'[$G(Y)&($L($G(Y))) QUIT
98 . N DIR K Y W !,?5,GMTSCNT I (IOSL-3)<$Y S DIR(0)="E" D
99 . . D ^DIR W @IOF
100 K DIR S DIR(0)="E" D ^DIR W !
101QUIT ; Quit
102 K DIR,X,Y,GMTSLST,GMTSCNT
103 Q
Note: See TracBrowser for help on using the repository browser.