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

AGEDPRV1.m

Go to the documentation of this file.
AGEDPRV1 ;IHS/ASDS/TPF - EDIT/DISPLAY PRIVATE INSURANCE PAGE A OVERFLOW CODE ;    
 ;;7.1;PATIENT REGISTRATION;**1,2,3**;APR 3, 2007
 ;
 Q
 ;CALLED FROM AGEDPRV
NOTREG(POLHPTR) ;EP - IS THIS POLICY HOLDER REGISTERED?
 I '$G(POLHPTR) W !,"NO POLICY HOLDER!" Q
 N PATPTR
 S PATPTR=$P($G(^AUPN3PPH(POLHPTR,0)),U,2)
 I $G(PATPTR)'="",'$D(^DPT(PATPTR,0)) W " [NOT REG]"
 I PATPTR="" W " [NOT REG]"
 Q
 ;CALLED FROM AGEDPRV
DISPHLP(ID0,FIELD) ;EP -
 W !!,"DATA COULD NOT BE TRANSFERRED TO THE POLICY HOLDER FILE!"
 W !!,"DATA IMPROPERLY FORMATTED"
 Q
 ;CALLED FROM AGEDPRV
CONFIRM ;EP -
 K DIR
 S DIR(0)="Y"
 S DIR("A")="Do you wish to add "_$G(TARGET)_" as the Insured Policy Holder"
 D ^DIR
 I 'Y K POLHPTR,NEWPTR S EXIT=1 Q
 ;I 'Y D CLEAN11(ID0,ID1) K POLHPTR,NEWPTR S EXIT=1 Q  ;AG*7.1*3 IM23566
 Q:$G(REGISTER)
 D ADDPOLH^AGEDPRVP(ID0,ID1,$G(TARGET),.POLHPTR,REGISTER,SAME)
 Q
 ;CALLED FROM AGEDPRV
PUTPOLH(NEWPH,PATPTR,POLHPTR,TYPE,FIELD,SAME,EXIT,INSPTR) ;EP -
 ;IF NEW POL HOLD. STUFF PT INTO NEW PH ENTRY
 I TYPE="NEW" D
 .K DIC,DIE,DA,DIR,DO,DD,DINUM,X,DR
 .S FILE=""
 .F  S FILE=$O(FIELD(FILE)) Q:FILE=""  D  Q:$G(EXIT)
 ..S FLD=""
 ..F  S FLD=$O(FIELD(FILE,FLD)) Q:FLD=""  D
 ...I FILE=2 S NFLD=$S(FLD=.01:.01,FLD=.111:.09,FLD=.114:.11,FLD=.115:.12,FLD=.116:.13,FLD=.131:.14,FLD=.02:.08,FLD=.03:.19,FLD=.21:.15,1:99999)
 ...I FILE=9000001 S NFLD=$S(FLD=.19:.16,FLD=.21:.15,1:9999999)
 ...I FIELD(FILE,FLD)'="" S X=FIELD(FILE,FLD) X $P(^DD(9000003.1,NFLD,0),U,5,999) I '$D(X) W !,"PROBLEM WITH FIELD ",NFLD," IN FILE ",FILE," THE DATA IS ",FIELD(FILE,FLD) Q  ;Q:'$D(X)
 ...;W !,"FIELD "_NFLD_" IN FILE "_FILE_" PASSES INPUT TRANSFORM: "_FIELD(FILE,FLD)
 ...;I NFLD=".19" S DIC("DR")=$G(DIC("DR"))_NFLD_"///"_FIELD(FILE,FLD)_";" Q
 ...I (NFLD=".19")!(NFLD=".12")!(NFLD=".08") S DIC("DR")=$G(DIC("DR"))_NFLD_"///"_FIELD(FILE,FLD)_";" Q  ;AG*7.1*2
 ...S DIC("DR")=$G(DIC("DR"))_NFLD_"////"_FIELD(FILE,FLD)_";"
 .S DIC("DR")=DIC("DR")_".02////"_PATPTR
 .S DIC("DR")=DIC("DR")_";.03////"_AGINSPTR
 .S X=FIELD("2",".01")
 .S DIC(0)="LFZ"
 .S DIC="^AUPN3PPH("
 .K DO,DD,DINUM
 .D FILE^DICN
 .S POLHPTR=+Y
 .I POLHPTR<0 D DISPHLP(ID0,.FIELD) S EXIT=1
 .K DIC,DIE,DA,DIR,DO,DD,DINUM,X
 S TYPE="E"
 I POLHPTR<0 S EXIT=1 Q
 W !!
 D PHEDALL^AGEDPRVP(PATPTR,INSPTR,POLHPTR,SAME,TYPE)
 S EXIT=0
 Q