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

APCHS1A.m

Go to the documentation of this file.
APCHS1A ; IHS/CMI/LAB - PART 1A OF APCHS -- SUMMARY PRODUCTION COMPONENTS ;
 ;;2.0;IHS PCC SUITE;**2,5,11**;MAY 14, 2009;Build 58
 ;IHS/CMI/LAB - added ssn and pcp to brief demo
 ;
BDEMOG ; ******************** BRIEF DEMOGRAPHICS ********************
 ; <SETUP>
 S APCHSN=^DPT(APCHSPAT,0)
 S APCHSNAM=$P(APCHSN,U,1)
 S Y=$P(APCHSN,U,3)
 I 'Y S APCHSDOB="<no date of birth recorded>"
 E  X ^DD("DD") S APCHSDOB=Y
 S APCHSADR=""
 I $D(^DPT(APCHSPAT,.11)) S APCHSN=^(.11) F APCHSI=1:1:6 S APCHSP=$P(APCHSN,U,APCHSI) I APCHSP]"" S:APCHSI=5 APCHSP=$P(^DIC(5,APCHSP,0),U,2) S APCHSADR=APCHSADR_","_APCHSP
 I $D(^DPT(APCHSPAT,.13)) S APCHHPH=$P($G(^DPT(APCHSPAT,.13)),U),APCHWPH=$P($G(^DPT(APCHSPAT,.13)),U,2)  ;IHS/CMI/GRL 
 S APCHSADR=$E(APCHSADR,2,255)
BDEMDSP ; <DISPLAY>
 X APCHSBRK
 I $$DOD^AUPNPAT(APCHSPAT)]""!($$VAL^XBDIQ1(9000001,APCHSPAT,1114)]"") D
 .W "*** DOD: ",$$VAL^XBDIQ1(2,APCHSPAT,.351),!
 .W "*** CAUSE OF DEATH: " I $$VAL^XBDIQ1(9000001,APCHSPAT,1114)]"" D  I 1
 ..W $$VAL^XBDIQ1(9000001,APCHSPAT,1114)
 ..K APCHSDSC
 ..S APCHSDSC=$$ICDD^ICDEX($$VAL^XBDIQ1(9000001,APCHSPAT,1114),"APCHSDSC",$$DOD^AUPNPAT(APCHSPAT)) I $P(APCHSDSC,U)=-1 S APCHSDSC(1)=$P($$ICDDX^ICDEX($P(^AUPNPAT(APCHSPAT,11),U,14),$$DOD^AUPNPAT(APCHSPAT)),U,4)
 ..K ^UTILITY($J,"W")
 ..S APCHSX=0
 ..S DIWL=0,DIWR=45 F  S APCHSX=$O(APCHSDSC(APCHSX)) Q:APCHSX'=+APCHSX!($D(APCHSQIT))  D
 ...S X=APCHSDSC(APCHSX)
 ...Q:X="CODE TEXT MAY BE INACCURATE"
 ...Q:X=" "
 ...D ^DIWP
 ..S APCHSZ=0 F  S APCHSZ=$O(^UTILITY($J,"W",DIWL,APCHSZ)) Q:APCHSZ'=+APCHSZ  D
 ...X APCHSCKP Q:$D(APCHSQIT)
 ...W ?28,^UTILITY($J,"W",DIWL,APCHSZ,0),!
 .E  W !
 K ^UTILITY($J,"W"),APCHSDSC,DIWL,APCHSX,APCHSZ,DIWL,DIWR
 Q:$D(APCHSQIT)
 W !,APCHSNAM,"    DOB: ",APCHSDOB,"    SSN: ",$$SSN^APCHS1(APCHSPAT),!  ;$P(^DPT(APCHSPAT,0),U,9),! ;IHS/CMI/LAB - added SSN
 I $D(DUZ(2)),DUZ(2),$D(^AUPNPAT(APCHSPAT,41,DUZ(2))) S APCHSFP=DUZ(2),APCHSFAC=$P(^AUPNPAT(APCHSPAT,41,APCHSFP,0),U,2) W $P(^DIC(4,APCHSFP,0),U,1)," HEALTH RECORD NUMBER: ",APCHSFAC,!
 W:APCHSADR]"" APCHSADR,!
 W "Home Phone: ",$S($G(APCHHPH)]"":APCHHPH,1:"None")_"     "_"Work Phone: ",$S($G(APCHWPH)]"":APCHWPH,1:"None"),! ;IHS/CMI/GRL
 S APCHPLNG=$$PREFLANG^APCLAPI7(APCHSPAT,DT,"E")
 I APCHPLNG]"" W "Preferred Language: ",APCHPLNG,!
 I $P($G(^AUPNPAT(APCHSPAT,40)),U,2)]"" W !,"Preferred Method of Receiving Reminders: ",$$VAL^XBDIQ1(9000001,APCHSPAT,4002),!
 I $O(^BDPRECN("C",APCHSPAT,0)) D BDPDISP^APCHS1 G BDEMOGX
 W:$P($G(^AUPNPAT(APCHSPAT,0)),U,14)]"" "DESIGNATED PRIMARY CARE PROVIDER:  ",$$VAL^XBDIQ1(9000001,.APCHSPAT,.14),!
 ;IHS/CMMI/LAB - added next 3 lines per ANMC 2/12/01
 W:$P($G(^BWP(APCHSPAT,0)),U,25) "WOMEN'S HEALTH DESIGNATED PROVIDER: ",$$VAL^XBDIQ1(9002086,APCHSPAT,.25),!
 W:$P($G(^AUPNPAT(APCHSPAT,17)),U,1) "PRIMARY MENTAL HEALTH PROVIDER: ",$E($$VAL^XBDIQ1(9000001,APCHSPAT,1701),1,22),!
 W:$P($G(^AUPNPAT(APCHSPAT,17)),U,4) "SECONDARY MENTAL HEALTH PROVIDER: ",$$VAL^XBDIQ1(9000001,APCHSPAT,1704),!
 ; <CLEANUP>
BDEMOGX K APCHSN,APCHSFP,APCHSFAC,APCHSNAM,APCHSDOB,APCHSADR,APCHSP,APCHSI
 K APCHHPH,APCHWPH
 Q
 ;
HOMELOC ; ******************** LOCATION OF HOME ********************
 ; <SETUP>
 Q:'$O(^AUPNPAT(APCHSPAT,12,0))
 X APCHSBRK
 ; <DISPLAY>
 F APCHSI=0:0 S APCHSI=$O(^AUPNPAT(APCHSPAT,12,APCHSI)) Q:'APCHSI  X APCHSCKP Q:$D(APCHSQIT)  W ^AUPNPAT(APCHSPAT,12,APCHSI,0),!
 ; <CLEANUP>
HOMELOCX K APCHSI
 Q