source: Scheduling/trunk/m/BSDX32.m@ 1050

Last change on this file since 1050 was 1041, checked in by Sam Habiel, 14 years ago

Updated routines version to 1.42

File size: 3.5 KB
Line 
1BSDX32 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/29/10 10:21am
2 ;;1.42;BSDX;;Dec 07, 2010
3 ;
4 ;
5ERROR ;
6 D ERR("RPMS Error")
7 Q
8 ;
9ERR(BSDXERR) ;Error processing
10 S BSDXI=BSDXI+1
11 S ^BSDXTMP($J,BSDXI)=$C(31)
12 Q
13 ;
14HOSPLOCD(BSDXY) ;EP Debugging entry point
15 ;
16 ;D DEBUG^%Serenji("HOSPLOC^BSDX32(.BSDXY)")
17 ;
18 Q
19 ;
20HOSPLOC(BSDXY) ;EP
21 ;Called by BSDX HOSPITAL LOCATION
22 ;Returns all hospital locations that are active
23 ;
24 N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA,BSDXSCOD
25 D ^XBKVAR S X="ERROR^BSDX32",@^%ZOSF("TRAP")
26 K ^BSDXTMP($J)
27 S BSDXY="^BSDXTMP("_$J_")"
28 S BSDXI=0
29 ;"SELECT BSDXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
30 S ^BSDXTMP($J,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030DEFAULT_PROVIDER^T00030STOP_CODE_NUMBER^D00020INACTIVATE_DATE^D00020REACTIVATE_DATE"_$C(30)
31 ;
32 S BSDXNAM="" F S BSDXNAM=$O(^SC("B",BSDXNAM)) Q:BSDXNAM="" D
33 . S BSDXIEN=$O(^SC("B",BSDXNAM,0))
34 . Q:'+BSDXIEN>0
35 . Q:'$D(^SC(+BSDXIEN,0))
36 . ;Q:'$$INDIV^BSDX01(+BSDXIEN) ; if not in the same division, quit
37 . S BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505) ;INACTIVATE
38 . S BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506) ;REACTIVATE
39 . I BSDXINA]""&(BSDXREA="") Q ;Clinic is inactivated and has no reactivate date
40 . S BSDXNOD=^SC(BSDXIEN,0)
41 . S BSDXNAM=$P(BSDXNOD,U)
42 . S BSDXSCOD=$$GET1^DIQ(44,BSDXIEN_",",8) ;STOP CODE
43 . ;Calculate default provider
44 . S BSDXPRV=""
45 . I $D(^SC(BSDXIEN,"PR")) D
46 . . S BSDXIEN1=0 F S BSDXIEN1=$O(^SC(BSDXIEN,"PR",BSDXIEN1)) Q:'+BSDXIEN1 Q:BSDXPRV]"" D
47 . . . S BSDXNOD1=$G(^SC(BSDXIEN,"PR",BSDXIEN1,0))
48 . . . S:$P(BSDXNOD1,U,2)="1" BSDXPRV=$$GET1^DIQ(200,$P(BSDXNOD1,U),.01)
49 . . . Q
50 . . Q
51 . S BSDXI=BSDXI+1
52 . S ^BSDXTMP($J,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXPRV_U_BSDXSCOD_U_BSDXINA_U_BSDXREA_$C(30)
53 . Q
54 S BSDXI=BSDXI+1
55 S ^BSDXTMP($J,BSDXI)=$C(31)
56 Q
57 ;
58CLNSETD(BSDXY) ;EP Debugging entry point
59 ;
60 ;D DEBUG^%Serenji("CLNSET^BSDX32(.BSDXY)")
61 ;
62 Q
63 ;
64CLNSET(BSDXY) ;EP
65 ;Called by BSDX CLINIC SETUP
66 ;Returns CLINIC SETUP file entries for clinics which
67 ;are active in ^SC
68 N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA
69 N BSDXCRV,BSDXVSC,BSDXMULT,BSDXREQ,BSDXPCC
70 D ^XBKVAR S X="ERROR^BSDX32",@^%ZOSF("TRAP")
71 K ^BSDXTMP($J)
72 S BSDXY="^BSDXTMP("_$J_")"
73 S BSDXI=0
74 ;SELECT BMXIEN 'HOSPITAL_LOCATION_ID', CLINIC_NAME 'HOSPITAL_LOCATION', CREATE_VISIT_AT_CHECK-IN? 'CREATE_VISIT', VISIT_SERVICE_CATEGORY, MULTIPLE_CLINIC_CODES_USED?, VISIT_PROVIDER_REQUIRED,
75 ;GENERATE_PCCPLUS_FORMS? FROM CLINIC_SETUP_PARAMETERS
76 S ^BSDXTMP($J,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030CREATE_VISIT^T00030VISIT_SERVICE_CATEGORY^T00030MULTIPLE_CLINIC_CODES_USED?^T00030VISIT_PROVIDER_REQUIRED^T00030GENERATE_PCCPLUS_FORMS?"_$C(30)
77 ;
78 S BSDXIEN=0 F S BSDXIEN=$O(^BSDSC(BSDXIEN)) Q:'+BSDXIEN D
79 . Q:'$D(^SC(+BSDXIEN,0))
80 . Q:'$D(^BSDSC(+BSDXIEN,0))
81 . S BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505) ;INACTIVATE
82 . S BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506) ;REACTIVATE
83 . I BSDXINA]""&(BSDXREA="") Q ;Clinic is inactivated and has no reactivate date
84 . S BSDXNOD=^BSDSC(BSDXIEN,0)
85 . S BSDXNAM=$$GET1^DIQ(44,BSDXIEN_",",.01)
86 . S BSDXCRV=$$GET1^DIQ(9009017.2,BSDXIEN_",",.09)
87 . S BSDXVSC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.12)
88 . S BSDXMULT=$$GET1^DIQ(9009017.2,BSDXIEN_",",.13)
89 . S BSDXREQ=$$GET1^DIQ(9009017.2,BSDXIEN_",",.14)
90 . S BSDXPCC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.15)
91 . S BSDXI=BSDXI+1
92 . S ^BSDXTMP($J,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXCRV_U_BSDXVSC_U_BSDXMULT_U_BSDXREQ_U_BSDXPCC_$C(30)
93 . Q
94 S BSDXI=BSDXI+1
95 S ^BSDXTMP($J,BSDXI)=$C(31)
96 Q
Note: See TracBrowser for help on using the repository browser.