source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSXPD1.m@ 1150

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

initial load of WorldVistAEHR

File size: 8.7 KB
Line 
1GMTSXPD1 ; SLC/KER - Health Summary Dist (Component) ; 08/27/2002
2 ;;2.7;Health Summary;**35,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 1023 $$FIRSTUP^VAQUTL50
6 ; DBIA 10006 ^DIC
7 ; DBIA 10018 ^DIE (file #142.1)
8 ; DBIA 10013 IX^DIK
9 ; DBIA 10103 $$NOW^XLFDT
10 ; DBIA 10030 ^DD(
11 ; DBIA 10086 HOME^%ZIS
12 ; DBIA 10060 ^VA(200,
13 ; DBIA 2056 $$GET1^DIQ (file 200)
14 ; DBIA 10141 BMES^XPDUTL
15 ; DBIA 10141 MES^XPDUTL
16 ;
17 Q
18ADD(GMTSINI) ; Add Health Summary Component
19 ;
20 ; ADD(<array>)
21 ; GMTSIEN GMTSINI(0) Internal Entry Number File 142.1
22 ; GMTSNAME GMTSINI(.01) Component Name
23 ; GMTSRTN GMTSINI(1) Display Routine
24 ; GMTSEXTR GMTSINI(1.1) Extract Routine (m)
25 ; GMTSTIML GMTSINI(2) Time Limits Applicable
26 ; GMTSABBR GMTSINI(3) Abbreviation
27 ; GMTSDESC GMTSINI(3.5) Description (m)
28 ; GMTSOCCL GMTSINI(4) Occurrence Limits Applicable
29 ; GMTSDAF GMTSINI(5) Disable Flag (null, T or P)
30 ; GMTSSKEY GMTSINI(6) Security Key (Component Locking)
31 ; GMTSSELF GMTSINI(7) Selection File (m)
32 ; GMTSOOM GMTSINI(8) Out of Order Message
33 ; GMTSDHDN GMTSINI(9) Default Header Name
34 ; GMTSHOSL GMTSINI(10) Hospital Location Applicable
35 ; GMTSICDT GMTSINI(11) ICD Text Applicable
36 ; GMTSPROV GMTSINI(12) Provider Narrative Text Applicable
37 ; GMTSPREF GMTSINI(13) Prefix
38 ; GMTSCPTM GMTSINI(14) CPT Modifiers Applicable
39 ;
40 N GMTSENV S GMTSENV=$$ENV Q:'GMTSENV 0
41 N GMTSIEN,GMTSNAME,GMTSMNM,GMTSABBR,GMTSTAG,GMTSRTN,GMTSTIML,GMTSOCCL,GMTSSELF
42 N GMTSSKEY,GMTSDHDN,GMTSHOSL,GMTSICDT,GMTSPROV,GMTSDAF,GMTSOOM,GMTSINCL,GMTSPREF,GMTSCPTM
43 N DIE,DIK,DA,DR,DIC,DLAYGO,DINUM,X,Y,INCLUDE,GMTS,GMTSROUT,GMTSTAT
44 S GMTSNAME=$G(GMTSINI(.01)),GMTSMNM=$$FIRSTUP^VAQUTL50(GMTSNAME),GMTSIEN=+($G(GMTSINI(0))),GMTSRTN=$G(GMTSINI(1))
45 S GMTSTAG=$P(GMTSRTN,";",1),GMTSRTN=$P(GMTSRTN,";",2) S:$L(GMTSTAG)&('$L(GMTSRTN)) GMTSRTN=GMTSTAG,GMTSTAG=""
46 S GMTSROUT="",GMTSTAT=$D(^GMT(142.1,+GMTSIEN,0))
47 I '$L($G(GMTSNAME))!(+($G(GMTSIEN))'>0)!('$L($G(GMTSRTN))) Q 0
48 D INST S GMTS=+$O(^GMT(142.1,"B",GMTSNAME,0)) D:GMTS=GMTSIEN ALRDY I GMTS=GMTSIEN Q 0
49 S GMTSNAME=$$NAME^GMTSXPD2($G(GMTSNAME)) D:'$L($G(GMTSNAME)) NNAME Q:'$L(GMTSNAME) 0
50 S GMTSROUT=$$ROUT^GMTSXPD2((GMTSTAG_";"_GMTSRTN)) D:'$L($G(GMTSROUT)) NRTN Q:'$L(GMTSROUT) 0
51 S GMTSTIML=$$TIML^GMTSXPD2($G(GMTSINI(2))),GMTSABBR=$$ABBR^GMTSXPD2($G(GMTSINI(3)))
52 S GMTSOCCL=$$OCCL^GMTSXPD2($G(GMTSINI(4))),GMTSDAF=$$DAF^GMTSXPD2($G(GMTSINI(5)))
53 S GMTSSKEY=$$LOCK^GMTSXPD2($G(GMTSINI(6))),GMTSOOM=$$OOM^GMTSXPD2($G(GMTSINI(8)))
54 S GMTSDHDN=$$DHDN^GMTSXPD2($G(GMTSINI(9))),GMTSHOSL=$$HOSL^GMTSXPD2($G(GMTSINI(10)))
55 S GMTSICDT=$$ICDT^GMTSXPD2($G(GMTSINI(11))),GMTSPROV=$$PROV^GMTSXPD2($G(GMTSINI(12)))
56 S GMTSPREF=$$PREF^GMTSXPD2($G(GMTSINI(13))),GMTSCPTM=$$CPTM^GMTSXPD2($G(GMTSINI(14)))
57 S:$L(GMTSDAF)&('$L(GMTSOOM)) GMTSOOM="Component "_GMTSNAME_$S(GMTSDAF="T":" Temporarily",GMTSDAF="P":" Permanently",1:"")_" Disabled"
58 S DINUM=0,DIE="^GMT(142.1,",(DIC,DLAYGO)=142.1,DIC(0)="NXL",X=GMTSNAME S:'$D(^GMT(142.1,+($G(GMTSIEN)),0)) DINUM=+($G(GMTSIEN))
59 I +DINUM'>1 D EXIST Q 0
60 D ^DIC S DA=+($G(Y)) D:+($G(Y))'>0 FAILED Q:+($G(Y))'>0 0
61 S DR="1///^S X="""_$G(GMTSTAG)_"""_$C(59)_"""_$G(GMTSRTN)_""""
62 S:$L($G(GMTSTIML)) DR=DR_";2///"_GMTSTIML
63 S:$L($G(GMTSABBR)) DR=DR_";3///"_GMTSABBR S:$L($G(GMTSOCCL)) DR=DR_";4///"_GMTSOCCL
64 S:$L($G(GMTSDAF)) DR=DR_";5///"_GMTSDAF S:$L($G(GMTSSKEY)) DR=DR_";6///"_GMTSSKEY
65 S:$L($G(GMTSOOM)) DR=DR_";8///"_GMTSOOM S:$L($G(GMTSDHDN)) DR=DR_";9///"_GMTSDHDN
66 S:$L($G(GMTSHOSL)) DR=DR_";10///"_GMTSHOSL S:$L($G(GMTSICDT)) DR=DR_";11///"_GMTSICDT
67 S:$L($G(GMTSPROV)) DR=DR_";12///"_GMTSPROV S:$L($G(GMTSPREF)) DR=DR_";13///"_GMTSPREF
68 S:$L($G(GMTSCPTM)) DR=DR_";14///"_GMTSCPTM
69 S DIE="^GMT(142.1," D ^DIE D:$D(GMTSINI) DES(.GMTSINI),SEL(.GMTSINI),EXT(.GMTSINI)
70 S DIK="^GMT(142.1," D IX^DIK D:GMTSTAT&($D(^GMT(142.1,+($G(DA)),0))) SCESE D:'GMTSTAT&($D(^GMT(142.1,+($G(DA)),0))) SCESS
71 I $D(GMTSINI("PDX")) S GMTSNAME=$G(GMTSNAME),GMTSTIML=$G(GMTSTIML),GMTSOCCL=$G(GMTSOCCL) D PDX^GMTSXPD5(GMTSNAME,GMTSTIML,GMTSOCCL)
72 Q 1
73 ;
74DES(GMTSINI) ; Description
75 N GMTSD0,GMTSD1,GMTSN,GMTSD,GMTSDT,GMTSIEN S GMTSIEN=+($G(GMTSINI(0))),(GMTSD0,GMTSD1)=0,GMTSDT=$P($$NOW^XLFDT,".",1)
76 F S GMTSD1=$O(GMTSINI(3.5,GMTSD1)) Q:+GMTSD1=0 S GMTSD0=GMTSD0+1
77 Q:+($G(GMTSD0))=0 S GMTSINI(3.5)=GMTSD0,GMTSD1=+($G(GMTSINI(3.5))),GMTSD0="^^"_GMTSD1_"^"_GMTSD1_"^"_GMTSDT_"^"
78 S GMTSN="^GMT(142.1,"_GMTSIEN_",3.5,0)",GMTSD=GMTSD0,@GMTSN=GMTSD,GMTSD1=0
79 F S GMTSD1=$O(GMTSINI(3.5,GMTSD1)) Q:+GMTSD1=0 S GMTSN="^GMT(142.1,"_GMTSIEN_",3.5,"_GMTSD1_",0)",GMTSD=$G(GMTSINI(3.5,GMTSD1)),@GMTSN=GMTSD
80 Q
81SEL(GMTSINI) ; Selection Items
82 N GMTSD0,GMTSD1,GMTSN,GMTSF,GMTST,GMTSD,GMTSIEN S GMTSIEN=+($G(GMTSINI(0))),(GMTSD0,GMTSD1)=0
83 F S GMTSD1=$O(GMTSINI(7,GMTSD1)) Q:+GMTSD1=0 D
84 . S GMTSD=$G(GMTSINI(7,GMTSD1)),GMTSF=+($P(GMTSD,"^",1)) Q:+GMTSF=0 Q:'$D(^DD(+GMTSF)) S GMTSD0=GMTSD0+1
85 Q:+($G(GMTSD0))=0 S GMTSINI(7)=GMTSD0,GMTSD1=+($G(GMTSINI(7)))
86 S GMTSD0="^142.17P^"_GMTSD1_"^"_GMTSD1,GMTSN="^GMT(142.1,"_GMTSIEN_",1,0)",GMTSD=GMTSD0,@GMTSN=GMTSD
87 S GMTSD1=0 F S GMTSD1=$O(GMTSINI(7,GMTSD1)) Q:+GMTSD1=0 D
88 . S GMTSN="^GMT(142.1,"_GMTSIEN_",1,"_GMTSD1_",0)"
89 . S GMTSD=$G(GMTSINI(7,GMTSD1)),GMTSF=+($P(GMTSD,"^",1)) Q:+GMTSF=0 Q:'$D(^DD(GMTSF))
90 . S GMTST=+($P(GMTSD,"^",2)) S:GMTST=0 GMTST=""
91 . S GMTSD=GMTSF S:GMTST>0 $P(GMTSD,"^",2)=GMTST S @GMTSN=GMTSD
92 . S GMTSN="^GMT(142.1,"_GMTSIEN_",1,""B"","_GMTSF_","_GMTSD1_")",GMTSD="",@GMTSN=GMTSD
93 Q
94EXT(GMTSINI) ; Extract Routines
95 N GMTSD0,GMTSD1,GMTSN,GMTSF,GMTST,GMTSD,GMTSIEN S GMTSIEN=+($G(GMTSINI(0))),(GMTSD0,GMTSD1)=0
96 F S GMTSD1=$O(GMTSINI(1.1,GMTSD1)) Q:+GMTSD1=0 D
97 . S GMTSD=$G(GMTSINI(1.1,GMTSD1)) Q:'$L(GMTSD) S GMTSTAG=$P(GMTSD,";",1),GMTSRTN=$P(GMTSD,";",2)
98 . S:$L(GMTSTAG)&('$L(GMTSRTN)) GMTSRTN=GMTSTAG,GMTSTAG="" Q:'$L(GMTSRTN) S GMTSD0=GMTSD0+1
99 Q:+($G(GMTSD0))=0 S GMTSINI(1.1)=GMTSD0,GMTSD1=+($G(GMTSINI(1.1)))
100 S GMTSD0="^142.11^"_GMTSD1_"^"_GMTSD1,GMTSN="^GMT(142.1,"_GMTSIEN_",.1,0)",GMTSD=GMTSD0,@GMTSN=GMTSD
101 S (GMTSD0,GMTSD1)=0 F S GMTSD1=$O(GMTSINI(1.1,GMTSD1)) Q:+GMTSD1=0 D
102 . S GMTSD=$G(GMTSINI(1.1,GMTSD1)) Q:'$L(GMTSD) S GMTSTAG=$P(GMTSD,";",1),GMTSRTN=$P(GMTSD,";",2) S:$L(GMTSTAG)&('$L(GMTSRTN)) GMTSRTN=GMTSTAG,GMTSTAG="" Q:'$L(GMTSRTN)
103 . S GMTSD0=GMTSD0+1,GMTSN="^GMT(142.1,"_GMTSIEN_",.1,"_GMTSD0_",0)",GMTSD=$G(GMTSINI(1.1,GMTSD1)),@GMTSN=GMTSD
104 . S GMTSN="^GMT(142.1,"_GMTSIEN_",.1,""B"","""_GMTSD_""","_GMTSD0_")",GMTSD="",@GMTSN=GMTSD
105 Q
106 ;
107 ; Messages
108INST ; Installing Component
109 N GMTST S GMTST=" Filing """_$$UP(GMTSMNM)_""" component in Health Summary" D BM(GMTST) Q
110 ; Reasons to Abort Install
111HSVNF ; Health Summary Version not found
112 N GMTST S GMTST=" Health Summary Version 2.7 not found" D BM(GMTST) Q
113ALRDY ; Component Already Installed
114 N GMTST S GMTST=" Component has already been installed" D M(GMTST) Q
115NNAME ; No Name
116 N GMTST S GMTST=" No or invalid Health Summary Component name" D M(GMTST) D NOTI Q
117NRTN ; No Routine
118 N GMTST S GMTST=" No or invalid Health Summary display routine" D M(GMTST) D NOTI Q
119FAILED ; Failed Installation
120 N GMTST S GMTST=" Failed to install component" D M(GMTST) Q
121EXIST ; DINUMed entry Exist
122 N GMTST S GMTST=" Can not add component, DINUM'ed entry already exist" D M(GMTST) Q
123NOTI ; Not Installed
124 N GMTST S GMTST=" Could not install new component" D M(GMTST) Q
125 ; Success
126SCESS ; Successfully Installed
127 N GMTSD S GMTSD=0 D DISAB Q:+($G(GMTSD))
128 N GMTST S GMTST=" Successfully installed new component" D M(GMTST) Q
129SCESE ; Successfully Edited
130 N GMTSD S GMTSD=0 D DISAB Q:+($G(GMTSD))
131 N GMTST S GMTST=" Successfully edited/updated component" D M(GMTST) Q
132DISAB ; Disabled Component
133 Q:+($G(GMTSIEN))=0 Q:$P($G(^GMT(142.1,+($G(GMTSIEN)),0)),"^",6)=""
134 N GMTSF,GMTSM,GMTST S GMTSF=$P($G(^GMT(142.1,+($G(GMTSIEN)),0)),"^",6)
135 S GMTSF=$S(GMTSF="T":"Temporarily",GMTSF="P":"Permanently",1:"") Q:'$L(GMTSF)
136 S GMTSD=1,GMTST="",GMTSM=$P($G(^GMT(142.1,+($G(GMTSIEN)),0)),"^",8)
137 S GMTST=" Componet """_$$UP(GMTSMNM)_""" is installed, but "_GMTSF_" disabled" D M(GMTST)
138 S GMTST="" S:$L(GMTSM) GMTST=" Out of order message: """_GMTSM_"""" D:$L(GMTST) M(GMTST)
139 Q
140 ;
141 ; Other
142ENV(X) ; Environment check
143 D HOME^%ZIS I '$D(^VA(200,+($G(DUZ)),0)) D BM(" User (DUZ) not defined"),M("") Q 0
144 I '$L($P($G(^VA(200,+($G(DUZ)),0)),"^",1)) D BM(" Invalid User defined (DUZ)"),M("") Q 0
145 Q 1
146BM(X) ; Blank Line with Message
147 Q:$D(GMTSQT) D:$D(XPDNM) BMES^XPDUTL($G(X)) W:'$D(XPDNM) !!,$G(X) Q
148M(X) ; Message
149 Q:$D(GMTSQT) D:$D(XPDNM) MES^XPDUTL($G(X)) W:'$D(XPDNM) !,$G(X) Q
150UP(X) ; Uppercase
151 Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Note: See TracBrowser for help on using the repository browser.