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

ABMDAST.m

Go to the documentation of this file.
ABMDAST ; IHS/ASDST/DMJ - APC Visit Stuff ;  
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;
VAR S ABMP("ADT")=0,ABM("E")=9999999-ABMP("VDT")+1,ABM=ABM("E")-6
 F  S ABM=$O(^DPT(ABMP("PDFN"),"DA","AA",ABM)) Q:'ABM!(ABM>ABM("E"))  S ABM("D")=$O(^(ABM,0)) D  Q:ABMP("ADT")
 .Q:ABMP("VDT")>$P($G(^DPT(ABMP("PDFN"),"DA",ABM("D"),1)),U)  S ABMP("ADT")=ABM("D")
 S ABMP("VTYP")=$S(ABMP("ADT"):111,$P($G(^AAPCRCDS(ABMP("VDFN"),4)),U,14)'=3:131,1:111)
 I ABMP("VTYP")'=111 S ABM=0 F  S ABM=$O(^ABMNINS(DUZ(2),ABMP("INS"),1,ABM)) Q:'ABM  I ABM'=131,$P($G(^ABMDVTYP(ABM,0)),U,5)=ABMP("CLN") S ABMP("VTYP")=ABM Q
 K ABMP("DUP")
 I $P($G(^ABMNINS(DUZ(2),ABMP("INS"),1,ABMP("VTYP"),0)),U,7)="N" Q
 S ABMP("CDFN")=$O(^ABMDCLM(DUZ(2),"APC",ABMP("VDFN"),"")) G NEW:'+ABMP("CDFN")
 Q:'$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),0))  S ABMP("DUP")="" G INS1:$P(^(0),U,4)="F"
 S DA=ABMP("CDFN"),DIE="^ABMDCLM(DUZ(2),",DR=".42///Y" D ^ABMDDIE K DR Q
 ;
NEW ;new claim
 K DIC,DD,DO,DINUM S DIC="^ABMDCLM(DUZ(2),",DIC(0)="L",X=ABMP("PDFN")
 S DINUM=$$NXNM^ABMDUTL
 I DINUM="" D  Q
 .W !!,"ERROR: Claim not created - check global ^ABMDCLM(0)"
 .D EOP^ABMDUTL(1)
 K DD,DO D FILE^DICN S ABMP("CDFN")=+Y I +Y<1 Q
 L +^ABMDCLM(DUZ(2),ABMP("CDFN")):0 I '$T Q
 S DA=+Y,DIE=DIC,DR=".02////"_$P(ABMP("VDT"),".")_";.03////"_ABMP("LDFN")_";.04////"_"F"_";.06////"_ABMP("CLN")_";.07////"_ABMP("VTYP")_";.08////"_ABMP("INS") D ^DIE
VSIT S DA(1)=ABMP("CDFN"),DIC="^ABMDCLM(DUZ(2),"_DA(1)_",15,",DIC(0)="LE"
 S DIC("P")=$P(^DD(9002274.3,15,0),U,2)
 S (X,DINUM)=ABMP("VDFN")
 K DD,DO,DR D FILE^DICN
 K DIC
INS1 I '$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),13,"B",ABMP("INS"))) D ADD^ABMDE2E
 S ABM("C")="" F  S ABM("C")=$O(ABML(ABM("PRI"),ABMP("INS"),"COV",ABM("C"))) Q:'ABM("C")  I '$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),13,ABM("XIEN"),11,ABM("C"),0)) D ADDCOV^ABMDE2E
 ;
FRATE S ABMP("C0")=^ABMDCLM(DUZ(2),ABMP("CDFN"),0),ABMX("INS")=ABMP("INS") D FRATE^ABMDE2X1,EXP^ABMDE2X5 K ABMV,ABMX
 ;
 G ^ABMDAST1