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

BMCSPDSP.m

Go to the documentation of this file.
BMCSPDSP ; IHS/PHXAO/TMJ - BMC - DISPLAY SECONDARY PROVIDER RECORDS FOR A SPECIFIC PT ;  
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;
 ; This routine displays a RCIS REFERRAL record with subordinate
 ; file entries.
 ;4.0 FCJ Changed to pull SR info fr RCIS REF file AND prt sec ref #
 ;
START ;
 ;
GETPAT ;EP GET-  PATIENT
 W !
 S APCDPAT=""
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S BMCPAT=+Y
 ;
ASK ;Ask for All Referrals or a Specific Referral
 S DIR(0)="SO^A:Display ALL Referrals;S:Display a Specific Referral",DIR("A")="Report should include: "
 S DIR("?")="If you wish to include only a Specific Referral - enter 'S'.  To include ALL Referrals enter an 'A'.  All Secondary Referrals will be Display for each Referral printed." D ^DIR K DIR
 I $D(DIRUT) S BMCQUIT="" G EOJ
 ;I Y<0 G EOJ
 I Y="A" S BMCALL=""
 I Y="S" S BMCSPEC=""
 I $D(BMCSPEC) D  G EOJ
 . D GETREF
 . I $D(BMCQUIT) Q
 . D DSPSPEC
 I $D(BMCALL) D DSPALL G EOJ
 ;
 Q
 ;
 ;
GETREF ; GET REFERRAL
 S BMCQ=1
 W !
 S DIC="^BMCREF(",DIC(0)="AEMQ",DIC("A")="Select RCIS REFERRAL by Patient or by Referral Date or #: "
 S DIC("S")="I $$FILTER^BMCFLTR(0,0,1)"
 D ^DIC K DIC
 I $D(DIRUT) S BMCQUIT="" G EOJ
 I Y<0 G EOJ
 S BMCRIEN=+Y
 S BMCQ=0
 Q
 ;
 ;
DSPALL ; DISPLAY ALL SECONDARY PROVIDERS FOR ALL REFERRALS FOR THIS PT
 ; 4.0 IHS/ITSC/FCJ;REWROTE SECTION
 S BMCRIEN=0,BMCT=0
 F  S BMCRIEN=$O(^BMCREF("D",BMCPAT,BMCRIEN)) Q:BMCRIEN'?1N.N  D
 .S BMCRNUMB=$P(^BMCREF(BMCRIEN,0),U,2)
 .Q:'$D(^BMCREF("S",BMCRNUMB))!$D(BMCTMP(BMCRNUMB))
 .S BMCY=0,BMCT=1,BMCTMP(BMCRNUMB)=""
 .F  S BMCY=$O(^BMCREF("S",BMCRNUMB,BMCY)) Q:BMCY'?1A.1N  D  Q:$D(DIRUT)
 ..S BMCSRIEN=0
 ..S BMCSRIEN=$O(^BMCREF("S",BMCRNUMB,BMCY,BMCSRIEN))
 .. S DIC="^BMCREF(",DA=BMCSRIEN,DIQ(0)="C"
 ..W !,"SECONDARY REFERRAL #:",$P(^BMCREF(DA,0),U,2),$P(^BMCREF(DA,1),U)
 .. D DIQ^BMCFMC
 .. I $E(IOST,1,2)'="P-" D PAUSE^BMC
 I BMCT=0 W !!,?10,"**NO SECONDARY REFERRALS ATTACHED TO THIS PATIENT'S REFERRALS**",!! D PAUSE^BMC Q
 Q
 ;
DSPSPEC ; DISPLAY SPECIFIC REFERRAL FOR A SPECIFIC PATIENT
 ; 4.0 IHS/ITSC/FCJ;REWROTE SECTION
 Q:'$D(BMCRIEN)
 S DIC="^BMCREF(",DA=BMCRIEN,DIQ(0)="C"
 W !,"SECONDARY REFERRAL #:",$P(^BMCREF(DA,0),U,2),$P(^BMCREF(DA,1),U)
 D DIQ^BMCFMC
 I $E(IOST,1,2)'="P-" D PAUSE^BMC
 Q
 ;
 ;
EOJ ;
 D:IO'=IO(0) ^%ZISC
 K BMCALL,BMCSPEC,BMCPAT,BMCQUIT,BMCRIEN,BMCSRIEN,BMCT,BMCTMP
 D ^BMCKILL
 Q