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

AGEDPRVI.m

Go to the documentation of this file.
AGEDPRVI ;IHS/ASDS/TPF - EDIT PRIVATE INSURANCE ELIGIBLE FIELDS ;    
 ;;7.1;PATIENT REGISTRATION;**1,2,8**;AUG 25, 2005
 ;ALL CALLS TO THIS ROUTINE WILL BE FOR EEDITING POLICY HOLDER FIELDS
 ;
 Q
EDITPOLM(POLMEMBS,CHOICES) ;EP - EDIT POLICY MEMBER INSURANCE INFORMATION
EDITPOL2 ;EP -
 N PIECE,ITEM,RECORD,INSPTR
 N AGOLDDT,AGNEWDT
 F PIECE=1:1 S ITEM=$P(CHOICES,",",PIECE) Q:ITEM=""  D
 .S POLMPTR=$O(POLMEMBS(ITEM,""))
 .S INSPTR=$O(POLMEMBS(ITEM,POLMPTR,""))
 .W !!,"Policy Member: ",$P($G(^DPT(POLMPTR,0)),U)
 .K DIC,DA,DIR,DIE,DIR,DR
 .;S DR="05R~Relationship to Insured..: ;.06Starting Date.. : ;.07Expiration Date...:  ;.12Person Code...: ;21Member Number:"  ;AG*7.1*2 ALPHA TESTING
 .S DR="05R~Relationship to Insured..: ;.06R~Starting Date.. : ;.07Expiration Date...:  ;.12Person Code...: ;21Member Number:"
 .S AGOLDDT=$$GET1^DIQ(9000006.11,INSPTR_","_POLMPTR_",",.07,"I","AGDATA","AGERR")
 .S DA=INSPTR
 .S DA(1)=POLMPTR
 .S DIE="^AUPNPRVT("_DA(1)_",11,"
 .D ^DIE
 .;AG*7.1*2 FOUND IN TESTING. CHANGE WILL BE MADE TO DD FOR AUPNPRVT
 .I $$GET1^DIQ(9000006.11,INSPTR_","_POLMPTR_",",.07,"I"),($$GET1^DIQ(9000006.11,INSPTR_","_POLMPTR_",",.06,"I")>$$GET1^DIQ(9000006.11,INSPTR_","_POLMPTR_",",.07,"I")) D  G EDITPOL2
 ..W !!,"STARTING DATE CANNOT BE AFTER TERMINATION DATE!" H 2
 .S AGNEWDT=$$GET1^DIQ(9000006.11,INSPTR_","_POLMPTR_",",.07,"I","AGDATA","AGERR")
 .K DIC,DA,DIR,DIE,DR
 .;AG*7.1*2 REQUESTED DURING TESTING ALSO IM20317
 .Q:AGOLDDT=AGNEWDT  ;NO UPDATE IF THERE WAS NO CHANGE MADE
 .Q:$G(POLMEMBS("SELF"))=""  ;IF NO SELF THEN POLICY HOLDER IS NOT LISTED IN THE MEMBER SECTION
 .I ($G(POLMPTR)=$G(POLMEMBS("SELF"))) D
 ..D UPDTERM^AGEDPRVP(AGELP("PH"),AGNEWDT,AGOLDDT)
 ..K DIC,DA,DIR,DIE,DR
 ..I AGNEWDT="" S DR=".18///@"
 ..E  S DR=".18///^S X=AGNEWDT"
 ..S DIE="^AUPN3PPH("
 ..S DA=AGELP("PH")
 ..D ^DIE
 ..K DIC,DA,DIR,DIE,DR
 Q
ADDOPT(PATPTR,INSPTR,POLHPTR,POLMEMBS) ;EP - ADD MEMBER FORM PRVT PAGE A
 K DIE,DIC,DR,DIR,DA
 S DR=".12   Person Code..: ;.14   Primary Care Provider...: ;21   Member Number..: ;.15  Card Copy Obtained (Y/N)?..: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIE,DIC,DR,DIR,DA
 I $P($G(^AUPNPRVT(PATPTR,11,INSPTR,0)),U,15)="Y" D
 .K DIE,DIC,DR,DIR,DA
 .S DIE("NO^")=""
 .S DR=".16R~ Date CC Obtained..: "
 .S DA=INSPTR
 .S DA(1)=PATPTR
 .S DIE="^AUPNPRVT("_DA(1)_",11,"
 .D ^DIE
 .K DIE,DIC,DR,DIR,DA
 I $P($G(^AUPNPRVT(PATPTR,11,INSPTR,0)),U,15)="N" D
 .K DIE,DIC,DR,DIR,DA
 .S DR=".16////@"
 .S DA=INSPTR
 .S DA(1)=PATPTR
 .S DIE="^AUPNPRVT("_DA(1)_",11,"
 .D ^DIE
