source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SD5USTOP.m@ 1375

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1SD5USTOP ;ALB/CAW,GTS,ESD,JAM,GT - Stop Code/DSS Identifier Update 2/10/2005
2 ;;5.3;Scheduling;**428**;AUG 13, 1993
3 ;
4 ;** This patch is used as a Post-Init in a KIDS build to modify the
5 ;** the DSS Identifier file [^DIC(40.7,]
6 ;
7EN ;** Add/inactivate/change/reactivate DSS IDs (stop codes)
8 ;** The following code executes if file modifications exist
9 ;
10 N SDVAR
11 D:$P($T(NEW+1),";;",2)'="QUIT" ADD
12 D:$P($T(CHNG+1),";;",2)'="QUIT" CHANGE
13 Q
14 ;
15 ;
16ADD ;** Add DSS IDs
17 ;
18 ; SDXX is in format:
19 ; STOP CODE NAME^AMIS #^RESTRICTION TYPE^REST. DATE^CDR #
20 ;
21 N SDX,SDXX
22 S SDVAR=1
23 D MES^XPDUTL("")
24 D BMES^XPDUTL(">>> Adding new Clinic Stops (DSS IDs) to CLINIC STOP File (#40.7)...")
25 ;
26 ;** NOTE: The following line is for DSS IDs that are not yet active
27 D BMES^XPDUTL(" [NOTE: These Stop Codes CANNOT be used UNTIL 2/1/05]")
28 S DIC(0)="L",DLAYGO=40.7,DIC="^DIC(40.7,"
29 F SDX=1:1 K DD,DO,DA S SDXX=$P($T(NEW+SDX),";;",2) Q:SDXX="QUIT" DO
30 .S DIC("DR")="1////"_$P(SDXX,"^",2)_$S('+$P(SDXX,U,5):"",1:";4////"_$P(SDXX,"^",5))
31 .S DIC("DR")=DIC("DR")_";5////"_$P(SDXX,"^",3)_";6///"_$P(SDXX,"^",4)
32 .S X=$P(SDXX,"^",1)
33 .I '$D(^DIC(40.7,"C",$P(SDXX,"^",2))) D FILE^DICN,MESS Q
34 .;I $D(^DIC(40.7,"C",$P(SDXX,"^",2))) D EDIT(SDXX),MESSEX
35 K DIC,DLAYGO,X
36 Q
37 ;
38EDIT(SDXX) ;- Edit fields w/new values if stop code record already exists
39 ;
40 Q:$G(SDXX)=""
41 N DA,DIE,DLAYGO,DR
42 S DA=+$O(^DIC(40.7,"C",+$P(SDXX,"^",2),0))
43 Q:'DA
44 S DIE="^DIC(40.7,",DR=".01////"_$P(SDXX,"^")_";1////"_$P(SDXX,"^",2)_";2////@"_$S('+$P(SDXX,U,5):"",1:";4////"_$P(SDXX,"^",5))_";5////"_$P(SDXX,"^",3)_";6///"_$P(SDXX,"^",4)
45 D ^DIE
46 Q
47 ;
48CHANGE ;** Change DSS ID names
49 ;
50 ; SDXX is in format:
51 ; STOP CODE NAME^AMIS #^^NEW STOP CODE NAME
52 ;
53 N SDX,SDXX,SDDA
54 S SDVAR=1
55 D MES^XPDUTL("")
56 D BMES^XPDUTL(">>> Changing Clinic Stop (DSS ID) names in CLINIC STOP File (#40.7)...")
57 F SDX=1:1 K DD,DO,DA S SDXX=$P($T(CHNG+SDX),";;",2) Q:SDXX="QUIT" DO
58 .S SDDA=+$O(^DIC(40.7,"C",$P(SDXX,U,2),0))
59 .I $D(^DIC(40.7,SDDA,0)) DO
60 ..S DA=SDDA,DR=".01///"_$P(SDXX,U,4),DIE="^DIC(40.7,"
61 ..D ^DIE,MESC
62 K DIE,DR,DA
63 Q
64 ;
65MESS ;** Add message
66 N ECXADMSG
67 I +$G(SDVAR) D HDR(SDVAR)
68 D MES^XPDUTL(" ")
69 S ECXADMSG="Added: "_$P(SDXX,"^",2)_" "_$P(SDXX,"^")
70 I $P(SDXX,"^",5)'="" S ECXADMSG=ECXADMSG_" [CDR#: "_$P(SDXX,"^",5)_"]"
71 D MES^XPDUTL(ECXADMSG)
72 I $P(SDXX,"^",3)'="" S ECXADMSG=" Restricted Type: "_$P(SDXX,"^",3)_" Restricted Date: "_$P(SDXX,"^",4)
73 D MES^XPDUTL(ECXADMSG)
74 K SDVAR
75 Q
76 ;
77MESSEX ;** Display message if stop code already exists
78 N ECXADMSG
79 I +$G(SDVAR) D HDR(SDVAR)
80 D MES^XPDUTL(" ")
81 S ECXADMSG=" "_$P(SDXX,"^",2)_" "_$P(SDXX,"^")_" already exists."
82 D MES^XPDUTL(ECXADMSG)
83 K SDVAR
84 Q
85 ;
86MESC ;** Change message
87 N SDCMSG,SDCMSG1
88 I +$G(SDVAR) D HDR(SDVAR)
89 D MES^XPDUTL(" ")
90 S SDCMSG="Changed: "_$P(SDXX,U,2)_" "_$P(SDXX,U)
91 S SDCMSG1=" to: "_$P(SDXX,U,2)_" "_$P(SDXX,U,4)
92 D MES^XPDUTL(SDCMSG)
93 D MES^XPDUTL(SDCMSG1)
94 K SDVAR
95 Q
96 ;
97HDR(SDVAR) ;- Header
98 Q:'$G(SDVAR)
99 N SDHDR
100 S SDHDR=$P($T(@("HDR"_SDVAR)),";;",2)
101 D BMES^XPDUTL(SDHDR)
102 Q
103 ;
104 ;
105HDR1 ;; Stop Code Name
106 ;
107HDR2 ;; CDR Stop Code Name
108 ;
109HDR3 ;; Stop Code Name Rest. Type Date
110 ;
111NEW ;DSS IDs to add- ex ;;STOP CODE NAME^NUMBER^RESTRICTION TYPE^RESTRICTION DATE^CDR
112 ;;QUIT
113 ;
114CHNG ;DSS ID name changes- example ;;STOP CODE NAME^NUMBER^^NEW NAME
115 ;;PMRS CWT/SE NON-F TO F (MASNONCT)^223^^PMRS CWT/SE NON-F TO F (MAS NO
116 ;;PMRS CWT/TWE NON-F TO F (MASNONCT)^228^^PMRS CWT/TWE NON-F TO F (MAS N
117 ;;VISOR (VISUAL IMPAIRMENT OUTPATIENT PROGRAM)^220^^VISOR (VISL IMPRMT OUTPAT PGM)
118 ;;MH CWT/SE NON-F TO F (MAS NONCT^569^^MH CWT/SE NON-F TO F (MAS NONC
119 ;;MH CWT/TWE NON-F TO F (MAS NONCT^570^^MH CWT/TWE NON-F TO F (MAS NON
120 ;;NONVIDEO HOME TELEHEALTH INTERVENTION^684^^NONVIDEO HOME TELEHLTH INTRVNT
121 ;;QUIT
Note: See TracBrowser for help on using the repository browser.