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

BCHUTIL4.m

Go to the documentation of this file.
BCHUTIL4 ; IHS/CMI/LAB - UTILITIES ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;
UNREQ ;EP - CALLED FROM SCREENMAN SCREEN
 NEW BCHF
 F BCHF=3,4,5 D REQ^DDSUTL(BCHF,2,"ENTER CHR DATA",0)
 Q
CANNEDNG() ;EP - return canned narrative
 NEW BCHX
 ;*****CALLED FROM SCREENMAN
 S BCHX=$$GET^DDSVAL(90002.68,.DA,.04,"","I") I BCHX,$P($G(^BCHTSERV(BCHX,0)),U,4) D HLP^DDSUTL("You must type in a narrative for those services that pass to PCC") Q ""
 I $$GET^DDSVAL(90002.68,.DA,.01,"","I")="" Q "<???>"
 I $$GET^DDSVAL(90002.68,.DA,.04,"","I")="" Q $P(^BCHTPROB($$GET^DDSVAL(90002.01,.DA,.01,"","I"),0),U)
 Q $E($P(^BCHTPROB($$GET^DDSVAL(90002.68,.DA,.01,"","I"),0),U)_":"_$P(^BCHTSERV($$GET^DDSVAL(90002.68,.DA,.04,"","I"),0),U),1,80)
 ;
NARRPOST ;EP
 NEW BCHX
 I BCHWTD="Y",X="" S BCHWTD="N"
 I BCHWTD="Y",X]"" S DDSBR=5 Q
 I X]"",BCHWTD="N" S DDACT="CL" Q
 S BCHX=X
 I BCHX="" S BCHX=$$CANNEDN^BCHUTIL() D:BCHX]"" PUT^DDSVAL(DIE,.DA,.06,BCHX,"","E")
 I BCHX="" S DDSBR=2
 ;S DDACT="CL"
 Q
SC(Y) ;EP - called from input transform
 I $G(BCHPNP)=""!($G(BCHPNP)="N") Q 1
 I BCHPNP="P",$P(^BCHTSERV(Y,0),U,6) Q 1
 I BCHPNP="P",'$P(^BCHTSERV(Y,0),U,6) Q 0
 Q 1
 ;
PR(Y) ;EP - called from input transform
 ;I $G(BCHPNP)=""!($G(BCHPNP)="N") Q 1
 I $G(BCHPNP)="P",$P(^BCHTPROB(Y,0),U,2)="AM" Q 0
 I $G(BCHPNP)="P",$P(^BCHTPROB(Y,0),U,2)="LT" Q 0
 Q 1
SETNAR ;EP
 Q:X=""
 D PUT^DDSVAL(DIE,.DA,.06,$P(^BCHTCNAR(X,0),U,1),"","E")
 Q
SETDICS(PC,SC) ;EP
 NEW PCSC,SCE
 S SC=$G(SC)
 I SC S SCE=$P(^BCHTSERV(SC,0),U,3)
 S PC=$G(PC)
 I PC S PC=$P(^BCHTPROB(PC,0),U,2)
 S PCSC=PC_"-"_SCE
 I $D(^BCHTCNAR(Y,11,"B",SC))!($D(^BCHTSERV(Y,12,"B",PCSC))) Q 1
 Q 0
GETNARRG(PC,SC) ;
 K BCHCOUNT,BCHCANNN
 K ^BCHGRPDA(DA,81)
 NEW PCSC,SCE,C,X,PCN,V,N,Z
 S C=0
 S SC=$G(SC)
 S SCE=""
 I SC S SCE=$P(^BCHTSERV(SC,0),U,3)
 S PC=$G(PC)
 S PCN=""
 I PC S PCN=$P(^BCHTPROB(PC,0),U,1),PC=$P(^BCHTPROB(PC,0),U,2)
 S PCSC=PC_"-"_SCE
 ;CHECK PCSC FIRST IN ACOMB
 S O=0 F  S O=$O(^BCHTCNAR("ACOMB",PCSC,O)) Q:O'=+O  D
 .S X=0 F  S X=$O(^BCHTCNAR("ACOMB",PCSC,O,X)) Q:X'=+X  D
 ..Q:$P(^BCHTCNAR(X,0),U,2)'="G"
 ..S Z=$$VAL^XBDIQ1(90002.59,X,.01)
 ..I Z["DX-" S Z=Z_PC
 ..S C=C+1,BCHCANNN(O)=O_U_Z_""_U_X
 I $D(BCHCANNN) G SETG
 ;NOW CHECK SC
 S O=0 F  S O=$O(^BCHTCNAR("ASCO",SCE,O)) Q:O'=+O  D
 .S X=0 F  S X=$O(^BCHTCNAR("ASCO",SCE,O,X)) Q:X'=+X  D
 ..Q:$P(^BCHTCNAR(X,0),U,2)'="G"
 ..S C=C+1,BCHCANNN(O)=O_U_$$VAL^XBDIQ1(90002.59,X,.01)_""_U_X
 I $D(BCHCANNN) D SETG
 Q
SETG ;
 NEW X,C,Y
 S Y=0
 S C=0 F  S C=$O(BCHCANNN(C)) Q:C'=+C  D
 .S ^BCHGRPDA(DA,81,C,0)=C_U_$P(BCHCANNN(C),U,2)
 .S ^BCHGRPDA(DA,81,"B",C,C)=""
 .S ^BCHGRPDA(DA,81,0)="^90002.6881A^"_C_"^"_C
 .S BCHCOUNT=Y
 Q
 ;
NARRPREG ;EP
 I BCHWTD="Y",$$GET^DDSVAL(DIE,DA,.06,,"I")]"" S DDSBR=5 Q
 D HLP^DDSUTL("For services PC, HE, CF, CM, MP, EC and HS you must type a narrative.")
 Q
 ;
NARRPOSG ;EP
 NEW BCHX
 I BCHWTD="Y",X="" S BCHWTD="N"
 I BCHWTD="Y",X]"" S DDSBR=5 Q
 I X]"",BCHWTD="N" S DDACT="CL" Q
 S BCHX=X
 I BCHX="" S BCHX=$$CANNEDNG() D:BCHX]"" PUT^DDSVAL(DIE,.DA,.06,BCHX,"","E")
 I BCHX="" S DDSBR=2
 ;S DDACT="CL"
 Q
 ;
ADDNARRG ;EP
 NEW BCHX,BCHY
 I X="" Q
 S BCHX=$$GET^DDSVAL(DIE,DA,.06,,"E")
 S BCHY=$$GET^DDSVAL(DIE,DA,1101,,"E")
 S BCHX=BCHX_" "_BCHY
 D PUT^DDSVAL(DIE,DA,.06,BCHX,,"E")
 D PUT^DDSVAL(DIE,DA,1101,"",,"I")
 Q
SETGNAR ;EP - called from canned narrative block
 NEW BCHX,BCHY,BCHZ
 S BCHY=""
 S BCHX=0 F  S BCHX=$O(^BCHGRPDA(DA(1),92,BCHX)) Q:BCHX'=+BCHX  D
 .I BCHY]"" S BCHY=BCHY_". "
 .S BCHY=BCHY_$P($G(BCHCANNN($P(^BCHGRPDA(DA(1),92,BCHX,0),U,1))),U,2)
 I BCHY]"" S BCHY=BCHY_"" D PUT^DDSVAL(90002.68,DA(1),.06,$E(BCHY,1,158),,"E")
 Q