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

IBTRH5K.m

Go to the documentation of this file.
  1. IBTRH5K ;ALB/JWS - HCSR Create 278 Request ;11-DEC-2014
  1. ;;2.0;INTEGRATED BILLING;**517**;21-MAR-94;Build 240
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;
  1. ; Contains Entry points and functions used in creating a 278 request from a
  1. ; selected entry in the HCSR Response worklist
  1. ;
  1. ; -------------------------- Entry Points --------------------------------
  1. ; REQMISS - Checks for missing required fields in a request
  1. ;-----------------------------------------------------------------------------
  1. Q
  1. ;
  1. REQMISS ; Additional required field checking for 278 transaction
  1. ; Input: CTC - Certification Type Code IEN
  1. ; IENS - IEN_"," of the entry being checked
  1. ; IBTRIEN - IEN of the entry being checked
  1. ; MISSING() - Current array of missing fields
  1. ; Output: MISSING() - Updated array of missing fields
  1. ;
  1. ; Check Attachments multiple 356.2211
  1. N CNT,COMN,COMQ,RTC,ZZ
  1. S XX=$O(^IBT(356.22,IBTRIEN,11,0))
  1. I XX D
  1. . S (XX,CNT)=0
  1. . F S XX=$O(^IBT(356.22,IBTRIEN,11,XX)) Q:XX'=+XX D
  1. . . S CNT=CNT+1
  1. . . I $$GET1^DIQ(356.2211,XX_","_IENS,.01)="" D
  1. . . . S ZZ="The Report Type Code is required for all Attachment entries"
  1. . . . D MISSING("Attachment Multiple "_CNT_" Report Type Code",ZZ)
  1. . . S RTC=$$GET1^DIQ(356.2211,XX_","_IENS,.02,"I")
  1. . . I RTC="" D
  1. . . . S ZZ="The Report Transmission Code is required for all Attachment entries"
  1. . . . D MISSING("Attachment Multiple "_XX_" Report Trans Code",ZZ)
  1. . . I $$GET1^DIQ(356.2211,XX_","_IENS,.03)="" D
  1. . . . I $F(",BM,EL,EM,FX,",","_RTC_",") D
  1. . . . . S ZZ="The Attachment Control Number is required for any Attachment "
  1. . . . . S ZZ=ZZ_"entries with a Transmission Code of 'By Mail', 'Electronically Only', 'E-mail', or 'Fax'."
  1. . . . . D MISSING("Attachment Multiple "_XX_" CTL #",ZZ)
  1. ;
  1. ; Check Patient Event Provider multiple
  1. I '$D(^IBT(356.22,IBTRIEN,13)) D
  1. . I $$GET1^DIQ(356.22,IENS,2.01,"I")=1!('$O(^IBT(356.22,IBTRIEN,16,0))) D Q
  1. . . S ZZ="There must be at least one Patient Event Service Provider included "
  1. . . S ZZ=ZZ_"in a 278 Request with Request Category equal to Admission Review "
  1. . . S ZZ=ZZ_"or with no Service Line detail entered."
  1. . . D MISSING("Patient Event Provider Multiple",ZZ)
  1. . S XX=0
  1. . F S XX=$O(^IBT(356.22,IBTRIEN,16,XX)) Q:XX'=+XX I '$O(^IBT(356.22,IBTRIEN,16,XX,8,0)) S XX="BAD" Q
  1. . S ZZ="There must be at least one Patient Event Service Provider included in "
  1. . S ZZ=ZZ_"a 278 Request if a Service Detail Line does not have a Service Provider entered."
  1. . I XX="BAD" D MISSING("Patient Event Provider Multiple",ZZ)
  1. ;
  1. ; Check Patient Event Transport multiple
  1. I $D(^IBT(356.22,IBTRIEN,14)) D
  1. . N CNT,CT,ZZ
  1. . S (CNT,XX,CT)=0
  1. . F S XX=$O(^IBT(356.22,IBTRIEN,14,XX)) Q:XX'=+XX D
  1. . . S CNT=CNT+1
  1. . . S CT=$G(CT)+1,CT(CT)=$$GET1^DIQ(356.2214,XX_","_IENS,.01,"I"),CT(CT(CT))=CT
  1. . . I CT(CT)="" D
  1. . . . S ZZ="Patient Event Transport multiple entry "_CNT_" is missing a required Location Type."
  1. . . . D MISSING("Patient Event Trans "_CNT_" .01",ZZ)
  1. . . I $$GET1^DIQ(356.2214,XX_","_IENS,.03)="" D
  1. . . . S ZZ="Patient Event Transport multiple entry "_CNT_" is missing a required Address Line."
  1. . . . D MISSING("Patient Event Trans "_CNT_" .03",ZZ)
  1. . . I $$GET1^DIQ(356.2214,XX_","_IENS,.07)="" D
  1. . . . N CITY,ST
  1. . . . S CITY=$$GET1^DIQ(356.2214,XX_","_IENS,.05)
  1. . . . I CITY="" D
  1. . . . . S ZZ="Patient Event Transport multiple entry "_CNT_" is missing a required City."
  1. . . . . D MISSING("Patient Event Trans "_CNT_" .05",ZZ)
  1. . . . S ST=$$GET1^DIQ(356.2214,XX_","_IENS,.06)
  1. . . . I ST="" D
  1. . . . . S ZZ="Patient Event Transport multiple entry "_CNT_" is missing a required State/Province Code."
  1. . . . . D MISSING("Patient Event Trans "_CNT_" .06",ZZ)
  1. . . . I ST="",CITY="" D
  1. . . . . S ZZ="Patient Event Transport multiple "_CNT_" must have a Zip code entered if no City "
  1. . . . . S ZZ=ZZ_"and State are entered."
  1. . . . . D MISSING("Patient Event Trans "_CNT_" .07",ZZ)
  1. . I CT=1 D
  1. . . S ZZ="There must be at least 2 entries in the Patient Event Transport multiple "
  1. . . S ZZ=ZZ_"indicating the pickup address and the final destination address."
  1. . . D MISSING("Patient Event Transport Multiple",ZZ)
  1. . I CT=2,'$D(CT("PW")),'$D(CT("FS")) D
  1. . . S ZZ="For the Patient Event Transport multiple, if there are 2 entries, one "
  1. . . S ZZ=ZZ_"must be for the Pickup address and the other must be the Final scheduled destination."
  1. . . D MISSING("Patient Event Transport Multiple",ZZ)
  1. ;
  1. ; Check OTHER UMO multiple
  1. I $D(^IBT(356.22,IBTRIEN,15)) D
  1. . N CNT,ZZ
  1. . S (CNT,XX)=0
  1. . F S XX=$O(^IBT(356.22,IBTRIEN,15,XX)) Q:XX'=+XX D
  1. . . S CNT=CNT+1
  1. . . I $$GET1^DIQ(356.2215,XX_","_IENS,.01)="" D
  1. . . . S ZZ="Other UMO entry "_CNT_" must have a UMO Entity Identifier code."
  1. . . . D MISSING("Other UMO multiple entry "_CNT_" .01",ZZ)
  1. . . I $$GET1^DIQ(356.2215,XX_","_IENS,.03)="" D
  1. . . . S ZZ="Other UMO entry "_CNT_" must have an Other UMO Denial Reason."
  1. . . . D MISSING("Other UMO multiple entry "_CNT_" .03",ZZ)
  1. . . I $$GET1^DIQ(356.2215,XX_","_IENS,.07)="" D
  1. . . . S ZZ="Other UMO entry "_CNT_" must have a UMO Denial Date entered."
  1. . . . D MISSING("Other UMO multiple entry "_CNT_" .07",ZZ)
  1. ;
  1. ; Check Service Line multiples
  1. I $D(^IBT(356.22,IBTRIEN,16)) D
  1. . N CNT,XX,YY,ZZ,I
  1. . S (CNT,YY,XX)=0
  1. . F S XX=$O(^IBT(356.22,IBTRIEN,16,XX)) Q:XX'=+XX D
  1. . . S CNT=CNT+1
  1. . . I $$GET1^DIQ(356.2216,XX_","_IENS,.15)="" D
  1. . . . F I=.02,.03,.04,.05 I $$GET1^DIQ(356.2216,XX_","_IENS,I)'="" S YY=1 Q
  1. . . . S ZZ="Service Line "_CNT_" requires the UMO Type to be included with service line information."
  1. . . . I YY D MISSING("Service Line "_CNT_" .15",ZZ)
  1. Q
  1. ;
  1. ;
  1. MISSING(SUB,DESC) ; Function to generate MISSING array
  1. ; Input: SUB - subscript of MISSING array
  1. ; DESC - description of error condition
  1. ; Returns: MISSING array
  1. ;
  1. S MISSING=MISSING+1
  1. S MISSING(SUB)=DESC
  1. Q
  1. ;
  1. CLRENTRY(IBTRIEN) ; clear an entry in file 356.22
  1. ; clears all fields except for .01 - .11, .16, and 4.01 - 4.02 at the top level
  1. ; IBTRIEN - file 356.22 ien
  1. ;
  1. N FDA,Z,Z1
  1. ; top level
  1. F Z=.12:.01:.15,.17:.01:.25,2.01:.01:2.26,4.03:.01:4.14,5.01:.01:5.18 S FDA(356.22,IBTRIEN_",",Z)="@"
  1. F Z=6.01:.01:6.18,7.01:.01:7.13,8.01:.01:8.08,9.01:.01:9.08,10.01:.01:10.13 S FDA(356.22,IBTRIEN_",",Z)="@"
  1. F Z=12,17.01,17.02,18.01:.01:18.1,19:.01:19.03,20:1:23,103.01:.01:103.04 S FDA(356.22,IBTRIEN_",",Z)="@"
  1. ; multiples
  1. F Z=1,3,11,13,14,15,16,101,105,107 D
  1. .S Z1=0 F S Z1=$O(^IBT(356.22,IBTRIEN,Z,Z1)) Q:'Z1 S FDA(356.22_Z,Z1_","_IBTRIEN_",",.01)="@"
  1. .Q
  1. D FILE^DIE(,"FDA")
  1. Q
  1. ;
  1. CLRASK() ; prompt user for clearing the entry in file 356.22
  1. ; returns 1 if entry should be cleared, 0 otherwise
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. S DIR("A")="Clear existing data? (Y/N): ",DIR("B")="Y",DIR(0)="YAO" D ^DIR
  1. I $G(DTOUT)!$G(DUOUT)!$G(DIROUT)!($G(Y)'=1) Q 0
  1. Q 1