source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSLOAD.m@ 808

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1GMTSLOAD ;SLC/JER - Loads Ad Hoc Summary Type ; 02/27/2002
2 ;;2.7;Health Summary;**23,30,36,37,49**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 10026 ^DIR
6 ; DBIA 10141 BMES^XPDUTL
7 ; DBIA 10141 MES^XPDUTL
8 ;
9MAIN ; Controls branching and execution
10 N DIC,DIROUT,DIRUT,DIR,GMI,GMW,GMTJ,GMTNM,GMTSEG,GMTSFUNC,GMTSI,GMTSIFN,GMTSWHL,INCLUDE,S2,X,Y
11 W !!,"This option rebuilds the Ad Hoc Health Summary to include ALL components",!
12 W "alphabetized by name. If you wish, you may exclude DISABLED components.",!
13 S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="NO",DIR("?")="Answer ""Y"" or ""N"", ""NO"" to exit this option."
14 D ^DIR Q:Y=0 W !
15 I $S($D(DIRUT):1,$D(DIROUT):1,1:0) Q
16 S DIR("?")="Answer ""Y"" or ""N"", ""YES"" to include DISABLED components."
17 S DIR("A")="Should DISABLED components be included",DIR("B")="YES"
18 D ^DIR
19 I $S($D(DIRUT):1,$D(DIROUT):1,1:0) Q
20 S INCLUDE=Y
21ENPOST ; Entry point from Post-init
22 ; Call with INCLUDE=0 to exclude DISABLED components
23 ; Call with INCLUDE=1 to include DISABLED components
24 N NEWREC,GMTSTYP,DLAYGO
25 S DLAYGO=142
26 S DIC=142,DIC(0)="LXF",X="GMTS HS ADHOC OPTION" S Y=$$TYPE^GMTSULT K DIC
27 I +Y'>0 D NOFILE Q
28 S (GMTSIFN,GMTSTYP)=+Y,NEWREC=+$P(Y,U,3)
29 S:'$D(^GMT(142,GMTSIFN,1,0)) ^(0)="^142.01IA^0^0"
30 S GMTNM="" F GMI=1:1 S GMTNM=$O(^GMT(142.1,"B",GMTNM)) Q:GMTNM']"" S GMTJ=$O(^(GMTNM,0)) Q:GMTJ'>0 D LOAD
31 S GMTSI=0 I 'NEWREC F S GMTSI=$O(^GMT(142,GMTSIFN,1,GMTSI)) Q:GMTSI'>0 D PURGE^GMTSRN
32 D BMES^XPDUTL(" Rebuilding Ad Hoc Summary")
33 D RNMBR^GMTSRN
34 D MES^XPDUTL(" Done")
35 Q
36NOFILE ; GMTS HS ADHOC OPTION Summary Type is missing
37 D MES^XPDUTL(" ")
38 D BMES^XPDUTL("** GMTS AD HOC OPTION Summary Type is missing **")
39 Q
40 ;
41LOAD ; Loads GMTSEG(GMI)=Sequence ^ Component ^ Occurrence Limit ^
42 ; Time Limit ^^ Hospital Location ^ ICD Text Displayed ^
43 ; Provider Narratived Displayed ^ CPT Modifier Displayed
44 ;
45 ; Needs GMTJ Pointer to Component 142.1
46 ; GMTSTYP Pointer to Type 142
47 ; GMI Pointer to Structure 142.01 in GMTSEG(GMI)
48 ;
49 N COMP,TYPE,OCC,TIME,GMSEQ,HOSPLOC,ICDTEXT,PROVNARR,CPTMOD
50 Q:'$D(^GMT(142.1,GMTJ,0))
51 S GMSEQ=$O(^GMT(142,"AE",GMTJ,GMTSTYP,0))
52 I GMSEQ>0 D
53 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,5),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,3)
54 . S OCC=$S(COMP="Y":TYPE,1:"")
55 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,3),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,4)
56 . S TIME=$S(COMP="Y":TYPE,1:"")
57 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,10),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,6)
58 . S HOSPLOC=$S(COMP="Y":TYPE,1:"")
59 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,11),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,7)
60 . S ICDTEXT=$S(COMP="Y":TYPE,1:"")
61 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,12),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,8)
62 . S PROVNARR=$S(COMP="Y":TYPE,1:"")
63 . S COMP=$P($G(^GMT(142.1,GMTJ,0)),U,14),TYPE=$P($G(^GMT(142,GMTSTYP,1,GMSEQ,0)),U,9)
64 . S CPTMOD=$S((COMP="Y"&(TYPE'="N")):"Y",(COMP="Y"&(TYPE="N")):"N",1:"")
65 E D
66 . S OCC=$S($P(^GMT(142.1,GMTJ,0),U,5)="Y":10,1:"")
67 . S TIME=$S($P(^GMT(142.1,GMTJ,0),U,3)="Y":"1Y",1:"")
68 . S HOSPLOC=$S($P(^GMT(142.1,GMTJ,0),U,10)="Y":"Y",1:"")
69 . S ICDTEXT=$S($P(^GMT(142.1,GMTJ,0),U,11)="Y":"L",1:"")
70 . S PROVNARR=$S($P(^GMT(142.1,GMTJ,0),U,12)="Y":"Y",1:"")
71 . S CPTMOD=$S($P(^GMT(142.1,GMTJ,0),U,14)="Y":"Y",1:"")
72 D SETSEG
73 Q
74 ;
75SETSEG ; Set Segment
76 ; GMTSEG(GMI)
77 S GMI=+($G(GMI)) Q:GMI=0 N OFF S OFF=$S($P(^GMT(142.1,GMTJ,0),U,6)="P":1,$P(^(0),U,6)="T":1,1:0)
78 I (+($G(INCLUDE))=0),(OFF=1) Q
79 S GMTSEG(GMI)=(5*GMI)_U_GMTJ_U_OCC_U_TIME_U_U_HOSPLOC_U_ICDTEXT_U_PROVNARR_U_CPTMOD
80 I GMSEQ>0 D SETSEL
81 Q
82SETSEL ; Sets up selection items
83 ; GMTSEG(GMI,GMSEL)=Selection item
84 N GMSEL,GMITEM,GMW,S2
85 S GMSEL=0 F S GMSEL=$O(^GMT(142,GMTSTYP,1,+GMSEQ,1,GMSEL)) Q:GMSEL'>0 S GMITEM=^(GMSEL,0) S GMTSEG(GMI,GMSEL)=GMITEM
86 Q
Note: See TracBrowser for help on using the repository browser.