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

ACHSDN1.m

Go to the documentation of this file.
ACHSDN1 ; IHS/ITSC/PMF - DENIAL DATA ENTRY (2/2) ;
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**18**;JUN 11,2001
 ;
 ;3.1*6 4.21.03 IHS/SET/FCJ CHANGED TO ALLOW ICD9 
 ;           INPUT FOR MEDICAL SERVICE
 ;3.1*10 4.21.04 IHS/SET/FCJ ADDED VARS FROM REF AS DEFAULT 
 ;3.1*11 8.26.04 IHS/SET/FCJ TEST MED PRI OF 1NUM 1APLHA
 ;3.1*13 12.1.06 IHS/OIT/FCJ ADDED ABILITY TO "^" OUT
 ;
PRMPRV ;EP.
 S Y="YES"
 ;ACHS*3.1*10 4.21.04 IHS/ITSC/FCJ ADDED NXT LINE
 S Y1="" I $G(ACHSREF(.07)) S Y1=$P(^AUTTVNDR(ACHSREF(.07),0),U) G P1
 S X=$$DN^ACHS(100,1)  ;'CHS DENIAL DATA'- 'IS PRIMARY PROVIDER ON FILE?'
 I $L(X) S Y=$S(X="N":"NO",1:"YES")
 S %=$$DIR^ACHS("Y","Is the PRIMARY PROVIDER in the VENDOR file?",Y,"","^D Q1^ACHSDN2",2)
 Q:$D(DTOUT)!$D(DUOUT)
 G P2:'%
 ;
P1 ;
 ;IF PRIMARY PROVIDER ON-FILE ASK FLDS 102 'PRIMARY PROVIDER (ON-FILE)'
 ;                                     108 'EST. CHARGE (PRIM. PROV.)'
 ;                                    109 'ACTUAL CHARGES (PRIM. PROV.)'
 ;ACHS*3.1*10 4.21.04 IHS/ITSC/FCJ CMT OUT NXT LINE ADDED NXT 2 LINES
 ;I '$$DIE^ACHSDN("100///Y;102;108;109",2) Q
 S DR=$S($G(ACHSREF):"100///Y;102//"_Y1_";108;109",1:"100///Y;102;108;109")
 I '$$DIE^ACHSDN(DR,2) Q
 ;ACHS*3.1*13 12.1.06 IHS/OIT/FCJ NXT 2 LNS FIXED NOT BEING ABLE TO EXIT
 ;G PRMPRV:$D(Y)
 I $D(Y) S ACHSERR=1 Q
 ;
 ;IF WE HAVE A 'PRIMARY PROVIDER POINTER DELETE THE 103 FIELD
 ;'PRIMARY PROVIDER (NOT ON-FILE)' DO A CHECK
 I $L($$DN^ACHS(100,2)) G:$$DIE^ACHSDN("103///@",2) PROVCK Q
 W !!,"A primary provider must be entered - try again.",!!
 G PRMPRV
 ;
P2 ;
 I '$$DIE^ACHSDN("100///N;103:109",2) Q
 G PRMPRV:$D(Y)
 I $L($$DN^ACHS(100,3)),'$$DIE^ACHSDN("102///@",2) Q
 ;
 ;
PROVCK ;
 I $L($$DN^ACHS(100,2))!$L($$DN^ACHS(100,3)) G OTHER
 W !!,*7,"A primary provider must be entered - try again."
 G PRMPRV
 ;
OTHER ;
 Q:$D(ACHDSP)
 S %=$$DIR^ACHS("Y","Are there any other providers (vendors)?","NO","","^D PQ^ACHSDN1",2)
 G PRMPRV:$D(DTOUT)!$D(DUOUT),PROV:%,ACCT
 ;
PROV ;
 S %=$$DIR^ACHS("Y","Is this provider in the vendor file?","YES","","^D Q1^ACHSDN2",2)
 G OTHER:$D(DUOUT)!$D(DTOUT)
 G O1:%,O2
 ;
O1 ;
 I '$$DIE^ACHSDN(200,2) Q    ;EDIT 'OTHER PROVIDER (ON-FILE)'
 G OTHER
 ;
