BSDX32 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
;
;
ERROR ;
D ERR("RPMS Error")
Q
;
ERR(BSDXERR) ;Error processing
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
HOSPLOCD(BSDXY) ;EP Debugging entry point
;
;D DEBUG^%Serenji("HOSPLOC^BSDX32(.BSDXY)")
;
Q
;
HOSPLOC(BSDXY) ;EP
;Called by BSDX HOSPITAL LOCATION
;
N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA,BSDXSCOD
D ^XBKVAR S X="ERROR^BSDX32",@^%ZOSF("TRAP")
K ^BSDXTMP($J)
S BSDXY="^BSDXTMP("_$J_")"
S BSDXI=0
;"SELECT BSDXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
S ^BSDXTMP($J,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030DEFAULT_PROVIDER^T00030STOP_CODE_NUMBER^D00020INACTIVATE_DATE^D00020REACTIVATE_DATE"_$C(30)
;
S BSDXNAM="" F S BSDXNAM=$O(^SC("B",BSDXNAM)) Q:BSDXNAM="" D
. S BSDXIEN=$O(^SC("B",BSDXNAM,0))
. Q:'+BSDXIEN>0
. Q:'$D(^SC(+BSDXIEN,0))
. S BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505) ;INACTIVATE
. S BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506) ;REACTIVATE
. I BSDXINA]""&(BSDXREA="") Q ;Clinic is inactivated and has no reactivate date
. S BSDXNOD=^SC(BSDXIEN,0)
. S BSDXNAM=$P(BSDXNOD,U)
. S BSDXSCOD=$$GET1^DIQ(44,BSDXIEN_",",8) ;STOP CODE
. ;Calculate default provider
. S BSDXPRV=""
. I $D(^SC(BSDXIEN,"PR")) D
. . S BSDXIEN1=0 F S BSDXIEN1=$O(^SC(BSDXIEN,"PR",BSDXIEN1)) Q:'+BSDXIEN1 Q:BSDXPRV]"" D
. . . S BSDXNOD1=$G(^SC(BSDXIEN,"PR",BSDXIEN1,0))
. . . S:$P(BSDXNOD1,U,2)="1" BSDXPRV=$$GET1^DIQ(200,$P(BSDXNOD1,U),.01)
. . . Q
. . Q
. S BSDXI=BSDXI+1
. S ^BSDXTMP($J,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXPRV_U_BSDXSCOD_U_BSDXINA_U_BSDXREA_$C(30)
. Q
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
CLNSETD(BSDXY) ;EP Debugging entry point
;
;D DEBUG^%Serenji("CLNSET^BSDX32(.BSDXY)")
;
Q
;
CLNSET(BSDXY) ;EP
;Called by BSDX CLINIC SETUP
;Returns CLINIC SETUP file entries for clinics which
;are active in ^SC
N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA
N BSDXCRV,BSDXVSC,BSDXMULT,BSDXREQ,BSDXPCC
D ^XBKVAR S X="ERROR^BSDX32",@^%ZOSF("TRAP")
K ^BSDXTMP($J)
S BSDXY="^BSDXTMP("_$J_")"
S BSDXI=0
;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,
;GENERATE_PCCPLUS_FORMS? FROM CLINIC_SETUP_PARAMETERS
S ^BSDXTMP($J,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030CREATE_VISIT^T00030VISIT_SERVICE_CATEGORY^T00030MULTIPLE_CLINIC_CODES_USED?^T00030VISIT_PROVIDER_REQUIRED^T00030GENERATE_PCCPLUS_FORMS?^T00030MAX_OVERBOOKS"_$C(30)
;
S BSDXIEN=0 F S BSDXIEN=$O(^BSDSC(BSDXIEN)) Q:'+BSDXIEN D
. Q:'$D(^SC(+BSDXIEN,0))
. Q:'$D(^BSDSC(+BSDXIEN,0))
. S BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505) ;INACTIVATE
. S BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506) ;REACTIVATE
. I BSDXINA]""&(BSDXREA="") Q ;Clinic is inactivated and has no reactivate date
. S BSDXNOD=^BSDSC(BSDXIEN,0)
. S BSDXNAM=$$GET1^DIQ(44,BSDXIEN_",",.01)
. S BSDXMOB=$$GET1^DIQ(44,BSDXIEN_",",1918)
. S BSDXCRV=$$GET1^DIQ(9009017.2,BSDXIEN_",",.09)
. S BSDXVSC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.12)
. S BSDXMULT=$$GET1^DIQ(9009017.2,BSDXIEN_",",.13)
. S BSDXREQ=$$GET1^DIQ(9009017.2,BSDXIEN_",",.14)
. S BSDXPCC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.15)
. S BSDXI=BSDXI+1
. S ^BSDXTMP($J,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXCRV_U_BSDXVSC_U_BSDXMULT_U_BSDXREQ_U_BSDXPCC_U_BSDXMOB_$C(30)
. Q
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
BSDX32 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
+1 ;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
+2 ;
+3 ;
ERROR ;
+1 DO ERR("RPMS Error")
+2 QUIT
+3 ;
ERR(BSDXERR) ;Error processing
+1 SET BSDXI=BSDXI+1
+2 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+3 QUIT
+4 ;
HOSPLOCD(BSDXY) ;EP Debugging entry point
+1 ;
+2 ;D DEBUG^%Serenji("HOSPLOC^BSDX32(.BSDXY)")
+3 ;
+4 QUIT
+5 ;
HOSPLOC(BSDXY) ;EP
+1 ;Called by BSDX HOSPITAL LOCATION
+2 ;
+3 NEW BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA,BSDXSCOD
+4 DO ^XBKVAR
SET X="ERROR^BSDX32"
SET @^%ZOSF("TRAP")
+5 KILL ^BSDXTMP($JOB)
+6 SET BSDXY="^BSDXTMP("_$JOB_")"
+7 SET BSDXI=0
+8 ;"SELECT BSDXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
+9 SET ^BSDXTMP($JOB,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030DEFAULT_PROVIDER^T00030STOP_CODE_NUMBER^D00020INACTIVATE_DATE^D00020REACTIVATE_DATE"_$CHAR(30)
+10 ;
+11 SET BSDXNAM=""
FOR
SET BSDXNAM=$ORDER(^SC("B",BSDXNAM))
IF BSDXNAM=""
QUIT
Begin DoDot:1
+12 SET BSDXIEN=$ORDER(^SC("B",BSDXNAM,0))
+13 IF '+BSDXIEN>0
QUIT
+14 IF '$DATA(^SC(+BSDXIEN,0))
QUIT
+15 ;INACTIVATE
SET BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505)
+16 ;REACTIVATE
SET BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506)
+17 ;Clinic is inactivated and has no reactivate date
IF BSDXINA]""&(BSDXREA="")
QUIT
+18 SET BSDXNOD=^SC(BSDXIEN,0)
+19 SET BSDXNAM=$PIECE(BSDXNOD,U)
+20 ;STOP CODE
SET BSDXSCOD=$$GET1^DIQ(44,BSDXIEN_",",8)
+21 ;Calculate default provider
+22 SET BSDXPRV=""
+23 IF $DATA(^SC(BSDXIEN,"PR"))
Begin DoDot:2
+24 SET BSDXIEN1=0
FOR
SET BSDXIEN1=$ORDER(^SC(BSDXIEN,"PR",BSDXIEN1))
IF '+BSDXIEN1
QUIT
IF BSDXPRV]""
QUIT
Begin DoDot:3
+25 SET BSDXNOD1=$GET(^SC(BSDXIEN,"PR",BSDXIEN1,0))
+26 IF $PIECE(BSDXNOD1,U,2)="1"
SET BSDXPRV=$$GET1^DIQ(200,$PIECE(BSDXNOD1,U),.01)
+27 QUIT
End DoDot:3
+28 QUIT
End DoDot:2
+29 SET BSDXI=BSDXI+1
+30 SET ^BSDXTMP($JOB,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXPRV_U_BSDXSCOD_U_BSDXINA_U_BSDXREA_$CHAR(30)
+31 QUIT
End DoDot:1
+32 SET BSDXI=BSDXI+1
+33 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+34 QUIT
+35 ;
CLNSETD(BSDXY) ;EP Debugging entry point
+1 ;
+2 ;D DEBUG^%Serenji("CLNSET^BSDX32(.BSDXY)")
+3 ;
+4 QUIT
+5 ;
CLNSET(BSDXY) ;EP
+1 ;Called by BSDX CLINIC SETUP
+2 ;Returns CLINIC SETUP file entries for clinics which
+3 ;are active in ^SC
+4 NEW BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA
+5 NEW BSDXCRV,BSDXVSC,BSDXMULT,BSDXREQ,BSDXPCC
+6 DO ^XBKVAR
SET X="ERROR^BSDX32"
SET @^%ZOSF("TRAP")
+7 KILL ^BSDXTMP($JOB)
+8 SET BSDXY="^BSDXTMP("_$JOB_")"
+9 SET BSDXI=0
+10 ;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,
+11 ;GENERATE_PCCPLUS_FORMS? FROM CLINIC_SETUP_PARAMETERS
+12 SET ^BSDXTMP($JOB,BSDXI)="I00020HOSPITAL_LOCATION_ID^T00040HOSPITAL_LOCATION^T00030CREATE_VISIT^T00030VISIT_SERVICE_CATEGORY^T00030MULTIPLE_CLINIC_CODES_USED?^T00030VISIT_PROVIDER_REQUIRED^T00030GENERATE_PCCPLUS_FORMS?^T00030MAX_OVERBOOKS"_$CHA
R(30)
+13 ;
+14 SET BSDXIEN=0
FOR
SET BSDXIEN=$ORDER(^BSDSC(BSDXIEN))
IF '+BSDXIEN
QUIT
Begin DoDot:1
+15 IF '$DATA(^SC(+BSDXIEN,0))
QUIT
+16 IF '$DATA(^BSDSC(+BSDXIEN,0))
QUIT
+17 ;INACTIVATE
SET BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505)
+18 ;REACTIVATE
SET BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506)
+19 ;Clinic is inactivated and has no reactivate date
IF BSDXINA]""&(BSDXREA="")
QUIT
+20 SET BSDXNOD=^BSDSC(BSDXIEN,0)
+21 SET BSDXNAM=$$GET1^DIQ(44,BSDXIEN_",",.01)
+22 SET BSDXMOB=$$GET1^DIQ(44,BSDXIEN_",",1918)
+23 SET BSDXCRV=$$GET1^DIQ(9009017.2,BSDXIEN_",",.09)
+24 SET BSDXVSC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.12)
+25 SET BSDXMULT=$$GET1^DIQ(9009017.2,BSDXIEN_",",.13)
+26 SET BSDXREQ=$$GET1^DIQ(9009017.2,BSDXIEN_",",.14)
+27 SET BSDXPCC=$$GET1^DIQ(9009017.2,BSDXIEN_",",.15)
+28 SET BSDXI=BSDXI+1
+29 SET ^BSDXTMP($JOB,BSDXI)=BSDXIEN_U_BSDXNAM_U_BSDXCRV_U_BSDXVSC_U_BSDXMULT_U_BSDXREQ_U_BSDXPCC_U_BSDXMOB_$CHAR(30)
+30 QUIT
End DoDot:1
+31 SET BSDXI=BSDXI+1
+32 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+33 QUIT