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

APCDEFC1.m

Go to the documentation of this file.
APCDEFC1 ; IHS/CMI/LAB - APCD Auto Print PCC Encounter Form Compute ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;This routine will compute the automated PCC encounter form for
 ;a particular visit.  The visit IEN needs to be passed in for it
 ;to run.  This will typically be called after data entry.
 ;
 ;
VDXP ;EP--  v diagnostic procedure result to external
 S APCDDXP=$$VAL^XBDIQ1(9999999.68,$P(APCDTREC,U),.01)
 S APCDV=$P(APCDTREC,U,4)
 S APCDDXP(APCDDXP)=APCDV
 Q
 ;
VRAD ;EP--  v radiology to external
 S APCDRAD=$$VAL^XBDIQ1(71,$P(APCDTREC,U),.01)
 S APCDABN=$P(APCDTREC,U,5)
 S APCDRAD(APCDRAD)=APCDABN
 Q
 ;
VHF ;EP--  v health factors to external
 S APCDHF=$$VAL^XBDIQ1(9999999.64,$P(APCDTREC,U),.01)
 S APCDLS=$S($P(APCDTREC,U,4):$$EXTSET^XBFUNC(9000010.23,.04,$P(APCDTREC,U,4)),1:"")
 S APCDHF(APCDHF)=APCDLS
 Q
 ;
VMIC ;EP--  v microbiology to external
 S APCDMIC=$$VAL^XBDIQ1(60,$P(APCDTREC,U),.01)
 S APCDORG=$S($P(APCDTREC,U,4):$$VAL^XBDIQ1(61.2,$P(APCDTREC,U,4),.01),1:"")
 S APCDMIC(APCDMIC)=APCDORG
 Q
 ;
VBB ;EP--  v blood bank to external
 S APCDBB=$$VAL^XBDIQ1(60,$P(APCDTREC,U),.01)
 S APCDRES=$P(APCDTREC,U,4)
 S APCDAB=$S($P(APCDTREC,U,5):$$VAL^XBDIQ1(61.3,$P(APCDTREC,U,5),.01),1:"")
 S APCDBB(APCDBB)=APCDRES_U_APCDAB
 Q
 ;
VPHN ;EP--  v public health nurse to external
 S APCDTVDF=$G(APCDTREC)
 S APCDREC0=$G(^AUPNVPHN(APCDTVDF,0))
 S APCDREC1=$G(^AUPNVPHN(APCDTVDF,21))
 S APCDREC2=$G(^AUPNVPHN(APCDTVDF,22))
 S APCDREC3=$G(^AUPNVPHN(APCDTVDF,23))
 S APCDREC4=$G(^AUPNVPHN(APCDTVDF,24))
 S APCDPHN=$P(APCDREC0,U)
 S APCDRES=$S($P(APCDREC0,U,4):$$EXTSET^XBFUNC(9000010.32,.04,$P(APCDREC0,U,4)),1:"")
 S APCDLOI=$S($P(APCDREC0,U,5):$$EXTSET^XBFUNC(9000010.32,.05,$P(APCDREC0,U,5)),1:"")
 S APCDTOD=$S($P(APCDREC0,U,6):$$EXTSET^XBFUNC(9000010.32,.06,$P(APCDREC0,U,6)),1:"")
 S APCDPHN(APCDPHN)=APCDRES_U_APCDLOI_U_APCDTOD_U_APCDREC1_U_APCDREC2
 S APCDPHN(APCDPHN)=APCDPHN(APCDPHN)_U_APCDREC3_U_APCDREC4
 Q
 ;
VNT ;EP--  v narrative text to external
 S APCDTVDF=$G(APCDTREC)
 S APCDREC0=$G(^AUPNVNT(APCDTVDF,0))
 S APCDNT=$$VAL^XBDIQ1(9999999.89,$P(APCDREC0,U),.01)
 Q:'$D(^AUPNVNT(APCDTVDF,11,0))
 K ^UTILITY($J,"W")
 S APCDNDA=0 F  S APCDNDA=$O(^AUPNVNT(APCDTVDF,11,APCDNDA)) Q:'APCDNDA  D
 . S X=$G(^AUPNVNT(APCDTVDF,11,APCDNDA,0))
 . S DIWL=0,DIWR=80
 . D ^DIWP
 S APCDUDA="" F  S APCDUDA=$O(^UTILITY($J,"W",APCDUDA)) Q:APCDUDA=""  D
 . S APCDVDA=0 F  S APCDVDA=$O(^UTILITY($J,"W",APCDUDA,APCDVDA)) Q:'APCDVDA!(APCDUDA="")  D
 .. S APCDNT(APCDNT,APCDVDA)=$G(^UTILITY($J,"W",APCDUDA,APCDVDA,0))
 Q
 ;
VIF ;EP -- infant feeding choice
 S APCDTVDF=$G(APCDTREC)
 S APCDINF=$$EXTSET^XBFUNC(9000010.44,.01,$P(APCDTREC,U,1))
 S APCDINF(APCDINF)=""
 Q