Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBDF14A

IBDF14A.m

Go to the documentation of this file.
  1. IBDF14A ;ALB/CJM - AICS LIST CLINIC SETUP ; JUL 20,1993
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;**25**;APR 24, 1997
  1. ;
  1. % ; -- entry point from ibdf14
  1. I '$D(VAUTD) G ^IBDF14
  1. D CLINICS,PRINT
  1. Q
  1. ;
  1. CLINICS ; -- get a list of clinics with setups defined
  1. S CNT=0
  1. S CLINIC="" F S CLINIC=$O(^SD(409.95,"B",CLINIC)) Q:'CLINIC D
  1. .S SETUP=$O(^SD(409.95,"B",CLINIC,""))
  1. .S NAME=$P($G(^SC(CLINIC,0)),"^")
  1. .S DIVIS=$P($G(^SC(CLINIC,0)),"^",15)
  1. .I DIVIS="" S DIVIS=$S(MULTI=0:$$PRIM^VASITE,MULTI=1:"Unknown",1:1)
  1. .I 'VAUTD,'$D(VAUTD(DIVIS)) Q ;if not all divisions or select div.
  1. .S:+DIVIS DIVIS=$P($G(^DG(40.8,+DIVIS,0)),"^")
  1. .I DIVIS="" S DIVIS="Unknown"
  1. .S:NAME]"" ^TMP($J,"IBCS",DIVIS,NAME)=CLINIC_"^"_SETUP,CNT(DIVIS)=$G(CNT(DIVIS))+1
  1. Q
  1. ;
  1. PRINT ; -- Main print driver for output
  1. W:$E(IOST,1,2)="C-" @IOF
  1. S NEWDIV=0
  1. S DIVIS="" F S DIVIS=$O(^TMP($J,"IBCS",DIVIS)) Q:DIVIS=""!IBQUIT S NEWDIV=1 D
  1. .S NAME="" F S NAME=$O(^TMP($J,"IBCS",DIVIS,NAME)) Q:NAME=""!IBQUIT S CLINIC=+^(NAME),SETUP=$P(^(NAME),"^",2) D Q:IBQUIT
  1. ..Q:'SETUP
  1. ..I $G(NEWDIV) D HEADER Q:IBQUIT W !?9,"Division: ",DIVIS,! S NEWDIV=0
  1. ..I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. ..W !,"Clinic: ",NAME I '$$ACLN^IBDFCNOF(CLINIC) W " (Clinic Currently Inactive)"
  1. ..D FORMS Q:IBQUIT
  1. ..D REPORTS Q:IBQUIT
  1. ..D EXCLUDE Q:IBQUIT
  1. ..W !
  1. .I 'VAUTD,$G(CNT(DIVIS))<1 D HEADER W !,"No clinics found for division '",DIVIS,"'",!
  1. I $E(IOST,1,2)="C-",'IBQUIT D PAUSE
  1. Q
  1. ;
  1. FORMS ; -- prints the clinic's encounter forms to the report
  1. S NODE=$G(^SD(409.95,SETUP,0))
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",2) I FORM W !,?5,"BASIC DEFAULT FORM: ..........................",$P($G(^IBE(357,FORM,0)),"^")
  1. S FORM=$P(NODE,"^",5) I FORM W !,?5,"FORM WITH NO PRE-PRINTED PATIENT DATA: .......",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",3) I FORM W !,?5,"SUPPLEMENTAL FORM - PATIENT WITH PRIOR VISITS: ",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",4) I FORM W !,?5,"SUPPLEMENTAL FORM - FIRST TIME PATIENT: ......",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",6) I FORM W !,?5,"SUPPLEMENTAL FORM - ALL PATIENTS: ............",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",8) I FORM W !,?5,"SUPPLEMENTAL FORM - ALL PATIENTS: ............",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",9) I FORM W !,?5,"SUPPLEMENTAL FORM - ALL PATIENTS: ............",$P($G(^IBE(357,FORM,0)),"^")
  1. I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. S FORM=$P(NODE,"^",7) I FORM W !,?5,"RESERVED FOR FUTURE USE: .....................",$P($G(^IBE(357,FORM,0)),"^")
  1. Q
  1. ;
  1. REPORTS ; -- prints the clinic's reports
  1. Q:'$O(^SD(409.95,SETUP,1,0))
  1. I ($Y>(IOSL-5)) D HEADER Q:IBQUIT
  1. W !!,?5,"REPORTS",?50,"PRINT CONDITION",!,?5,"=======",?50,"==============="
  1. S REPORT=0 F S REPORT=$O(^SD(409.95,SETUP,1,REPORT)) Q:'REPORT D Q:IBQUIT
  1. .I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. .S NODE=$G(^SD(409.95,SETUP,1,REPORT,0))
  1. .S INTRFACE=$P(NODE,"^"),COND=$P(NODE,"^",2)
  1. .I INTRFACE,COND S INTRFACE=$P($G(^IBE(357.6,INTRFACE,0)),"^"),COND=$P($G(^IBE(357.92,COND,0)),"^") W:INTRFACE]"" !,?5,INTRFACE,?50,COND
  1. Q
  1. ;
  1. EXCLUDE ; -- prints the division reports excluded from clinic
  1. Q:'$O(^SD(409.95,SETUP,2,0))
  1. I ($Y>(IOSL-5)) D HEADER Q:IBQUIT
  1. W !!,?5,"EXCLUDED REPORTS",!,?5,"================"
  1. S REPORT=0 F S REPORT=$O(^SD(409.95,SETUP,2,REPORT)) Q:'REPORT D Q:IBQUIT
  1. .I ($Y>(IOSL-3)) D HEADER Q:IBQUIT
  1. .S NODE=$G(^SD(409.95,SETUP,2,REPORT,0))
  1. .S INTRFACE=$P(NODE,"^")
  1. .I INTRFACE S INTRFACE=$P($G(^IBE(357.6,INTRFACE,0)),"^") W:INTRFACE]"" !,?5,INTRFACE
  1. Q
  1. ;
  1. I $E(IOST,1,2)="C-",$Y>1,PAGE>1 D PAUSE Q:IBQUIT
  1. I PAGE>1 W @IOF
  1. W !,"AICS Print Manager Clinic Setup Report",?IOM-32,IBHDT," PAGE ",PAGE
  1. W !,"For Division: ",DIVIS
  1. W !,$TR($J(" ",IOM)," ","-")
  1. S PAGE=PAGE+1
  1. Q
  1. ;
  1. PAUSE ; -- hold screen
  1. N DIR,X,Y
  1. F Q:$Y>(IOSL-2) W !
  1. S DIR(0)="E" D ^DIR S IBQUIT=$S(+Y:0,1:1)
  1. Q