- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCNSP1.m
r628 r636 1 IBCNSP1 ;ALB/AAS - INSURANCE MANAGEMENT - policy actions ; 22-OCT-922 ;;2.0;INTEGRATED BILLING;**6,28,40,43,52,85,103,361 ,371,377**;21-MAR-94;Build 231 IBCNSP1 ;ALB/AAS - INSURANCE MANAGEMENT - policy actions ; 22-OCT-92 2 ;;2.0;INTEGRATED BILLING;**6,28,40,43,52,85,103,361**;21-MAR-94;Build 9 3 3 ;;Per VHA Directive 2004-038, this routine should not be modified. 4 ;;ICR#5002 for read of ^DIE input template data5 4 ; 6 5 % G EN^IBCNSP … … 80 79 S DR="8;3;1.09//;3.04" 81 80 D ^DIE K DIC,DIE,DA,DR 82 D COMPPT^IBCNSP3(DFN,IBCDFN) I IBDIF D UPDATPT^IBCNSP3(DFN,IBCDFN), UPDCLM(DFN,IBCDFN),AFTER^IBCNSEVT,^IBCNSEVT,BLD^IBCNSP81 D COMPPT^IBCNSP3(DFN,IBCDFN) I IBDIF D UPDATPT^IBCNSP3(DFN,IBCDFN),AFTER^IBCNSEVT,^IBCNSEVT,BLD^IBCNSP 83 82 L -^DPT(DFN,.312,+$P($G(IBPPOL),"^",4)) 84 83 EDQ S VALMBCK="R" Q … … 98 97 D VARS^IBCNSP3 99 98 L +^DPT(DFN,.312,+$P($G(IBPPOL),"^",4)):5 I '$T D LOCKED^IBTRCD1 G SUQ 100 ;101 D EDIT(DFN,IBCDFN) ; IB*371 - edit pat ins 2.312 subfile fields102 ;99 S DR="6;S IBAD=X;K X I '$$VET^IBCNSU1() S Y=""@10"";17///^S X=$P(^DPT(DFN,0),U);16///^S X=""01""" 100 S DR=DR_";S Y=""@20"";@10;17;16//^S X=$S(IBAD=""s"":""02"",1:"""");@20;1;.2;4.01;4.02;3.01;3.12;3.02;3.03;3.05:3.11" 101 D ^DIE K DIC,DIE,DA,DR 103 102 D COMPPT^IBCNSP3(DFN,IBCDFN) 104 103 I IBDIF D UPDATPT^IBCNSP3(DFN,IBCDFN),BLD^IBCNSP … … 119 118 D AI^IBCNSP02 120 119 Q 121 ;122 PIDEF(IBREL,FLD,IBDFN,SPDEF) ; Function to return patient file defaults123 ; Called from input template IBCN PATIENT INSURANCE124 ; IBREL = value from 2.312,4.03 field (PT. RELATIONSHIP - HIPAA)125 ; FLD = field# in file 2.312126 ; IBDFN = patient ien to file 2127 ; SPDEF = spouse default flag =1 if this field should be defaulted128 ; when the spouse is the policy holder129 ;130 ; The purpose is to provide a default value for the field when the131 ; patient and the ins. subscriber are the same.132 ;133 NEW VAL134 S VAL=""135 I +$G(IBREL)'=1,+$G(IBREL)'=18 G PIDEFX ; patient not the insured or spouse, get out136 I +$G(IBREL)=1,'$G(SPDEF) G PIDEFX ; not a field for spouse default137 I '$G(FLD) G PIDEFX ; no field# passed in138 I '$G(IBDFN) G PIDEFX ; no patient passed in139 ;140 ; Build the patient demographics area141 I '$D(^UTILITY("VADM",$J)) D142 . N VAHOW,DFN,VADM143 . S VAHOW=2,DFN=IBDFN D DEM^VADPT144 . Q145 ;146 ; Build the patient address area147 I '$D(^UTILITY("VAPA",$J)) D148 . N VAHOW,DFN,VAPA149 . S VAHOW=2,DFN=IBDFN,VAPA("P")="" D ADD^VADPT150 . Q151 ;152 I FLD=17 S VAL=$P($G(^UTILITY("VADM",$J,1)),U,1) G PIDEFX ; Name153 I FLD=3.01 S VAL=$$FMTE^XLFDT($P($G(^UTILITY("VADM",$J,3)),U,1),"5Z") G PIDEFX ; Date of Birth154 I FLD=3.02 S VAL=$$EXTERNAL^DILFD(2,.325,,$P($G(^DPT(IBDFN,.32)),U,5)) G PIDEFX ; Branch155 I FLD=3.05 S VAL=$P($G(^UTILITY("VADM",$J,2)),U,2) G PIDEFX ; SSN156 I FLD=3.06 S VAL=$P($G(^UTILITY("VAPA",$J,1)),U,1) G PIDEFX ; Street Address 1157 I FLD=3.07 S VAL=$P($G(^UTILITY("VAPA",$J,2)),U,1) G PIDEFX ; Street Address 2158 I FLD=3.08 S VAL=$P($G(^UTILITY("VAPA",$J,4)),U,1) G PIDEFX ; City159 I FLD=3.09 S VAL=$P($G(^UTILITY("VAPA",$J,5)),U,2) G PIDEFX ; State160 I FLD=3.1 S VAL=$P($G(^UTILITY("VAPA",$J,11)),U,2) G PIDEFX ; Zipcode161 I FLD=3.11 S VAL=$P($G(^UTILITY("VAPA",$J,8)),U,1) G PIDEFX ; Phone#162 I FLD=3.12 S VAL=$P($G(^UTILITY("VADM",$J,5)),U,2) G PIDEFX ; Sex163 PIDEFX ;164 Q VAL165 ;166 ASK(QUES,DEFLT) ; Function to ask Yes/No Question167 ; Returns 1 (yes), 0 (no, up-arrow, or timeout)168 NEW X,Y,DIR,DTOUT,DUOUT,DIRUT,DIROUT169 S DIR(0)="Y",DIR("A")=$G(QUES)170 S DIR("B")=$S($G(DEFLT):"Yes",1:"No")171 W ! D ^DIR W:Y !172 I $D(DIRUT) S Y=0173 ASKX ;174 Q Y175 ;176 EDIT(IBDFN,IBCDFN,IBQUIT) ; Main call to edit data in 2.312 pat ins subfile177 ; IBDFN - patient DFN178 ; IBCDFN - ien for patient insurance policy in subfile 2.312179 ; IBQUIT - Output variable. Pass by reference. Will be set to 1 if180 ; the user entered an up-arrow, timed-out, or deleted the181 ; 2.312 subfile entry by entering "@" at the .01 field182 ;183 NEW DA,DR,DIE,IBZ,IBY,X,Y,DTOUT184 NEW IDS,SUB,PAT,PCE,SUB1,PAT1185 S DA(1)=+$G(IBDFN) ; patient IEN186 S DA=+$G(IBCDFN) ; patient insurance IEN187 I 'DA!'DA(1) G EDITX188 S DIE="^DPT("_IBDFN_",.312,"189 ;190 ; Find the input template IEN for the [IBCN PATIENT INSURANCE] template191 S IBY=+$$FIND1^DIC(.402,,"X","IBCN PATIENT INSURANCE")192 I 'IBY G EDITX193 ;194 ; Build the DR array/string - ICR# 5002195 M DR(1)=^DIE(IBY,"DR",2)196 S DR=$G(DR(1,2.312))197 I DR="" G EDITX198 ;199 S $P(^DIE(IBY,0),U,7)=DT ; see TEM+2^DIE ICR# 5002200 ;201 D ^DIE ; edit subfile data202 ;203 ; If the user entered an up-arrow, or timed-out, or deleted the entry,204 ; then set the output variable IBQUIT205 I $D(Y)!$D(DTOUT)!'$D(DA) S IBQUIT=1206 ;207 F IBZ="VADM","VAPA" K ^UTILITY(IBZ,$J) ; cleanup scratch global208 ;209 D UPDCLM(IBDFN,IBCDFN) ; update editable claims210 ;211 ; Cleanup any problems in the secondary ID area212 S IDS=$G(^DPT(IBDFN,.312,IBCDFN,5)) ; whole 5 node213 S (SUB,PAT)=""214 F PCE=3:1:8 S $P(SUB,U,PCE)=$P(IDS,U,PCE-1) ; subscriber sec ID/qual215 F PCE=3:1:8 S $P(PAT,U,PCE)=$P(IDS,U,PCE+5) ; patient sec ID/qual216 ; SUB and PAT are 8-piece strings with pieces 1 and 2 being nil217 S SUB1=$$SCRUB^IBCEF21(SUB) ; scrub 8-piece string218 S PAT1=$$SCRUB^IBCEF21(PAT) ; scrub 8-piece string219 I SUB'=SUB1 S $P(^DPT(IBDFN,.312,IBCDFN,5),U,2,7)=$P(SUB1,U,3,8)220 I PAT'=PAT1 S $P(^DPT(IBDFN,.312,IBCDFN,5),U,8,13)=$P(PAT1,U,3,8)221 ;222 EDITX ;223 Q224 ;225 UPDCLM(IBDFN,IBCDFN) ; Update the Insurance nodes of claims that are still editable226 NEW IBIFN227 S IBIFN=0 F S IBIFN=$O(^DGCR(399,"C",IBDFN,IBIFN)) Q:'IBIFN D UPDCLM^IBCNSP2(IBIFN,IBDFN,IBCDFN)228 ;229 UPDCLMX ;230 Q231 ;232 PRELCNV(CODE,FLG) ; conversion between X12, NCPDP and VistA pt. relationship codes233 ; CODE - code for pt. relationship to convert234 ; FLG - 0 for X12 -> VistA conversion, 1 for VistA -> X12 conversion, 2 - for VistA -> NCPDP conversion235 ; returns converted code for pt. relationship, or null if no match found236 N I,RES,VSTR,X12STR237 S VSTR="01^02^03^08^11^15^32^33^34^35^36"238 S X12STR="18^01^19^20^39^41^32^33^29^53^G8"239 S RES=""240 I FLG=0 F I=1:1:11 S:$P(X12STR,U,I)=CODE RES=$P(VSTR,U,I) Q:RES'=""241 I FLG=1 F I=1:1:11 S:$P(VSTR,U,I)=CODE RES=$P(X12STR,U,I) Q:RES'=""242 I FLG=2,+CODE>0 S RES=$S(+CODE>3:"04",1:CODE)243 Q RES
Note:
See TracChangeset
for help on using the changeset viewer.