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

AGED4B.m

Go to the documentation of this file.
AGED4B ; IHS/ASDS/EFG - PAGE 5 - AUTO/LIABILITY, WORKMAN'S COMP PAGE ;    [ 05/13/2003  1:19 PM ]
 ;;7.0;IHS PATIENT REGISTRATION;**1,2**;MAR 28, 2003
 ;
 S AG("N")=13
 I '$D(AGAIN) D GETAW2
 S AGAIN=""
VAR D DRAW
 Q:$D(AGSEENLY)
 W !,AGLINE("EQ")
 K DIR
 S DIR("A")="CHANGE which item? (1-"_AG("N")_") NONE// "
 D READ^AGED1
 G:$D(AG("ED"))&'$D(AGXTERN) @("^AGED"_AG("ED"))
 G END:$D(DLOUT)!(Y["N")!$D(DUOUT),VAR:$D(AG("ERR"))
 Q:$D(DFOUT)!$D(DTOUT)
 I $D(DQOUT)!(+Y<1)!(+Y>AG("N")) W !!,"You must enter a number from 1 to ",AG("N") H 2 G VAR
 S AG("C")="DTACC,DESCAI,RESPINS,RESPSSN,POLNO,APATATTY,DTWC,DTCLOSE,DESCWI,EMPL,CLMFIL,CLMNO,WPATATTY"
 S AGY=Y
 F AGI=1:1 S AG("SEL")=+$P(AGY,",",AGI) Q:AG("SEL")<1!(AG("SEL")>AG("N"))  D @($P(AG("C"),",",AG("SEL")))
 D UPDATE1^AGED(DUZ(2),DFN,3,"")
 K AGI,AGY
 G VAR
END K AG,DLOUT,DTOUT,DFOUT,DQOUT,DA,DIC,DR,AGSCRN,Y,ADA,WDA,ADT,WDT,ADFN,WDFN,REC
 Q:$D(AGXTERN)
 Q:$D(DIROUT)
 Q:$D(AGSEENLY)
 G ^AGED4A:$D(DUOUT)
 G ^AGED13
 Q
DRAW ; EP
 S AG("PG")=5
 S DA=DFN
 D ^AGED
 K ^UTILITY("DIQ1",$J)
 W !,"-- AUTO OR LIABILITY INSURANCE " F A=1:1:47 W "-"
 D GETAW
 Q
GETAW2 ;
 S (AD0,REC,ADFN)=""
 F  S REC=$O(^AUPNAUTO("C",DFN,REC)) Q:'REC  D
 . S ADFN=$P($G(^AUPNAUTO(REC,0)),U,2)
 . I ADFN=DFN S AD0=REC
 S (WD0,REC,WDFN)=""
 F  S REC=$O(^AUPNWRKC("C",DFN,REC)) Q:'REC  D
 . S WDFN=$P($G(^AUPNWRKC(REC,0)),U,2)
 . I WDFN=DFN S WD0=REC
 Q
 ;
GETAW ; GET LAST ENTRY FROM AUTO,LIAB/WC
 F AG=1:1:13 D
 . S AGSCRN=$P($T(@1+AG),";;",2,14)
 . S DIC=$P(AGSCRN,U,3)
 . S DR=$P(AGSCRN,U,4)
 . I AG=7 W !,"-- WORKMAN'S COMPENSATION " F A=1:1:52 W "-"
 . W !,AG,".",?(29-$L($P(^DD(DIC,DR,0),U))),$P(^DD(DIC,DR,0),U)," :  "
 . I AG>0&(AG<7)&(AD0>0) S D0=AD0 W $$GET1^DIQ(DIC,D0,DR)
 . I AG>6&(AG<14)&(WD0>0) S D0=WD0 W $$GET1^DIQ(DIC,D0,DR)
 Q
AMSG ; DISPLAY THIS MSG IF THERE NO ENTRY IN THE AUTO/LIAB
 ; GLOBAL
 W !,"You must first enter the DATE OF AUTO/LIAB INJURY"
 Q
 ;
WMSG ; DISPLAY THIS MSG IF THERE IS NO ENTRY IN THE WORKMAN'S
 ; COMP GLOBAL
 W !,"You must first enter the DATE OF WC INJURY"
 Q
 ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; AUTO/LIAB ACCIDENT FIELDS
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;
DTACC ; DATE OF AUTO/LIAB INJURY
 W !
 K DIC,DIE,DR,DA
 S DIC="^AUPNAUTO("
 S DLAYGO=9000031
 S DIC(0)="AEMLQZ"
 S DIC("S")="I $P(^(0),U,2)="_DFN
 I AD0>0  D
 . S Y=$P(^AUPNAUTO(AD0,0),U,1) D DD^%DT
 . S DIC("B")=Y
 K DD,DO
 D ^DIC S AD0=+Y Q:+Y'>0
 K DIC,DR,DIE
 S DA=AD0
 S DIE="^AUPNAUTO("
 ;S DR=".01;.02///^S X=DFN"  ;IHS/SD/EFG  AG*7*2  #4
 S DR=".01;.02////^S X=DFN"  ;IHS/SD/EFG  AG*7*2  #4
 D ^DIE
 K DIC,DR,DIE
 Q
DESCAI ; DESCRIPTION OF AUTO ACCIDENT INJURY
 I '$D(^AUPNAUTO("C",DFN)) D AMSG H 2 D DRAW G DTACC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNAUTO("
 S DA=AD0
 S DR=.03
 D ^DIE
 K DIC,DR,DIE,DA
 Q
RESPINS ; RESPONSIBLE PARTY INSURANCE COMPANY
 I '$D(^AUPNAUTO("C",DFN)) D AMSG H 2 D DRAW G DTACC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNAUTO("
 S DA=AD0
 S DR=.04
 D ^DIE
 K DIC,DR,DIE,DA
 Q
RESPSSN ; RESPONSIBLE PARTY SSN
 I '$D(^AUPNAUTO("C",DFN)) D AMSG H 2 D DRAW G DTACC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNAUTO("
 S DA=AD0
 S DR=.07
 D ^DIE
 K DIC,DR,DIE,DA
 Q
POLNO ; INSURANCE POLICY NUMBER
 I '$D(^AUPNAUTO("C",DFN)) D AMSG H 2 D DRAW G DTACC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNAUTO("
 S DA=AD0
 S DR=.05
 D ^DIE
 K DIC,DR,DIE,DA
 Q
APATATTY ; NAME OF PATIENT'S ATTORNEY FOR ACCIDENT/LIAB
 I '$D(^AUPNAUTO("C",DFN)) D AMSG H 2 D DRAW G DTACC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNAUTO("
 S DA=AD0
 S DR=.06
 D ^DIE
 K DIC,DR,DIE,DA
 Q
 ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; WORKMAN'S COMP INJURY FIELDS
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;
DTWC ; DATE OF WORKMAN'S COMP INJURY
 W !
 K DIC,DIE,DR,DA
 S DIC="^AUPNWRKC("
 S DLAYGO=9000032
 S DIC(0)="AEMLQZ"
 S DIC("S")="I $P(^(0),U,2)="_DFN
 I WD0>0  D
 . S Y=$P(^AUPNWRKC(WD0,0),U,1) D DD^%DT
 . S DIC("B")=Y
 K DD,DO
 D ^DIC S WD0=+Y Q:+Y'>0
 K DIC,DR,DIE
 S DA=WD0
 S DIE="^AUPNWRKC("
 ;S DR=".01;.02///^S X=DFN"  ;IHS/SD/EFG  AG*7*2  #4
 S DR=".01;.02////^S X=DFN"  ;IHS/SD/EFG  AG*7*2  #4
 D ^DIE
 K DIC,DR,DIE
 Q
DTCLOSE ; DATE CASE CLOSED
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.08
 D ^DIE
 K DIC,DR,DIE,DA
 Q
DESCWI ; DESCRIPTION OF WORKMAN'S COMP INJURY
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.03
 D ^DIE
 K DIC,DR,DIE,DA
 Q
CLMFIL ; WAS CLAIM FILED
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.04
 D ^DIE
 K DIC,DR,DIE,DA
 Q
CLMNO ; CLAIM NUMBER
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.05
 D ^DIE
 K DIC,DR,DIE,DA
 Q
WPATATTY ; NAME OF PATIENT'S ATTORNEY FOR WORKMAN'S COMP
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.06
 D ^DIE
 K DIC,DR,DIE,DA
 Q
EMPL ; PATIENT'S EMPLOYER
 I '$D(^AUPNWRKC("C",DFN)) D WMSG H 2 D DRAW G DTWC
 W !
 K DIC,DR,DIE,DA,DD,DO
 S DIE="^AUPNWRKC("
 S DA=WD0
 S DR=.07
 D ^DIE
 K DIC,DR,DIE,DA
 Q
 ; *********************************************************************
 ; ON LINES BELOW:
 ; PIECE 1= FIELD LABEL
 ; PIECE 2= POSITION ON LINE TO DISPLAY FIELD LABEL
 ; PIECE 3= FILE NUMBER
 ; PIECE 4= FIELD NUMBER
1 ;
 ;;DATE OF ACCIDENT^24^9000031^.01
 ;;DESCRIPTION OF INJURY^19^9000031^.03
 ;;RESP. PARTY INS. CO.^20^9000031^.04
 ;;RESP. PARTY SSN^25^9000031^.07
 ;;POLICY NUMBER^27^9000031^.05
 ;;NAME OF PT'S ATTORNEY^19^9000031^.06
 ;;DATE OF INJURY^26^9000032^.01
 ;;DATE CASE CLOSED^24^9000032^.08
 ;;DESCRIPTION OF INJURY^19^9000032^.03
 ;;EMPLOYER^32^9000032^.07
 ;;WORKMAN'S COMP CLAIM FILED^14^9000032^.04
 ;;CLAIM NUMBER^28^9000032^.05
 ;;NAME OF PT'S ATTORNEY FOR THIS CASE^5^9000032^.06