source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPOST.m@ 1096

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

initial load of WorldVistAEHR

File size: 6.1 KB
Line 
1GMTSPOST ;SLC/JER - Post-init for Health Summary ;11/18/92 11:23
2 ;;2.7;Health Summary;;Oct 20, 1995
3MAIN ; Controls branching and execution
4 N GMI,INCLUDE,GMTSEG,GMTSI,GMTSIFN,GMTJ,GMTSNM
5 W !!,"Starting post-init action now...."
6 D SPOOL,PARAM
7 D INPHAR,DIET,OERR,VITALS,LAB,RAD,MHPE,PRGNOTE,SURG,DCS,CP,PL^GMTSPOS1,PCE,MED^GMTSPOS1,PSO^GMTSPOS1,OUTPHAR,SOWK^GMTSPOS1
8 D EN^GMTSPOS2
9 K ^GMT(142,12,1,"C") ;Get rid of "C" xref in case there are duplicate entries
10 W !!,"'C' cross-reference on the GMTS AD HOC OPTION type in file 142 deleted."
11 W !,"It will be rebuilt"
12 S INCLUDE=0 D ENPOST^GMTSLOAD
13 D ^GMTSONIT
14 W !!,"Post-init successfully completed."
15 D FINITO
16 K GMTSIST
17 Q
18SPOOL ; Convert spool name to pointer value
19 N DIC,DIE,DA,X
20 S X=$P($G(^GMT(142.99,1,0)),U,4)
21 Q:+X!(X']"") ;Quit is Spool Device is null or a numeric value
22 S DIC=3.5,DIC(0)="X"
23 D ^DIC
24 W !!,"Converting "_X_" to a pointer value for Spool Device in Site Parameter file."
25 I +Y'>0 D Q
26 . W !,"** Can't converted "_X_" to a pointer value. **"
27 . W !,"Enter a Valid Spool Device using 'Edit Health Summary Site Parameters' option."
28 S $P(^GMT(142.99,1,0),U,4)=+Y
29 W !,X," converted successfully."
30 Q
31PARAM ; Convert YES/NO codes from 1/0 to Y/N
32 N GMNUM,X
33 F GMNUM=2,3,5 D
34 . S X=$P($G(^GMT(142.99,1,0)),U,GMNUM)
35 . Q:X']""!(X="Y")!(X="N") ;Quit there is not entry or it is "Y" or "N"
36 . I X=0 S $P(^GMT(142.99,1,0),U,GMNUM)=""
37 . I X=1 S $P(^GMT(142.99,1,0),U,GMNUM)="Y"
38 Q
39INPHAR ; Checks conditions auto-disable of Inpatient Pharmacy components
40 N GMMSG,X
41 S X="PSJEEU0"
42 X ^%ZOSF("TEST")
43 Q:$T
44 F X="PHARMACY INTRAVENOUS","PHARMACY UNIT DOSE" S GMMSG="Inpatient Medications not yet available" D DISABLE
45 Q
46OUTPHAR ; Checks conditions auto-disable of Outpatient Pharmacy components
47 N GMMSG,X
48 S X="PSOHCSUM"
49 X ^%ZOSF("TEST")
50 Q:$T
51 F X="PHARMACY OUTPATIENT" S GMMSG="Outpatient Pharmacy not yet available" D DISABLE
52 Q
53DIET ; Checks conditions auto-disable of Dietetics
54 N GMMSG,X
55 S X="FHWHEA"
56 X ^%ZOSF("TEST")
57 Q:$T
58 F X="DIETETICS" S GMMSG="Dietetics not yet available" D DISABLE
59 Q
60OERR ; Checks conditions auto-disable of OERR Orders
61 N GMMSG,X
62 S X="ORF4"
63 X ^%ZOSF("TEST")
64 Q:$T
65 F X="ORDERS CURRENT" S GMMSG="OE/RR Orders not yet available" D DISABLE
66 Q
67VITALS ; Checks conditions auto-disable of Vitals
68 N GMMSG,X
69 S X="GMRVUT0"
70 X ^%ZOSF("TEST")
71 Q:$T
72 F X="VITAL SIGNS","VITAL SIGNS SELECTED" S GMMSG="Vital Signs not yet available" D DISABLE
73 Q
74PRGNOTE ; Checks conditions auto-disable of Progress Note components
75 N GMMSG,X
76 I ($D(^YSP(606))<10),($D(^GMR(121))<10) F X="PROGRESS NOTES","PROGRESS NOTES BRIEF" S GMMSG="Progress Notes not yet available" D DISABLE
77 I $D(^GMR(121))<10 F X="ADVANCE DIRECTIVE","CLINICAL WARNINGS","CRISIS NOTES" S GMMSG=X_" not yet available" D DISABLE
78 Q
79SURG ; Checks conditions for auto-disable of Surgery component
80 N X,GMMSG
81 I $D(^SRF)<10 F X="SURGERY REPORTS","SURGERY REPORTS BRIEF" S GMMSG="Surgery Package not yet installed" D DISABLE
82 Q
83DCS ; Checks conditions for auto-disable of Discharge Summary components
84 N X,GMMSG
85 I $D(^GMR(128))<10 D
86 . S GMMSG="Discharge Summary Package not yet installed or available"
87 . F X="DISCHARGE SUMMARY","DISCHARGE SUMMARY BRIEF" D DISABLE
88 Q
89CP ; Checks conditions for auto-disable of Compensation and Pension component
90 N X,GMMSG
91 ; Checks conditions for auto-disable of Comp & Pen component
92 I +$$VERSION^XPDUTL("DVBA")<2.7 D
93 . S GMMSG="Requires AMIE version 2.7"
94 . S X="COMPENSATION AND PENSION EXAMS" D DISABLE^GMTSPOST
95 Q
96LAB ; Checks condition for auto-disable of Lab components
97 N GMMSG,X
98 I $$VERSION^XPDUTL("LR")<5.1 D
99 . S GMMSG="Requires Lab version 5.1 or later"
100 . F X="LAB BLOOD AVAILABILITY","LAB BLOOD TRANSFUSIONS","LAB CHEMISTRY & HEMATOLOGY","LAB CUMULATIVE SELECTED","LAB CUMULATIVE SELECTED 1" D DISABLE^GMTSPOST
101 . F X="LAB CUMULATIVE SELECTED 2","LAB CUMULATIVE SELECTED 3","LAB CUMULATIVE SELECTED 4","LAB CYTOPATHOLOGY","LAB ELECTRON MICROSCOPY","LAB MICROBIOLOGY" D DISABLE^GMTSPOST
102 . F X="LAB MICROBIOLOGY BRIEF","LAB ORDERS","LAB ORDERS BRIEF","LAB SURGICAL PATHOLOGY","LAB TESTS SELECTED" D DISABLE^GMTSPOST
103 Q
104RAD ; Checks condition for auto-disable of Radiology
105 N GMMSG,X
106 I $$VERSION^XPDUTL("RA")<3 D
107 . S GMMSG="Requires Radiology version 3 or later"
108 . F X="RADIOLOGY IMPRESSION","RADIOLOGY IMPRESSION SELECTED","RADIOLOGY PROFILE","RADIOLOGY STATUS" D DISABLE^GMTSPOST
109 Q
110MHPE ; Checks condition for auto-disable of Mental Health
111 N GMMSG,X
112 I $$VERSION^XPDUTL("YS")<5 D
113 . S GMMSG="Requires Mental Health version 5 or later"
114 . F X="MENTAL HEALTH PHYSICAL EXAM" D DISABLE^GMTSPOST
115 Q
116PCE ; Checks for existence of PCE package...Disables components if absents
117 N GMMSG,X
118 I $$VERSION^XPDUTL("PX")'>0 D ;Disable PCE components if PCE not installed nor available
119 . S GMMSG="Patient Care Encounter Package not yet installed"
120 . F X="PCE LOCATION OF HOME","PCE CLINICAL REMINDERS","PCE HEALTH FACTORS SELECTED","PCE HEALTH FACTORS ALL","PCE OUTPATIENT ENCOUNTERS","PCE MEASUREMENTS NON-TABULAR","PCE IMMUNIZATIONS","PCE SKIN TESTS" D DISABLE^GMTSPOST
121 . F X="PCE MEASUREMENTS SELECTED","PCE EDUCATION","PCE EDUCATION LATEST","PCE OUTPATIENT DIAGNOSIS","PCE EXAMS LATEST","PCE TREATMENTS PROVIDED" D DISABLE^GMTSPOST
122 . F X="PCE CLINICAL MAINTENANCE" D DISABLE^GMTSPOST
123 Q
124DISABLE ; Disable components if auto-disable conditions are met
125 N DA,DIC,DIE,DR,Y
126 S DIC="^GMT(142.1,",DIC(0)="X" D ^DIC
127 I +Y>0 D
128 . W !,X," Health Summary Component disabled"
129 . S DA=+Y,DR="5///"_"P"_";8///"_GMMSG,DIE=DIC D ^DIE
130 Q
131FINITO ; Finish initialization, inform user
132 N GMTSIFT,GMTSITD,X
133 S GMTSIFT=$$NOW^GMTSPREI,GMTSITD=$$DIFF(GMTSIFT,+$G(GMTSIST))
134 W !!,"HEALTH SUMMARY VERSION 2.7 INITIALIZATION COMPLETE!"
135 Q:'$L($T(FMDIFF^XLFDT))
136 S X=$G(GMTSIST) D REGDTM^GMTSU
137 W !!?9,"Initialization began at: ",X
138 S X=GMTSIFT D REGDTM^GMTSU
139 W !!?5,"Initialization completed at: ",X
140 W !!?7,"TOTAL Initialization Time: ",GMTSITD
141 Q
142DIFF(END,BEGIN) ; Converts time difference to external format
143 N DIFF,HR,MIN,SEC,Y
144 S DIFF=$$FMDIFF^XLFDT(END,BEGIN,2),HR=DIFF\3600
145 S MIN=DIFF\60,SEC=DIFF#60
146 S HR=$E("00",0,2-$L(HR))_HR,MIN=$E("00",0,2-$L(MIN))_MIN,SEC=$E("00",0,2-$L(SEC))_SEC
147 S Y=HR_":"_MIN_":"_SEC
148 Q Y
Note: See TracBrowser for help on using the repository browser.