IBTRH5J ;ALB/JWS - HCSR Create 278 Request ;11-DEC-2014
;;2.0;INTEGRATED BILLING;**517**;21-MAR-94;Build 240
;;Per VA Directive 6402, this routine should not be modified.
;;
; Contains Entry points and functions used in creating a 278 request from a
; selected entry in the HCSR Response worklist
;
; -------------------------- Entry Points --------------------------------
; REQMISS - Checks for missing required fields in a request
;-----------------------------------------------------------------------------
Q
;
REQMISS ; Additional required field checking for 278 transaction
; Input: CTC - Certification Type Code IEN
; IENS - IEN_"," of the entry being checked
; IBTRIEN - IEN of the entry being checked
; MISSING() - Current array of missing fields
; Output: MISSING() - Updated array of missing fields
N ACERT,ACOND,ADMIT,AMBCERT,AMBCOND,CHCERT,CHCOND
N DIR,DIROUT,DIRUT,DMECERT,DMECOND,DTOUT,DUOUT,ED,FLCERT,FLCOND,HCSDQ,HCSDCT
N I,MCERT,MCOND,OE1,OE2,OE3,OXYCERT,OXYCOND,PL,PW,SD,SPC,SPCT,TC,TD,TSN,TUM
N WU,X,XX,Y,YY
;
I $$GET1^DIQ(356.22,IENS,2.08)="",$$GET1^DIQ(356.22,IENS,2.09)'="" D ; Related Causes Code #1 is required if #2 has value
. D MISSING(2.08,"Related Causes #1 is required if Related Causes #2 has a value.")
;
I $$GET1^DIQ(356.22,IENS,2.09)="",$$GET1^DIQ(356.22,IENS,2.1)'="" D ; Related Causes Code #2 is required if #3 has value
. D MISSING(2.09,"Related Causes #2 is required if Related Causes #3 has a value.")
;
I CTC=1,$$GET1^DIQ(356.22,IENS,2.13)="" D ; Level of Service is required if Cert Type Code = 1 Immediate Appeal
. D MISSING(2.13,"Level of Service is required if Certification Type Code is Appeal - Immediate.")
;
S HCSDQ=$$GET1^DIQ(356.22,IENS,4.01),HCSDCT=$$GET1^DIQ(356.22,IENS,4.02)
I HCSDQ="",HCSDCT'="" D ; HCSD Quantity Qualifier is required if HCSD Service Unit Count
. D MISSING(4.01,"HCSD Quantity Qualifier is required if HCSD Service Unit Count has a value.")
I HCSDQ'="",HCSDCT="" D ; HCSD Service Unit Count is required if Qualifer exists
. D MISSING(4.02,"HCSD Service Unit Count is required if the HCSD Quantity Qualifier has a value.")
;
I $$GET1^DIQ(356.22,IENS,4.03)="",$$GET1^DIQ(356.22,IENS,4.04)'="" D ;HCSD Units of Measure is required if Modulus has value
. D MISSING(4.03,"HCSD Units of Measurement Code is required if the HCSD Sample Selection Modulus has a value.")
;
I $$GET1^DIQ(356.22,IENS,4.05)="",$$GET1^DIQ(356.22,IENS,4.06)'="" D ;HCSD Time Period Qual is required if Period Count exists
. D MISSING(4.05,"HCSD Time Period Qualifier is required of HCSD Period Count has a value.")
;
S AMBCERT=$$GET1^DIQ(356.22,IENS,4.09),AMBCOND=$$GET1^DIQ(356.22,IENS,4.1)
I (AMBCERT=""&(AMBCOND'=""))!(AMBCERT'=""&(AMBCOND="")) D ;if either AMBULANCE CERT COND or Cond #1 are present, both are required
. I AMBCERT="" D MISSING(4.09,"Ambulance Certification Condition Indicator is required if Ambulance Condition Indicator has a value.") Q
. D MISSING(4.1,"Ambulance Condition Indicator is required if the Ambulance Certification Condition Indicator has a value.")
;
S CHCERT=$$GET1^DIQ(356.22,IENS,5.01),CHCOND=$$GET1^DIQ(356.22,IENS,5.02)
I (CHCERT=""&(CHCOND'=""))!(CHCERT'=""&(CHCOND="")) D ;if either Chiropractic cert or Cond #1 are present, both are required
. I CHCERT="" D MISSING(5.01,"Chiropractic Certification Condition is required if the Condition Indicator has a value.") Q
. D MISSING(5.02,"Chiropractic Condition #1 is required if the Chiropractic Certification Condition indicator has a value.")
;
S DMECERT=$$GET1^DIQ(356.22,IENS,5.07),DMECOND=$$GET1^DIQ(356.22,IENS,5.08)
I (DMECERT=""&(DMECOND'=""))!(DMECERT'=""&(DMECOND="")) D ;if either DME Cert or DME Cond are present, both are required
. I DMECERT="" D MISSING(5.07,"DME Certification Condition Indicator is required if DME Condition Indicator has a value.") Q
. D MISSING(5.08,"DME Condition #1 is required if DME Certification Condition Indicator has a value.")
;
S OXYCERT=$$GET1^DIQ(356.22,IENS,5.13),OXYCOND=$$GET1^DIQ(356.22,IENS,5.14)
I (OXYCERT=""&(OXYCOND'=""))!(OXYCERT'=""&(OXYCOND="")) D ;if either Oxygen Cert or Oxygen Cond are present, both are required
. I OXYCERT="" D MISSING(5.13,"Oxygen Certification Condition Indicator is required if Oxygen Condition #1 has a value.") Q
. D MISSING(5.14,"Oxygen Condition #1 is required if Oxygen Certification Indicator has a value.")
;
S FLCERT=$$GET1^DIQ(356.22,IENS,6.01),FLCOND=$$GET1^DIQ(356.22,IENS,6.02)
I (FLCERT=""&(FLCOND'=""))!(FLCERT'=""&(FLCOND="")) D ;if either Funct. Limit Cert or Condition #1 are present, both are required
. I FLCERT="" D MISSING(6.01,"Functional Limitations Certification Indicator is required if Functional Limitations Condition #1 has a value.") Q
. D MISSING(6.02,"Function Limitations Condition #1 is required if Functional Limitations Certification Indicator has a value.")
;
S ACERT=$$GET1^DIQ(356.22,IENS,6.07),ACOND=$$GET1^DIQ(356.22,IENS,6.08)
I (ACERT=""&(ACOND'=""))!(ACERT'=""&(ACOND="")) D ;if either Activities Cert or Condition #1 are present, both are required
. I ACERT="" D MISSING(6.07,"Activities Certification Condition is required if Activities Condition #1 has a value.") Q
. D MISSING(6.08,"Activities Condition #1 is required if Activities Certification Condition Indicator has a value.")
;
S MCERT=$$GET1^DIQ(356.22,IENS,6.13),MCOND=$$GET1^DIQ(356.22,IENS,6.14)
I (MCERT=""&(MCOND'=""))!(MCERT'=""&(MCOND="")) D ;if either Mental Cert of Mental Condition #1 are present, both are required
. I MCERT="" D MISSING(6.13,"Mental Status Certification Condition is required if Mental Status Condition #1 has a value.") Q
. D MISSING(6.14,"Mental Status Condition #1 is required if Mental Status Certification Condition has a value.")
;
S ADMIT=$$GET1^DIQ(356.22,IENS,2.01,"I") I ADMIT S ADMIT=$P($G(^IBT(356.001,ADMIT,0)),"^")
I ADMIT="AR",$$GET1^DIQ(356.22,IENS,7.01)="" D ;Admission Type is required if Request Category = 'AR'
. D MISSING(7.01,"Admission Type is required if the Request Category is 'AR' for Admission Review.")
;
S WU=$$GET1^DIQ(356.22,IENS,18.01),PW=$$GET1^DIQ(356.22,IENS,18.02)
I (WU=""&(PW'=""))!(WU'=""&(PW="")) D ;if either Unit of Measurement or Patient Weight have value, then both are required
. I WU="" D MISSING(18.01,"The Unit or Basis of Measurement Code for Patient Weight is required if a Patient Weight exists.") Q
. D MISSING(18.02,"If a Unit or Basis of Measurement Code exists for Patient Weight, then a Patient Weight amount is required.")
;
I $$GET1^DIQ(356.22,IENS,18.03)="" D
. S XX=$G(^IBT(356.22,IBTRIEN,18)) F I=1,2,4:1:10 I $P(XX,"^",I)'="" S XX="BAD" Q
. I $G(XX)'="BAD" Q
. D MISSING(18.03,"The Ambulance Transport Code is required if any Ambulance Transport information is to be sent via this 278 Request.")
;
S TUM=$$GET1^DIQ(356.22,IENS,18.05),TD=$$GET1^DIQ(356.22,IENS,18.06)
I (TUM=""&(TD'=""))!(TUM'=""&(TD="")) D ;If either Ambulance Distance Unit of Measure or Transport Distance exists, both are required
. I TUM="" D MISSING(18.05,"Ambulance Distance Unit of Measurement Code is required if a Transport Distance has been entered.") Q
. D MISSING(18.06,"Ambulance Transport Distance is required if an Ambulance Distance Unit of Measure has been entered.")
;
S TSN=$$GET1^DIQ(356.22,IENS,7.05),TC=$$GET1^DIQ(356.22,IENS,7.06)
I (TSN=""&(TC'=""))!(TSN'=""&(TC="")) D ;if either Treatment Series Number or Treatment Count have value, both are required
. I TSN="" D MISSING(7.05,"Treatment Series Number is required if Treatment Count has a value.") Q
. D MISSING(7.06,"Treatment Count is required if Treatment Series Number has a value.")
;
I $$GET1^DIQ(356.22,IENS,7.08)'="",$$GET1^DIQ(356.22,IENS,7.07)="" D ;subluxation level code#1 must have value if code#2 exists
. D MISSING(7.07,"Subluxation Level Code #1 is required if Subluxation Level Code #2 has a value.")
;
I $$GET1^DIQ(356.22,IENS,7.09)="" D
. S XX=$G(^IBT(356.22,IBTRIEN,7)) F I=5:1:8,11:1:13 I $P(XX,"^",I)'="" S XX="BAD" Q
. I XX'="BAD" Q
. D MISSING(7.09,"Patient Condition Code is required if any Spinal Manipulation Service Information is to be sent via this 278 Request.")
;
I $$GET1^DIQ(356.22,IENS,7.1)="" D
. S XX=$G(^IBT(356.22,IBTRIEN,7)) F I=5:1:8,11:1:13 I $P(XX,"^",I)'="" S XX="BAD" Q
. I XX'="BAD" Q
. D MISSING(7.1,"Complication Indicator is required if any Spinal Manipulation Service Information is to be sent via this 278 Request.")
;
S OE1=$$GET1^DIQ(356.22,IENS,8.01),OE2=$$GET1^DIQ(356.22,IENS,8.02),OE3=$$GET1^DIQ(356.22,IENS,8.03)
I OE1="",($$GET1^DIQ(356.22,IENS,8.05)'=""!($$GET1^DIQ(356.22,IENS,9.08)'="")!(OE2'="")) D
. D MISSING(8.01,"Oxygen Equipment Type Code #1 is required if Home Oxygen Therapy information is included in this 278 Request.")
;
I OE2="",OE3'="" D
. D MISSING(8.02,"Oxygen Equipment Type Code #2 is required if Oxygen Equipment Type Code #3 has a value.")
;
I $$GET1^DIQ(356.22,IENS,8.05)="",(OE1'=""!($$GET1^DIQ(356.22,IENS,9.08)'="")) D
. D MISSING(8.05,"Oxygen Flow Rate is required if Home Oxygen Therapy information is included in this 278 Request.")
;
I OE1'="",$$GET1^DIQ(356.22,IENS,9.01)="",$$GET1^DIQ(356.22,IENS,9.02)="" D
. D MISSING(8.01,"If Home Oxygen Therapy information is included in this 278 Request, then either Arterial Blood Gas Quantity or Oxygen Saturation Quantity is required.")
;
I $$GET1^DIQ(356.22,IENS,9.08)="",(OE1'=""!($$GET1^DIQ(356.22,IENS,8.05)'="")) D
. D MISSING(9.08,"If Home Oxygen Therapy information is included in this 278 Request, then the Oxygen Delivery System Code is required.")
;
I $$GET1^DIQ(356.22,IENS,9.07)="" D
. I OE1=4!(OE2=4)!(OE3=4)!(OE1=5)!(OE2=5)!(OE3=5) D MISSING(9.07,"Portable Oxygen System Flow is required if Oxygen Equipment Code used is either Liquid Portable or Gaseous Portable.")
;
S ED=$$GET1^DIQ(356.22,IENS,10.03),SD=$$GET1^DIQ(356.22,IENS,10.02)
I ED'="",SD="" D
. D MISSING(10.02,"Home Health Certification Period Start Date is required if a Home Health Certification Period End Data is entered.")
I ED="",SD'="" D
. D MISSING(10.03,"Home Health Certification Period End Date is required if a Home Health Certification Period Start Date is entered.")
;
S SD=$$GET1^DIQ(356.22,IENS,10.05),SPCT=$$GET1^DIQ(356.22,IENS,10.06),SPC=$$GET1^DIQ(356.22,IENS,10.07)
I SD="",(SPCT'=""!(SPC'="")) D
. D MISSING(10.05,"Surgery Date is required if a Surgical Procedure Code or Code Type have a value.")
I SPCT="",(SD'=""!(SPC'="")) D
. D MISSING(10.06,"Surgery Procedure Code Type is required if a Surgery Date or Surgery Procedure Code have a value.")
I SPC="",(SD'=""!(SPCT'="")) D
. D MISSING(10.07,"Surgery Procedure Code is required if a Surgery Date or Surgery Procedure Code Type have a value.")
;
S SD=$$GET1^DIQ(356.22,IENS,10.11),ED=$$GET1^DIQ(356.22,IENS,10.12),PL=$$GET1^DIQ(356.22,IENS,10.13)
I SD="",(ED'=""!(PL'="")) D
. D MISSING(10.11,"Last Admission Start Date is required if the Last Admission End Date is specified or the Patient Location Code has a value.")
I ED="",SD'="" D
. D MISSING(10.12,"Last Admission End Date is required if the Last Admission Start Date is specified.")
I PL="",(ED'=""!(SD'="")) D
. D MISSING(10.13,"Patient Location Code is required if the Last Admission Start or End Dates are entered.")
;
D REQMISS^IBTRH5K ; Checking Multiples, new routine due to routine size 01/06/15 FA
Q
;
;
MISSING(SUB,DESC) ; Function to generate MISSING array
; Input: SUB - subscript of MISSING array
; DESC - description of error condition
; Returns: MISSING array
;
S MISSING=MISSING+1
S MISSING(SUB)=DESC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBTRH5J 11847 printed Dec 13, 2024@02:28:16 Page 2
IBTRH5J ;ALB/JWS - HCSR Create 278 Request ;11-DEC-2014
+1 ;;2.0;INTEGRATED BILLING;**517**;21-MAR-94;Build 240
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;;
+4 ; Contains Entry points and functions used in creating a 278 request from a
+5 ; selected entry in the HCSR Response worklist
+6 ;
+7 ; -------------------------- Entry Points --------------------------------
+8 ; REQMISS - Checks for missing required fields in a request
+9 ;-----------------------------------------------------------------------------
+10 QUIT
+11 ;
REQMISS ; Additional required field checking for 278 transaction
+1 ; Input: CTC - Certification Type Code IEN
+2 ; IENS - IEN_"," of the entry being checked
+3 ; IBTRIEN - IEN of the entry being checked
+4 ; MISSING() - Current array of missing fields
+5 ; Output: MISSING() - Updated array of missing fields
+6 NEW ACERT,ACOND,ADMIT,AMBCERT,AMBCOND,CHCERT,CHCOND
+7 NEW DIR,DIROUT,DIRUT,DMECERT,DMECOND,DTOUT,DUOUT,ED,FLCERT,FLCOND,HCSDQ,HCSDCT
+8 NEW I,MCERT,MCOND,OE1,OE2,OE3,OXYCERT,OXYCOND,PL,PW,SD,SPC,SPCT,TC,TD,TSN,TUM
+9 NEW WU,X,XX,Y,YY
+10 ;
+11 ; Related Causes Code #1 is required if #2 has value
IF $$GET1^DIQ(356.22,IENS,2.08)=""
IF $$GET1^DIQ(356.22,IENS,2.09)'=""
Begin DoDot:1
+12 DO MISSING(2.08,"Related Causes #1 is required if Related Causes #2 has a value.")
End DoDot:1
+13 ;
+14 ; Related Causes Code #2 is required if #3 has value
IF $$GET1^DIQ(356.22,IENS,2.09)=""
IF $$GET1^DIQ(356.22,IENS,2.1)'=""
Begin DoDot:1
+15 DO MISSING(2.09,"Related Causes #2 is required if Related Causes #3 has a value.")
End DoDot:1
+16 ;
+17 ; Level of Service is required if Cert Type Code = 1 Immediate Appeal
IF CTC=1
IF $$GET1^DIQ(356.22,IENS,2.13)=""
Begin DoDot:1
+18 DO MISSING(2.13,"Level of Service is required if Certification Type Code is Appeal - Immediate.")
End DoDot:1
+19 ;
+20 SET HCSDQ=$$GET1^DIQ(356.22,IENS,4.01)
SET HCSDCT=$$GET1^DIQ(356.22,IENS,4.02)
+21 ; HCSD Quantity Qualifier is required if HCSD Service Unit Count
IF HCSDQ=""
IF HCSDCT'=""
Begin DoDot:1
+22 DO MISSING(4.01,"HCSD Quantity Qualifier is required if HCSD Service Unit Count has a value.")
End DoDot:1
+23 ; HCSD Service Unit Count is required if Qualifer exists
IF HCSDQ'=""
IF HCSDCT=""
Begin DoDot:1
+24 DO MISSING(4.02,"HCSD Service Unit Count is required if the HCSD Quantity Qualifier has a value.")
End DoDot:1
+25 ;
+26 ;HCSD Units of Measure is required if Modulus has value
IF $$GET1^DIQ(356.22,IENS,4.03)=""
IF $$GET1^DIQ(356.22,IENS,4.04)'=""
Begin DoDot:1
+27 DO MISSING(4.03,"HCSD Units of Measurement Code is required if the HCSD Sample Selection Modulus has a value.")
End DoDot:1
+28 ;
+29 ;HCSD Time Period Qual is required if Period Count exists
IF $$GET1^DIQ(356.22,IENS,4.05)=""
IF $$GET1^DIQ(356.22,IENS,4.06)'=""
Begin DoDot:1
+30 DO MISSING(4.05,"HCSD Time Period Qualifier is required of HCSD Period Count has a value.")
End DoDot:1
+31 ;
+32 SET AMBCERT=$$GET1^DIQ(356.22,IENS,4.09)
SET AMBCOND=$$GET1^DIQ(356.22,IENS,4.1)
+33 ;if either AMBULANCE CERT COND or Cond #1 are present, both are required
IF (AMBCERT=""&(AMBCOND'=""))!(AMBCERT'=""&(AMBCOND=""))
Begin DoDot:1
+34 IF AMBCERT=""
DO MISSING(4.09,"Ambulance Certification Condition Indicator is required if Ambulance Condition Indicator has a value.")
QUIT
+35 DO MISSING(4.1,"Ambulance Condition Indicator is required if the Ambulance Certification Condition Indicator has a value.")
End DoDot:1
+36 ;
+37 SET CHCERT=$$GET1^DIQ(356.22,IENS,5.01)
SET CHCOND=$$GET1^DIQ(356.22,IENS,5.02)
+38 ;if either Chiropractic cert or Cond #1 are present, both are required
IF (CHCERT=""&(CHCOND'=""))!(CHCERT'=""&(CHCOND=""))
Begin DoDot:1
+39 IF CHCERT=""
DO MISSING(5.01,"Chiropractic Certification Condition is required if the Condition Indicator has a value.")
QUIT
+40 DO MISSING(5.02,"Chiropractic Condition #1 is required if the Chiropractic Certification Condition indicator has a value.")
End DoDot:1
+41 ;
+42 SET DMECERT=$$GET1^DIQ(356.22,IENS,5.07)
SET DMECOND=$$GET1^DIQ(356.22,IENS,5.08)
+43 ;if either DME Cert or DME Cond are present, both are required
IF (DMECERT=""&(DMECOND'=""))!(DMECERT'=""&(DMECOND=""))
Begin DoDot:1
+44 IF DMECERT=""
DO MISSING(5.07,"DME Certification Condition Indicator is required if DME Condition Indicator has a value.")
QUIT
+45 DO MISSING(5.08,"DME Condition #1 is required if DME Certification Condition Indicator has a value.")
End DoDot:1
+46 ;
+47 SET OXYCERT=$$GET1^DIQ(356.22,IENS,5.13)
SET OXYCOND=$$GET1^DIQ(356.22,IENS,5.14)
+48 ;if either Oxygen Cert or Oxygen Cond are present, both are required
IF (OXYCERT=""&(OXYCOND'=""))!(OXYCERT'=""&(OXYCOND=""))
Begin DoDot:1
+49 IF OXYCERT=""
DO MISSING(5.13,"Oxygen Certification Condition Indicator is required if Oxygen Condition #1 has a value.")
QUIT
+50 DO MISSING(5.14,"Oxygen Condition #1 is required if Oxygen Certification Indicator has a value.")
End DoDot:1
+51 ;
+52 SET FLCERT=$$GET1^DIQ(356.22,IENS,6.01)
SET FLCOND=$$GET1^DIQ(356.22,IENS,6.02)
+53 ;if either Funct. Limit Cert or Condition #1 are present, both are required
IF (FLCERT=""&(FLCOND'=""))!(FLCERT'=""&(FLCOND=""))
Begin DoDot:1
+54 IF FLCERT=""
DO MISSING(6.01,"Functional Limitations Certification Indicator is required if Functional Limitations Condition #1 has a value.")
QUIT
+55 DO MISSING(6.02,"Function Limitations Condition #1 is required if Functional Limitations Certification Indicator has a value.")
End DoDot:1
+56 ;
+57 SET ACERT=$$GET1^DIQ(356.22,IENS,6.07)
SET ACOND=$$GET1^DIQ(356.22,IENS,6.08)
+58 ;if either Activities Cert or Condition #1 are present, both are required
IF (ACERT=""&(ACOND'=""))!(ACERT'=""&(ACOND=""))
Begin DoDot:1
+59 IF ACERT=""
DO MISSING(6.07,"Activities Certification Condition is required if Activities Condition #1 has a value.")
QUIT
+60 DO MISSING(6.08,"Activities Condition #1 is required if Activities Certification Condition Indicator has a value.")
End DoDot:1
+61 ;
+62 SET MCERT=$$GET1^DIQ(356.22,IENS,6.13)
SET MCOND=$$GET1^DIQ(356.22,IENS,6.14)
+63 ;if either Mental Cert of Mental Condition #1 are present, both are required
IF (MCERT=""&(MCOND'=""))!(MCERT'=""&(MCOND=""))
Begin DoDot:1
+64 IF MCERT=""
DO MISSING(6.13,"Mental Status Certification Condition is required if Mental Status Condition #1 has a value.")
QUIT
+65 DO MISSING(6.14,"Mental Status Condition #1 is required if Mental Status Certification Condition has a value.")
End DoDot:1
+66 ;
+67 SET ADMIT=$$GET1^DIQ(356.22,IENS,2.01,"I")
IF ADMIT
SET ADMIT=$PIECE($GET(^IBT(356.001,ADMIT,0)),"^")
+68 ;Admission Type is required if Request Category = 'AR'
IF ADMIT="AR"
IF $$GET1^DIQ(356.22,IENS,7.01)=""
Begin DoDot:1
+69 DO MISSING(7.01,"Admission Type is required if the Request Category is 'AR' for Admission Review.")
End DoDot:1
+70 ;
+71 SET WU=$$GET1^DIQ(356.22,IENS,18.01)
SET PW=$$GET1^DIQ(356.22,IENS,18.02)
+72 ;if either Unit of Measurement or Patient Weight have value, then both are required
IF (WU=""&(PW'=""))!(WU'=""&(PW=""))
Begin DoDot:1
+73 IF WU=""
DO MISSING(18.01,"The Unit or Basis of Measurement Code for Patient Weight is required if a Patient Weight exists.")
QUIT
+74 DO MISSING(18.02,"If a Unit or Basis of Measurement Code exists for Patient Weight, then a Patient Weight amount is required.")
End DoDot:1
+75 ;
+76 IF $$GET1^DIQ(356.22,IENS,18.03)=""
Begin DoDot:1
+77 SET XX=$GET(^IBT(356.22,IBTRIEN,18))
FOR I=1,2,4:1:10
IF $PIECE(XX,"^",I)'=""
SET XX="BAD"
QUIT
+78 IF $GET(XX)'="BAD"
QUIT
+79 DO MISSING(18.03,"The Ambulance Transport Code is required if any Ambulance Transport information is to be sent via this 278 Request.")
End DoDot:1
+80 ;
+81 SET TUM=$$GET1^DIQ(356.22,IENS,18.05)
SET TD=$$GET1^DIQ(356.22,IENS,18.06)
+82 ;If either Ambulance Distance Unit of Measure or Transport Distance exists, both are required
IF (TUM=""&(TD'=""))!(TUM'=""&(TD=""))
Begin DoDot:1
+83 IF TUM=""
DO MISSING(18.05,"Ambulance Distance Unit of Measurement Code is required if a Transport Distance has been entered.")
QUIT
+84 DO MISSING(18.06,"Ambulance Transport Distance is required if an Ambulance Distance Unit of Measure has been entered.")
End DoDot:1
+85 ;
+86 SET TSN=$$GET1^DIQ(356.22,IENS,7.05)
SET TC=$$GET1^DIQ(356.22,IENS,7.06)
+87 ;if either Treatment Series Number or Treatment Count have value, both are required
IF (TSN=""&(TC'=""))!(TSN'=""&(TC=""))
Begin DoDot:1
+88 IF TSN=""
DO MISSING(7.05,"Treatment Series Number is required if Treatment Count has a value.")
QUIT
+89 DO MISSING(7.06,"Treatment Count is required if Treatment Series Number has a value.")
End DoDot:1
+90 ;
+91 ;subluxation level code#1 must have value if code#2 exists
IF $$GET1^DIQ(356.22,IENS,7.08)'=""
IF $$GET1^DIQ(356.22,IENS,7.07)=""
Begin DoDot:1
+92 DO MISSING(7.07,"Subluxation Level Code #1 is required if Subluxation Level Code #2 has a value.")
End DoDot:1
+93 ;
+94 IF $$GET1^DIQ(356.22,IENS,7.09)=""
Begin DoDot:1
+95 SET XX=$GET(^IBT(356.22,IBTRIEN,7))
FOR I=5:1:8,11:1:13
IF $PIECE(XX,"^",I)'=""
SET XX="BAD"
QUIT
+96 IF XX'="BAD"
QUIT
+97 DO MISSING(7.09,"Patient Condition Code is required if any Spinal Manipulation Service Information is to be sent via this 278 Request.")
End DoDot:1
+98 ;
+99 IF $$GET1^DIQ(356.22,IENS,7.1)=""
Begin DoDot:1
+100 SET XX=$GET(^IBT(356.22,IBTRIEN,7))
FOR I=5:1:8,11:1:13
IF $PIECE(XX,"^",I)'=""
SET XX="BAD"
QUIT
+101 IF XX'="BAD"
QUIT
+102 DO MISSING(7.1,"Complication Indicator is required if any Spinal Manipulation Service Information is to be sent via this 278 Request.")
End DoDot:1
+103 ;
+104 SET OE1=$$GET1^DIQ(356.22,IENS,8.01)
SET OE2=$$GET1^DIQ(356.22,IENS,8.02)
SET OE3=$$GET1^DIQ(356.22,IENS,8.03)
+105 IF OE1=""
IF ($$GET1^DIQ(356.22,IENS,8.05)'=""!($$GET1^DIQ(356.22,IENS,9.08)'="")!(OE2'=""))
Begin DoDot:1
+106 DO MISSING(8.01,"Oxygen Equipment Type Code #1 is required if Home Oxygen Therapy information is included in this 278 Request.")
End DoDot:1
+107 ;
+108 IF OE2=""
IF OE3'=""
Begin DoDot:1
+109 DO MISSING(8.02,"Oxygen Equipment Type Code #2 is required if Oxygen Equipment Type Code #3 has a value.")
End DoDot:1
+110 ;
+111 IF $$GET1^DIQ(356.22,IENS,8.05)=""
IF (OE1'=""!($$GET1^DIQ(356.22,IENS,9.08)'=""))
Begin DoDot:1
+112 DO MISSING(8.05,"Oxygen Flow Rate is required if Home Oxygen Therapy information is included in this 278 Request.")
End DoDot:1
+113 ;
+114 IF OE1'=""
IF $$GET1^DIQ(356.22,IENS,9.01)=""
IF $$GET1^DIQ(356.22,IENS,9.02)=""
Begin DoDot:1
+115 DO MISSING(8.01,"If Home Oxygen Therapy information is included in this 278 Request, then either Arterial Blood Gas Quantity or Oxygen Saturation Quantity is required.")
End DoDot:1
+116 ;
+117 IF $$GET1^DIQ(356.22,IENS,9.08)=""
IF (OE1'=""!($$GET1^DIQ(356.22,IENS,8.05)'=""))
Begin DoDot:1
+118 DO MISSING(9.08,"If Home Oxygen Therapy information is included in this 278 Request, then the Oxygen Delivery System Code is required.")
End DoDot:1
+119 ;
+120 IF $$GET1^DIQ(356.22,IENS,9.07)=""
Begin DoDot:1
+121 IF OE1=4!(OE2=4)!(OE3=4)!(OE1=5)!(OE2=5)!(OE3=5)
DO MISSING(9.07,"Portable Oxygen System Flow is required if Oxygen Equipment Code used is either Liquid Portable or Gaseous Portable.")
End DoDot:1
+122 ;
+123 SET ED=$$GET1^DIQ(356.22,IENS,10.03)
SET SD=$$GET1^DIQ(356.22,IENS,10.02)
+124 IF ED'=""
IF SD=""
Begin DoDot:1
+125 DO MISSING(10.02,"Home Health Certification Period Start Date is required if a Home Health Certification Period End Data is entered.")
End DoDot:1
+126 IF ED=""
IF SD'=""
Begin DoDot:1
+127 DO MISSING(10.03,"Home Health Certification Period End Date is required if a Home Health Certification Period Start Date is entered.")
End DoDot:1
+128 ;
+129 SET SD=$$GET1^DIQ(356.22,IENS,10.05)
SET SPCT=$$GET1^DIQ(356.22,IENS,10.06)
SET SPC=$$GET1^DIQ(356.22,IENS,10.07)
+130 IF SD=""
IF (SPCT'=""!(SPC'=""))
Begin DoDot:1
+131 DO MISSING(10.05,"Surgery Date is required if a Surgical Procedure Code or Code Type have a value.")
End DoDot:1
+132 IF SPCT=""
IF (SD'=""!(SPC'=""))
Begin DoDot:1
+133 DO MISSING(10.06,"Surgery Procedure Code Type is required if a Surgery Date or Surgery Procedure Code have a value.")
End DoDot:1
+134 IF SPC=""
IF (SD'=""!(SPCT'=""))
Begin DoDot:1
+135 DO MISSING(10.07,"Surgery Procedure Code is required if a Surgery Date or Surgery Procedure Code Type have a value.")
End DoDot:1
+136 ;
+137 SET SD=$$GET1^DIQ(356.22,IENS,10.11)
SET ED=$$GET1^DIQ(356.22,IENS,10.12)
SET PL=$$GET1^DIQ(356.22,IENS,10.13)
+138 IF SD=""
IF (ED'=""!(PL'=""))
Begin DoDot:1
+139 DO MISSING(10.11,"Last Admission Start Date is required if the Last Admission End Date is specified or the Patient Location Code has a value.")
End DoDot:1
+140 IF ED=""
IF SD'=""
Begin DoDot:1
+141 DO MISSING(10.12,"Last Admission End Date is required if the Last Admission Start Date is specified.")
End DoDot:1
+142 IF PL=""
IF (ED'=""!(SD'=""))
Begin DoDot:1
+143 DO MISSING(10.13,"Patient Location Code is required if the Last Admission Start or End Dates are entered.")
End DoDot:1
+144 ;
+145 ; Checking Multiples, new routine due to routine size 01/06/15 FA
DO REQMISS^IBTRH5K
+146 QUIT
+147 ;
+148 ;
MISSING(SUB,DESC) ; Function to generate MISSING array
+1 ; Input: SUB - subscript of MISSING array
+2 ; DESC - description of error condition
+3 ; Returns: MISSING array
+4 ;
+5 SET MISSING=MISSING+1
+6 SET MISSING(SUB)=DESC
+7 QUIT