REL ;EP - EDIT RELATIONSHIP TO INSURER
 K DIE,DIC,DR,DIR,DA
 S DR=".05R~ Relationship to Insured..: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 I $D(POLMEMBS("SELF")),($P($G(^AUPNPRVT(PATPTR,11,INSPTR,0)),U,5)=25) D  G REL
 .W !!,"THERE IS ALREADY A POLICY HOLDER FOR THIS POLICY!!"
 .S $P(^AUPNPRVT(PATPTR,11,INSPTR,0),U,5)=""
 K DIE,DIC,DR,DIR,DA
 ;STUFF ADDITIONAL ITEMS THAT WE CAN
 D EDITPOLN(PATPTR,INSPTR,POLHPTR)
 D EDITCON(PATPTR,INSPTR,POLHPTR)
 D EDITBDT(PATPTR,INSPTR,POLHPTR,"S")
 D EDITEDT(PATPTR,INSPTR,POLHPTR,"S")
 D EDITPH(PATPTR,INSPTR,POLHPTR)
 D EDITNAME(PATPTR,INSPTR,POLHPTR,"S")
 Q
EDITPCD(PATPTR,INSPTR) ;EP - EDIT PERSON CODE 
 K DIC,DA,DIR,DIE,DIR,DR
 S DR=".12   Person Code...: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITMNUM(PATPTR,INSPTR) ;EP - EDIT MEMBER NUMBER
 K DIC,DA,DIR,DIE,DIR,DR
 S DR="21   Member Number..: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITPOLN(PATPTR,INSPTR,POLHPTR) ;EP - STUFF POLICY NUMBER
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR) S DR=".02////"_$P($G(^AUPN3PPH(POLHPTR,0)),U,4)
 E  S DR=.02
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITCON(PATPTR,INSPTR,POLHPTR) ;EP - STUFF COVERAGE PTR
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR) S DR=".03////"_$P($G(^AUPN3PPH(POLHPTR,0)),U,5)
 E  S DR=.03
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITBDT(PATPTR,INSPTR,POLHPTR,TYPE) ;EP - STUFF ELIG BEGIN DATE
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR),($G(TYPE)="S") S DR=".06////"_$P($G(^AUPN3PPH(POLHPTR,0)),U,17)
 E  S DR=".06 Sarting Date.. : "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITEDT(PATPTR,INSPTR,POLHPTR,TYPE) ;EP - STUFF ELIG END DATE
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR),($G(TYPE)="S") S DR=".07////"_$P($G(^AUPN3PPH(POLHPTR,0)),U,18)
 E  S DR=".07 Expiration Date...: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITPH(PATPTR,INSPTR,POLHPTR) ;EP - STUFF POLICY HOLDER PTR
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR) S DR=".08////"_POLHPTR
 E  S DR=.08
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITNAME(PATPTR,INSPTR,POLHPTR,TYPE) ;EP - STUFF POLICY HOLDER NAME
 K DIC,DA,DIR,DIE,DIR,DR
 I $G(POLHPTR),($G(TYPE)="S") S DR=".04////"_$P($G(^AUPN3PPH(POLHPTR,0)),U)
 E  I $G(TYPE)="E" S DR=".04Name as Stated on Policy..: //"
 E  S DR=".04"
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITREL(PATPTR,INSPTR,SAME) ;EP - EDIT/STUFF RELATIONSHIP PTR
 K DIC,DA,DIR,DIE,DIR,DR
 ;CHECK HERE FOR SAME
 I $G(SAME) S DR=".05///SELF"
 E  S DR=".05R~Relationship to Insured..: "
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q
EDITPCP(PATPTR,INSPTR,CALLER) ;EP - EDIT PRIMARY CARE PROVIDER
 K DR,DIE,DIC,DA,DIR,DR
 I $G(CALLER)="SCREEN" W !!
 S DA(1)=PATPTR
 S DA=INSPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 S DR=".14[7] PCP: "                                                                   ;AG*7.1*8
 D ^DIE
 K DR,DIE,DIC,DA,DIR,DR
 Q
EDITCC(PATPTR,INSPTR,CALLER) ;EP - EDIT CARD COPY ON FILE/ DATE RECEIVED
 K DIE,DIC,DR,DA,DIR,DR
 I $G(CALLER)="SCREEN" W !!
 S DA(1)=PATPTR
 S DA=INSPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 S DR=".15[13] Card Copy on file: "
 D ^DIE
 I $P($G(^AUPNPRVT(PATPTR,11,INSPTR,0)),U,15)[("Y") D EDITCCDT(PATPTR,INSPTR)
 K DIE,DIC,DR,DA,DIR,DR
 Q
EDITCCDT(PATPTR,INSPTR) ;EP - EDIT CARD COPY DATE
 K DIC,DA,DIR,DIE,DIR,DR
 S DIE("NO^")=""
 S DR=".16R~ Date CC obtained..:"
 S DA=INSPTR
 S DA(1)=PATPTR
 S DIE="^AUPNPRVT("_DA(1)_",11,"
 D ^DIE
 K DIC,DA,DIR,DIE,DIR,DR
 Q