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

APCHS.m

Go to the documentation of this file.
APCHS ; IHS/CMI/LAB - PCC HEALTH SUMMARY ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;fixed CMS display
 ;
VERSION ;;2.0
 ;
 W !!,"* * *  H E A L T H  S U M M A R Y  P R O G R A M  (",$P($T(VERSION),";",3),")  * * *",!!
 S ^DISV($I,"^%ZIS(1,")=$O(^%ZIS(1,"C",$I,"")) ; SET DEFAULT OUTPUT DEVICE
 ;
SELTYP K DIC S DIC=9001015,DIC("A")="Select health summary type: ",DIC(0)="AEQM"
 S X="" I DUZ(2),$D(^APCCCTRL(DUZ(2),0))#2 S X=$P(^(0),U,3)
 I $D(^DISV(DUZ,"^APCHSCTL(")) S Y=^("^APCHSCTL(") I $D(^APCHSCTL(Y,0)) S X=$P(^(0),U,1)
 S:X="" X="ADULT REGULAR"
 S DIC("B")=X
 D ^DIC K DIC I Y>0 S APCHSTYP=+Y D SELPT W ! G SELTYP
 G END
SELPT ;PEP-select patients
 K DIC S DIC=9000001,DIC("A")="Select patient: ",DIC(0)="AEQM" D ^DIC K DIC I Y>0 S APCHSPAT=+Y W:$D(^AUPNPAT(APCHSPAT,41,DUZ(2),0)) !,"Patient's chart number is ",$P(^(0),U,2),! D HSOUT G SELPT
 ;
END ;
 K X,Y,POP,DIR,DIRUT,DUOUT
 D EOJ
 D KILL^AUPNPAT
 K DIC,DA
 Q
 ;
HSOUT ; OUTPUT SUMMARY, WITH DEVICE CONTROL
 K ZTSK
 K IOP,%ZIS S %ZIS="PQM" D ^%ZIS I POP S IO=IO(0) Q
 G:$D(IO("Q")) QUE
NOQUE S ^DISV($I,"^%ZIS(1,")=$O(^%ZIS(1,"C",IO,""))
 D EN
 D ^%ZISC
 Q
QUE K ZTSAVE F APCHSP="APCHSPAT","APCHSTYP" S ZTSAVE(APCHSP)=""
 S ZTRTN="EN^APCHS",ZTDESC="HEALTH SUMMARY",ZTIO=ION,ZTDTH=DT
 D ^%ZTLOAD
 D HOME^%ZIS
 K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,APCHSP
 Q
 ;
 ; SPECIAL ENTRY POINTS TO HIDE APCHS-APCHS0 SPLIT
 ;
EN ;PEP - PUBLISHED ENTRY POINT - PRINT SUMMARY FOR PATIENT
 G ^APCHS0 ; TRANSFER TO CONTINUATION ROUTINE
 ;
 ; THE FOLLOWING LABELS BRANCH TO CONTINUATION ROUTINE TO PRESERVE
 ; EXISTING ENTRY POINTS USED INTERNALLY BY THE PACKAGE
 ;
BREAK ;ENTRY POINT
 G BREAK^APCHS0
 G HEADER^APCHS0
ENREG ;EP - entry point to display CMS register(s) patient is on, then
 ; ask for summary type
 W !!,"* * *  H E A L T H  S U M M A R Y  P R O G R A M  (",$P($T(VERSION),";",3),")  * * *",!!
 S ^DISV($I,"^%ZIS(1,")=$O(^%ZIS(1,"C",$I,"")) ; SET DEFAULT OUTPUT DEVICE
 ;
GETPT K DIC S DIC=9000001,DIC("A")="Select patient: ",DIC(0)="AEQM" D ^DIC I Y>0 S APCHSPAT=+Y W:$D(^AUPNPAT(APCHSPAT,41,DUZ(2),0)) !,"Patient's chart number is ",$P(^(0),U,2),! D DSPCMSRG,GETTYP G GETPT
 I $D(DUOUT)!($D(DTOUT)) G DONE
DONE K APCHSTYP,APCHSPAT,POP,X,Y
 D EOJ
 K AUPNPAT,AUPNDOB,AUPNDOD,AUPNSEX
 K DIC
 Q
DSPCMSRG ; EP - display membership in CMS register
 Q:'$D(^ACM(41,"D",APCHSPAT))
 S APCHSJ=1
 F APCHSI=0:0 S APCHSI=$O(^ACM(41,"AC",APCHSPAT,APCHSI)) Q:'APCHSI  I $P(^ACM(41.1,APCHSI,0),U,7) W:APCHSJ "ON CMS REGISTER(S): " D
 .S APCHSJ=0 W ?21,$P(^ACM(41.1,APCHSI,0),U)
 .S APCHSK=^ACM(41,"AC",APCHSPAT,APCHSI) W "  Status: ",$$VAL^XBDIQ1(9002241,APCHSK,1),! ;IHS/CMI/LAB - display was not consistent with CMS
 Q
GETTYP ; EP - get health summary TYPE
 K DIC S DIC=9001015,DIC("A")="Select health summary type: ",DIC(0)="AEQM"
 S X="" I DUZ(2),$D(^APCCCTRL(DUZ(2),0))#2 S X=$P(^(0),U,3)
 I $D(^DISV(DUZ,"^APCHSCTL(")) S Y=^("^APCHSCTL(") I $D(^APCHSCTL(Y,0)) S X=$P(^(0),U,1)
 S:X="" X="ADULT REGULAR"
 S DIC("B")=X
 D ^DIC I Y>0 S APCHSTYP=+Y
 Q:$D(DUOUT)
 Q:$D(APCHSBRW)
 D HSOUT
 Q
EN1 ;PEP ;IHS/CMI/LAB - added per G. Shorr
 N APCHSIOF
 S APCHSIOF=1
 G ^APCHS0
 ;
EOJ ;PEP - end of job clean up can be called by other applications that call the Health Summary
 D EN^XBVK("APCH")
 Q