O2 ;
 I '$$DIE^ACHSDN(210,2) Q    ;EDIT 'OTHER PROVIDER (NOT ON FILE)'
 G OTHER
 ;
ACCT ;
 I '$$DIE^ACHSDN(950,2) Q    ;EDIT 'PROVIDER ACCOUNT NUMBER'
 ;ACHS*3.1*13 12.1.06 IHS/OIT/FCJ ADDED ABILITY TO "^" OUT
 G PRMPRV:$D(Y)
TYPE ;
 ;ACHS*3.1*10 4.21.04 IHS/ITSC/FCJ CMT OUT NXT LINE ADDED NXT 3 LINES
 ;I '$$DIE^ACHSDN(110,2) Q    ;EDIT 'TYPE OF SERVICE' 
 S Y=$S($G(ACHSREF(.14))="O":"OUTPATIENT",$G(ACHSREF(.14))="I":"INPATIENT",1:"")
 S DR=$S($G(ACHSREF):"110//"_Y,1:110)
 I '$$DIE^ACHSDN(DR,2) Q    ;EDIT 'TYPE OF SERVICE' 
 ;ACHS*3.1*13 12.1.06 IHS/OIT/FCJ ADDED ABILITY TO "^" OUT CHG NXT LNE
 ;G PRMPRV:$D(Y) ;ACHS*3.1*13
 G ACCT:$D(Y) ;ACHS*3.1*13
 I '$L($$DN^ACHS(100,10)) W !!,*7,"A TYPE-OF-SERVICE entry must be entered - try again.",!! G TYPE
 D REASON^ACHSDN2             ;ENTER 'DENIAL REASONS'
 ;ACHS*3.1*13 12.1.06 IHS/OIT/FCJ ADDED ABILITY TO "^" OUT
 I ACHSERR S ACHSERR="" G TYPE
 Q:$D(DUOUT)
MEDPRI ;
 ;ACHS*3.1*10 4.21.04 IHS/ITSC/FCJ CMT OUT NXT LINE ADDED NXT 3 LINES
 ;I '$$DIE^ACHSDN(420,2) Q     ;ENTER 'MEDICAL PRIORITY CATEGORY'
 I $G(ACHSREF(.32))?1A.A S Y=ACHSREF(.32) D
 .S ACHSREF(.32)=$S(Y="I":1,Y="II":2,Y="III":3,Y="IV":4,Y="V":5,1:"")
 ;3.1*11 8.26.04 IHS/SET/FCJ TEST MED PRI OF 1NUM 1APLHA
 ;I $G(ACHSREF(.32))>5 S ACHSREF(.32)=""
 I +$G(ACHSREF(.32))>5 S ACHSREF(.32)=""
 ;S Y=$S($G(ACHSREF(.32)):$P(^ACHSMPRI(ACHSREF(.32),0),U),1:"")
 S Y=$S($G(ACHSREF(.32)):$P(^ACHSMPRI(+$G(ACHSREF(.32)),0),U),1:"")
 S DR=$S($G(ACHSREF):"420//"_Y,1:420)
 I '$$DIE^ACHSDN(DR,2) Q     ;ENTER 'MEDICAL PRIORITY CATEGORY'
 I $D(Y) G TYPE
 D PRIORCK^ACHSDN2            ;CHECK IF ENTERED
 Q:$D(DUOUT)
 G MEDPRI:'Y
 ;
 ;
DIAG ;
 G ICD9:$$DN^ACHS(100,10)="I"   ;IF 'TYPE OF SERVICE' INPATIENT
 ;ACHS*3.1*6 4.21.03 IHS/SET/FCJ CHANGE OUTPATIENT TO DENTAL
 ;G CPT:$$DN^ACHS(100,10)="O"    ;IF 'TYPE OF SERVICE'  OUTPATIENT ;ACHS*3.1*6
 G CPT:$$DN^ACHS(100,10)="D"   ;IF 'TYPE OF SERVICE' DENTAL ;ACHS*3.1*6
ICD9 ;
 I '$$DIE^ACHSDN(500,2) Q        ;EDIT 'DIAGNOSIS (ICD9)
 G MEDPRI:$D(Y)
 ;G DXCK   SEE COMMENT UNDER TAG DXCK      ;CHECK THAT DIAG IS ENTERED
 ;
