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

PSOCPC.m

Go to the documentation of this file.
  1. PSOCPC ;BHAM ISC/BAB - PHARMACY CO-PAY APPLICATION ;06/09/92
  1. ;;7.0;OUTPATIENT PHARMACY;**10,9,71,85,114,157,143,239,201,275,225,495**;DEC 1997;Build 9
  1. ;
  1. ;REF/IA
  1. ;piece 9 of zero node of File 350 and APDT cross reference of File 350/2215
  1. ;$$STATUS^IBARX/125
  1. ;File 350.1/592 (DBIA125-B)
  1. WARN ; Message when attempt is made to delete a refill date on COPAY
  1. N PSOIB,PSOIBST
  1. S PSOFLG=0
  1. G:'$D(^PSRX(DA(1),1,DA,"IB")) ENDW
  1. S PSOIB=^PSRX(DA(1),1,DA,"IB")
  1. I +PSOIB'>0 G ENDW
  1. S PSOIBST=$$STATUS^IBARX(+PSOIB) I PSOIBST=2!(PSOIBST=0) G ENDW
  1. I +PSOIB>0 D CANCEL G ENDW:PSOFLG=0
  1. I '$G(PSOXXDEL) D EN^DDIOL("This REFILL has COPAY charges, which MUST be removed","","$C(7),!!"),EN^DDIOL("BEFORE the refill date is deleted.","","!")
  1. I '$G(PSOXXDEL) D EN^DDIOL("Use option RESET COPAY STATUS/CANCEL CHARGES, return to EDIT A PRESCRIPTION,","","!!"),EN^DDIOL("and delete the refill date.","","!"),EN^DDIOL(" ","","!!")
  1. S PSOFLG=1
  1. ENDW ;
  1. I PSOFLG
  1. K PSOFLG
  1. Q
  1. CANCEL ;Check if charge is cancelled for this Refill date
  1. S PSOFLG=1 ;indicates a charge not cancelled
  1. S PSOX=+^PSRX(DA(1),1,DA,"IB")
  1. D LAST I PSOLAST'=PSOPARNT,$D(^IB(PSOLAST,0)),$P(^IBE(350.1,$P(^IB(PSOLAST,0),"^",3),0),"^",5)=2 S PSOFLG=0
  1. K PSOLAST,PSOPARNT,PSOX,PSOL,PSOLDT
  1. Q
  1. LAST ;find last entry
  1. S PSOLAST=""
  1. S PSOPARNT=$P(^IB(+PSOX,0),"^",9) I 'PSOPARNT S PSOPARNT=+PSOX
  1. S PSOLDT=$O(^IB("APDT",PSOPARNT,"")) I +PSOLDT F PSOL=0:0 S PSOL=$O(^IB("APDT",PSOPARNT,PSOLDT,PSOL)) Q:'PSOL S PSOLAST=PSOL
  1. I PSOLAST="" S PSOLAST=PSOPARNT
  1. Q
  1. ;
  1. EXEMCHK ; Allow reset of exemption answers
  1. N PSOTG,PSOCPN,PSOEXMT,PSOANS,OLDIBQ,PSOSCP,PSOSCA
  1. S PSOANS=0 D SCP^PSORN52D
  1. S OLDIBQ=$G(^PSRX(PSODA,"IBQ"))
  1. I OLDIBQ[0!(OLDIBQ)[1 D
  1. . S PSOANS=1
  1. . I $P(OLDIBQ,"^",1)'="" S PSOTG("SC")=$P(OLDIBQ,"^",1)
  1. . I $P(OLDIBQ,"^",2)'="" S PSOTG("MST")=$P(OLDIBQ,"^",2)
  1. . I $P(OLDIBQ,"^",3)'="" S PSOTG("AO")=$P(OLDIBQ,"^",3)
  1. . I $P(OLDIBQ,"^",4)'="" S PSOTG("IR")=$P(OLDIBQ,"^",4)
  1. . I $P(OLDIBQ,"^",5)'="" S PSOTG("EC")=$P(OLDIBQ,"^",5)
  1. . I $P(OLDIBQ,"^",6)'="" S PSOTG("HNC")=$P(OLDIBQ,"^",6)
  1. . I $P(OLDIBQ,"^",7)'="" S PSOTG("CV")=$P(OLDIBQ,"^",7)
  1. . I $P(OLDIBQ,"^",8)'="" S PSOTG("SHAD")=$P(OLDIBQ,"^",8)
  1. S PSOCPN=$P(^PSRX(PSODA,0),"^",2)
  1. S RXP=PSODA
  1. D SCNEW^PSOCP(.PSOTG,PSOCPN,"",PSODA)
  1. N EXMT
  1. D XTYPE^PSOCP ; KEEP THIS CALL IN HERE TO SEE IF SC QUESTION APPLIES
  1. ;I $D(PSOTG("SC")) S PSOTG("SC")=$P(OLDIBQ,"^",1) ; CHANGED TO JUST USE IBQ SETTING IF SC QUESTION APPLIES - DON'T RE-CALCULATE SERVICE-CONNECTED
  1. S EXMT="" F S EXMT=$O(PSOTG(EXMT)) Q:EXMT="" I PSOTG(EXMT)'="" S PSOANS=1 Q
  1. I $O(PSOTG(""))="" Q
  1. I PSOANS W !!,"The following exemption flags have been set:"
  1. F EXMT="SC","CV","AO","IR","EC","SHAD","MST","HNC" I $G(PSOTG(EXMT))'="" W !,$S(EXMT="EC":"SWAC",1:EXMT),": ",?6,$S(PSOTG(EXMT)=1:"Yes",PSOTG(EXMT)=0:"No",1:"")
  1. W !
  1. W ! K DIR S DIR(0)="Y",DIR("B")="N" D S DIR("A")="Do you want to enter/edit any copay exemption flags"
  1. . S EXMT="" F S EXMT=$O(PSOTG(EXMT)) Q:EXMT="" I PSOTG(EXMT)="" S DIR("B")="Y" Q
  1. S DIR("?")="Enter 'Y' for Yes if you want to edit any applicable medication exemption flags."
  1. S DIR("??")="^D HELPEXEM^PSOCPC"
  1. D ^DIR K DIR S PSOEXMT=Y I Y'=1 Q
  1. ; PRESENT ALL APPLICABLE EXEMPTIONS AND SAVE NEW ANSWERS
  1. N PSOIBQ,PSOSUBS,PSOQUES,PSOLTAG,OLDIBQ,II,PSOCHG,PSOPATST
  1. S PSOPATST=$$GET1^DIQ(52,PSODA_",",3,"I")
  1. S PSOIBQ=""
  1. S OLDIBQ=$G(^PSRX(PSODA,"IBQ"))
  1. I '$D(^PSRX(PSODA,"IBQ")),+($G(^PSRX(PSODA,"IB")))=2 S $P(OLDIBQ,"^",1)=0 ; SC QUESTION WAS PREVIOUSLY ANSWERED AS N
  1. S PSOCOMM="",PSOOLD="",PSONW=""
  1. S II=0
  1. F EXMT="SC","CV","AO","IR","EC","SHAD","MST","HNC" I $D(PSOTG(EXMT)) D
  1. . S PSOLTAG="REL"_EXMT_"^PSOCPE"
  1. . S HELPTAG="HELP"_EXMT
  1. . S PSOQUES=$P($T(@PSOLTAG),";",2) I PSOQUES="" Q
  1. . S PSOQUES=$P(PSOQUES,"?")
  1. . S PSOSUBS=$P($T(@PSOLTAG),";",3) I PSOSUBS="" Q
  1. . D ASKEXEM
  1. I $D(PSOCHG) D
  1. . ;PSO*7*275 IBQ node should not be present in some cases.
  1. . K ^PSRX(PSODA,"IBQ")
  1. . S:PSOSCP<50&($TR(PSOIBQ,"^")'="")&($P($G(^PS(53,+$G(PSOPATST),0)),"^",7)'=1) ^PSRX(PSODA,"IBQ")=PSOIBQ
  1. . D RESET^PSORN52D ;set SC/EI on ICD node
  1. . S PSOPFSA=1 ;PFSS-denotes to calling routine that outpatient classifications changed.
  1. . D EN^PSOHLSN1(PSODA,"XX","","Order edited")
  1. . I PCOPAY,PSOIBQ["1" D ; RESET TO NO COPAY
  1. . . W !,"Editing of exemption flag(s) has resulted in a copay status change.",!,"The status for this Rx will be reset to NO COPAY."
  1. . . S $P(^PSRX(PSODA,"IB"),"^",1)=""
  1. . . S PSOREF="",PSOOLD="Copay",PSONW="No Copay",PREA="R" D ACTLOG^PSOCPA
  1. . . S PSOCOMM="Copay status reset due to exemption flag(s)"
  1. . . S PSI=0 D SETSUMM
  1. . I $G(II)>0 D
  1. . . S PSOCOMM="The following exemption flags have been changed: ",PSI=0 D SETSUMM
  1. . . S II="" F S II=$O(PSOCHG(II)) Q:II="" S PSOCOMM=PSOCHG(II),PSI=0 D SETSUMM
  1. Q
  1. ;
  1. ASKEXEM ; ASK THE EXEMPTION QUESTIONS
  1. K DIR S DIR("A")=PSOQUES,DIR(0)="YO" S:PSOTG(EXMT)=1 DIR("B")="Y" S:PSOTG(EXMT)=0 DIR("B")="N" D @HELPTAG
  1. ASKEXEM1 D ^DIR I X="@" R !," Are you sure you want to delete this answer? ",X:DTIME I $E(X)'="Y",$E(X)'="y" G ASKEXEM1
  1. I X="^"!($D(DTOUT)) S X=$G(DIR("B")) S Y=$S(X="Y":1,X="N":0,1:"")
  1. S $P(PSOIBQ,"^",PSOSUBS)=$S(Y=1:1,Y=0:0,1:"")
  1. I Y'=PSOTG(EXMT) S II=II+1,PSOCHG(II)=$S(EXMT="EC":"SWAC",1:EXMT)_": "_$S($P(PSOIBQ,"^",PSOSUBS)=1:"Yes",$P(PSOIBQ,"^",PSOSUBS)=0:"No",1:"")
  1. I Y=1 D
  1. . I PSOCOMM'="" Q
  1. . D SETCOMM^PSOCP
  1. Q
  1. ;
  1. HELPEXEM ; help text for exemption edit question
  1. W !,"Enter 'Y' for Yes if you want to edit any applicable exemption flags such as"
  1. W !,"Service Connected (SC), Combat Veteran(CV), Agent Orange (AO), Ionizing"
  1. W !,"Radiation (IR), Southwest Asia Conditions (SWAC), PROJ 112/SHAD,"
  1. W !,"Military Sexual Trauma (MST), or Head and/or Neck Cancer (HNC)."
  1. Q
  1. ;
  1. HELPSC ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is for a Service Connected condition."
  1. S DIR("?",2)="This response will be used to determine whether or not a copay should be"
  1. S DIR("?",3)="applied to the prescription."
  1. Q
  1. ;
  1. HELPAO ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition due to",DIR("?",2)="Vietnam-Era Herbicide (Agent Orange) exposure. This response will be used to"
  1. S DIR("?",3)="determine whether or not a copay should be applied to the prescription."
  1. Q
  1. ;
  1. HELPIR ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition due to",DIR("?",2)="ionizing radiation exposure during military service. This response will be used"
  1. S DIR("?",3)="to determine whether or not a copay should be applied to the prescription."
  1. Q
  1. ;
  1. HELPEC ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition related to",DIR("?",2)="service in Southwest Asia. This response will be used to determine whether"
  1. S DIR("?",3)="or not a copay should be applied to the prescription."
  1. Q
  1. ;
  1. HELPMST ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition related",DIR("?",2)="to Military Sexual Trauma. This response will be used to determine whether or"
  1. S DIR("?",3)="not a copay should be applied to the prescription."
  1. Q
  1. ;
  1. HELPHNC ;
  1. S DIR("?")=" ",DIR("?",1)="Enter 'Yes' if this prescription is being used to treat Head and/or Neck Cancer",DIR("?",2)="due to nose or throat radium treatments while in the military. This response"
  1. S DIR("?",3)="will be used to determine whether or not a copay should be applied to the",DIR("?",4)="prescription."
  1. Q
  1. ;
  1. HELPCV ;
  1. S DIR("?")=" "
  1. S DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition related"
  1. S DIR("?",2)="to Combat Services. This response will be used to determine whether or"
  1. S DIR("?",3)="not a copay should be applied to the prescription."
  1. Q
  1. ;
  1. HELPSHAD ;
  1. S DIR("?")=" "
  1. S DIR("?",1)="Enter 'Yes' if this prescription is being used to treat a condition related"
  1. S DIR("?",2)="to PROJ 112/SHAD. This response will be used to determine whether or"
  1. S DIR("?",3)="not a copay should be applied to the prescription."
  1. Q
  1. SETSUMM ; SET MESSAGE INTO SUMMARY
  1. S PSI=$O(PSOSUMM(PSI)) G:$O(PSOSUMM(PSI)) SETSUMM
  1. S PSI=PSI+1,PSOSUMM(PSI)=PSOCOMM
  1. K PSOCOMM
  1. Q
  1. ;