CPT ;
 I '$$DIE^ACHSDN(700,2) Q         ;EDIT 'PROCEDURE (CPT)
 G MEDPRI:$D(Y)
 ;G DXCK   SEE COMMENT UNDER TAG DXCK     ;CHECK THAT DIAG IS ENTERED
DXCK ;
 ;I '$D(^ACHSDEN(DUZ(2),"D",ACHSA,500)) G DIAG DIAGNOSIS ICD9 NOT
 ;NOT REQUIRED PER CHS WORKGROUP 2/22/2001
 ;I '$D(^ACHSDEN(DUZ(2),"D",ACHSA,700)) W !!,*7,"At least one PROCEDURE is required.",!! G CPT   NOT REQUIRED PER CHS WORKGROUP 2/22/2001
 ;
 ;EDIT 'OTHER RESOURCES' THESE ARE PRIVATE AND GOV. INSURANCE
RESC ;
 W !!
 K DIC("A")
 I '$D(^ACHSDEN(DUZ(2),"D",ACHSA,800,0)) S ^ACHSDEN(DUZ(2),"D",ACHSA,800,0)=$$ZEROTH^ACHS(9002071,1,800)
 ;
 S DA(2)=DUZ(2)
 S DA(1)=ACHSA
 S DIC="^ACHSDEN("_DUZ(2)_",""D"","_ACHSA_",800,"
 ;
 S DIC(0)="QALEM"
 D ^DIC
 G MEDPRI:X[U
 G IHSRES:Y<1
 ;
 ;EDIT FIELDS 2-10 SUBFILE 'OTHER RESOURCES'
 S DA=+Y
 S DA(2)=DUZ(2)
 S DA(1)=ACHSA
 S DIE=DIC
 S DR="2;3;6;8;4;5;9;10"
 S DR="2:10"
 D ^DIE
 ;10/24/01  pmf  replace next line
 ;Y is not an output of ^DIE, so why go somewhere based on it?
 ;besides, we want to ask for another alt resource
 ;G:$D(Y) DIAG
 G RESC
 ;
 ;EDIT 'OTHER IHS RESOURCES'  OTHER FACILITIES THAT MAY HONOR
 ;A REQUEST FOR SERVICE
IHSRES ;
 ;
 W !!
 I '$D(^ACHSDEN(DUZ(2),"D",ACHSA,825,0)) S ^ACHSDEN(DUZ(2),"D",ACHSA,825,0)=$$ZEROTH^ACHS(9002071,1,825)
 ;
 S DA(2)=DUZ(2)
 S DA(1)=ACHSA
 S DIC="^ACHSDEN("_DUZ(2)_",""D"","_ACHSA_",825,"
 S DIC(0)="QALEM"
 D ^DIC
 G RESC:X[U
 G DOCCK:Y<1
 ;
 ;
DOCCK ;
 W !!
 K DIR
 S DIR(0)="Y"
 S DIR("A")="Enter Document Control Information Now"
 S DIR("B")="NO"
 S DIR("?",1)="Answer 'Y' if patient or their representative is picking up the document in person."
 S DIR("?")="Answer 'N' if document is being mailed."
 D ^DIR
 K DIR
 G RESC:X[U
 I 'Y G COMMENT
 I '$$DIE^ACHSDN("850////Y") Q     ;FORCE ENTRY INTO 'DOCUMENT CONTROL'
 G RESC:$D(Y)
 I '$$DIE^ACHSDN("851:853",2) Q    ;EDIT 'RECEIPT TYPE'
 ;                                      'DATE DENIAL RECEIVED'
 ;                                      'PERSON RECEIVING DENIAL'
 G RESC:$D(Y)
COMMENT ;
 I '$$DIE^ACHSDN(900,2) Q          ;EDIT 'CHS OFFICE COMMENTS'
END ;
 K DTOUT,DUOUT,ACHDENR
 Q
 ;
PQ ;EP - From DIR
 W !!,"If there are other vendors which must be provided with a copy of",!,"this denial letter, answer 'Y'.  If not, answer 'N'."
 Q
 ;