IBTRH5G ;ALB/FA - HCSR Create 278 Request ;01-OCT-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 --------------------------------
; CERTDATA - Determines which (if any) Certification Condition Categories
; contain data
; CONTINFO - Checks for contact number data for subsequent numbers
; SECTDATA - Determines if a specified section contains any fields with
; values and (optionally) displays the all the section's fields
; and their values
;-----------------------------------------------------------------------------
;
CONTINFO(IBTRIEN,FIELD) ;EP
; Called from Input Template IB CREATE 278 REQUEST for fields: 20, 21
; Checks to see if subsequent Contact number entries have values.
; Input: IBTRIEN - IEN of entry being processed
; FIELD - Field # of the field being checked
; Set to 'ALL' to see if any of the 3 have a value
; DA - IEN of the 356.22 entry being edited
; Returns: 1 - Subsequent entries have values, 0 otherwise
N RETURN,XX,ZZ
S RETURN=0
;
I FIELD=20 D Q RETURN
. S XX=$$GET1^DIQ(356.22,IBTRIEN_",",21,"I")
. S ZZ=$$GET1^DIQ(356.22,IBTRIEN_",",22,"I")
. I (XX'="")!(ZZ'="") S RETURN=1 Q
I FIELD=21 D Q RETURN
. I $$GET1^DIQ(356.22,IBTRIEN_",",22,"I")'="" S RETURN=1 Q
Q RETURN
;
CERTDATA(IBTRIEN) ;EP
; Called from within Input template IB CREATE 278 REQUEST
; Determines which Certification Condition Categories contains any fields with
; values and then displays a list of Categories that Contain data.
; Input: IBTRIEN - IEN of the 356.22 entry being examined
; Output: Displays a list of Certification Condition Categories that have at
; least one field with a value. If no Certification Condition
; Categories have a value then nothing is displayed.
N CATS,CTR,IX,LEN,DISP,FIRST,XX
S CATS="",CTR=1
I $$CHKFLDS(356.22,IBTRIEN_",","4.09^4.1^4.11^4.12^4.13^4.14") D
. S CATS(CTR)="Ambulance"
. I $$CHKFLDS(356.22,IBTRIEN_",","18.01^18.02^18.03^18.04^18.05^18.06^18.09^18.1") D
. . S CATS(CTR)=CATS(CTR)_" W/Amb Trans Info"
. I $$CHKFLDSM(356.22,IBTRIEN,14,".01^.02^.03^.04^.05^.07") D
. . S XX="Pat Trans Info"
. . S CATS(CTR)=CATS(CTR)_$S(CATS(CTR)["Amb Trans Info":",",1:"")_" "_XX
. S CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","5.01^5.02^5.03^5.04^5.05^5.06") D
. S CATS(CTR)="Chiropractic"
. I $$CHKFLDS(356.22,IBTRIEN_",","7.05^7.06^7.07^7.08^7.09^7.1^7.11^7.12^7.13") D
. . S CATS(CTR)=CATS(CTR)_" W/Spinal Service Info"
. S CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","5.07^5.08^5.09^5.1^5.11^5.12") D
. S CATS(CTR)="DME",CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","5.13^5.14^5.15^5.16^5.17^5.18") D
. S CATS(CTR)="Oxygen"
. S XX="8.01^8.02^8.03^8.04^8.05^8.06^8.07^8.08^9.01^9.02^9.03^9.04^9.05^9.06^9.07^9.08"
. I $$CHKFLDS(356.22,IBTRIEN_",",XX) D
. . S CATS(CTR)=CATS(CTR)_" W/Home Oxygen Therapy Info"
. S CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","6.01^6.02^6.03^6.04^6.05^6.06") D
. S CATS(CTR)="Functional Limits",CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","6.07^6.08^6.09^6.1^6.11^6.12") D
. S CATS(CTR)="Activities",CTR=CTR+1
I $$CHKFLDS(356.22,IBTRIEN_",","6.13^6.14^6.15^6.16^6.17^6.18") D
. S CATS(CTR)="Mental Status",CTR=CTR+1
;
; No Certification Condition Categories contain data
Q:CTR=1
;
W !!,"The following Certification Condition Categories contain data:"
S IX="",DISP=" ",FIRST=1
F D Q:IX=""
. S IX=$O(CATS(IX))
. Q:IX=""
. I 'FIRST,($L(DISP)+$L(CATS(IX))+2)>79 D Q
. . W !,DISP,","
. . S DISP=" "_CATS(IX)
. I FIRST S DISP=DISP_CATS(IX),FIRST=0 Q
. S DISP=DISP_", "_CATS(IX)
W:$TR(DISP," ","")'="" !,DISP
W !
Q
;
CHKFLDSM(FILE,IBTRIEN,NDE,FIELDS) ; Checks all multiples for a specified node to see if
; any of the specified fields are non-null
; Input: FILE - # of file being checked
; IBTRIEN - IEN of the entry being checked
; NDE - Multiple node to check for data
; FIELDS - '^' delimited list of fields to be examined
; Returns: 1 - At least one field of one multiple is non-null, 0 otherwise
N FOUND,IEN,IENS,SFILE
S (FOUND,IEN)=0,SFILE=FILE_NDE
F D Q:+IEN=0!FOUND
. S IEN=$O(^IBT(FILE,IBTRIEN,NDE,IEN))
. Q:+IEN=0
. S IENS=IEN_","_IBTRIEN_","
. S:$$CHKFLDS(SFILE,IENS,FIELDS) FOUND=1
Q FOUND
;
CHKFLDS(FILE,IENS,FIELDS) ; Checks to see if any of the specified pieces of the
; specified node are non-null
; Input: FILE - # of file being checked
; IENS - IEN list of the 356.22 entry being examined
; FIELDS - '^' delimited list of fields to be examined
; Returns: 1 - At least one field is non-null, 0 otherwise
N FIELD,FOUND,IX
S FOUND=0
F IX=1:1:$L(FIELDS,"^") D Q:FOUND
. S FIELD=$P(FIELDS,"^",IX)
. S:$$GET1^DIQ(FILE,IENS_",",FIELD,"I")'="" FOUND=1
Q:FOUND 1
Q 0
;
SECTDATA(IBTRIEN,SIEN,SECTION,HEADER,DISPLAY) ;EP
; Called from within Input template IB CREATE 278 REQUEST
; Determines if the specified section contains any fields with values and
; (optionally) displays all of the section's fields and their values.
; Input: IBTRIEN - IEN of the 356.22 entry being edited
; SIEN - IEN of the service line multiple being examined
; NOTE: Only passed if examinng a service line section.
; SECTION - Identifier for the section to be examined
; HCSD - Health Care Services Delivery Section
; AMBTI - Ambulance Transport Information Section
; SPMSI - Spinal Manipulation Service Info Section
; HOTI - Home Oxygen Therapy Info Section
; HHCI - Home Health Care Info Section
; SHCRSI - Service Line HCRS Information Section
; CMPI - Service Line Composite Medical Procedure Info
; Section
; OCDI - Service Line Oral Cavity Designation Info
; Section
; SHCSD - Service Line Health Care Services Delivery
; HEADER - Header text to show when displaying a section's field
; DISPLAY - 1 to display all of the section's field if at least one
; field has a value. 0 otherwise
; Output: Displays a section's fields and their values if DISPLAY=1 and the
; specified section has at least one field with a value
; Returns: '*' - At least one field in the section contains a value
; "" - Otherwise
N DATA,FIELD,FILE,FLDS,FNUM,FPROMPT,IX,LINE,MAXL,NDE,NODE,PCE,VAL
S:'$D(SIEN) SIEN=""
S MAXL=0
;
; First get and array of the fields in the section
F IX=1:1 D Q:$P(LINE,";",3)="%END%"
. S LINE=SECTION_"+"_IX_"^IBTRH5G"
. S LINE=$T(@LINE)
. Q:$P(LINE,";",3)="%END%"
. S FNUM=$P(LINE,";",3),FPROMPT=$P(LINE,";",4)
. S:$L(FPROMPT)>MAXL MAXL=$L(FPROMPT)
. S FLDS(IX)=FNUM_"^"_FPROMPT
;
; Next determine if any of the section's fields contain data
S DATA="",IX=""
F D Q:(DATA="*")!(IX="")
. S IX=$O(FLDS(IX))
. Q:IX=""
. S FIELD=$P(FLDS(IX),"^",1),NDE=+$P(FIELD,".",1),PCE=$P(FIELD,".",2)
. S PCE=$S(PCE="1":10,PCE="2":20,PCE="3":30,1:+PCE)
. I SIEN="" S:$P($G(^IBT(356.22,IBTRIEN,NDE)),"^",PCE)'="" DATA="*"
. I SIEN'="" S:$P($G(^IBT(356.22,IBTRIEN,16,SIEN,NDE)),"^",PCE)'="" DATA="*"
Q:DATA="" ""
I 'DISPLAY Q "*"
;
; Next display the section and it's values
W !!,HEADER," contains the following values:",!
S FILE=$S(SIEN="":356.22,1:356.2216),MAXL=MAXL+3
S IX=""
F D Q:IX=""
. S IX=$O(FLDS(IX))
. Q:IX=""
. S FIELD=$P(FLDS(IX),"^",1),NDE=+$P(FIELD,".",1)
. S PCE=$P(FIELD,".",2),PCE=$S(PCE="1":10,PCE="2":20,PCE="3":30,1:+PCE)
. W !,$P(FLDS(IX),"^",2),": "
. I SIEN="" S VAL=$P($G(^IBT(356.22,IBTRIEN,NDE)),"^",PCE)
. I SIEN'="" S VAL=$P($G(^IBT(356.22,IBTRIEN,16,SIEN,NDE)),"^",PCE)
. W ?MAXL,$$EXTERNAL^DILFD(FILE,FIELD,"",VAL)
W !
I (SECTION="SHCRSI")!(SECTION="CMPI")!(SECTION="OCDI")!(SECTION="SHCSD") W !
Q "*"
;
; -------------------------- IB CREATE 278 REQUEST Fields ----------------
; Below is a listing of all of the fields in the template that are in
; 'skipable' sections. The comment line of each section = ;;A1;A2;A3;A4 Where:
; A1 - Field number of the section field (1st '.' piece is the storage node
; 2nd '.' piece is stoarge piece)
; A2 - Prompt used in the Input Template
; NOTE: If this prompt is changed in the Input Template, it must be
; updated here
; A3 - REQ - If field is unconditionally required. "" otherwise
; A4 - Default value (if any)
;-----------------------------------------------------------------------------
;
HCSD ; Health Care Services Delivery Section fields
;;4.01;Service Quantity Qualifier
;;4.02;Service Unit Count
;;4.03;Sample Selection Units of Measurement
;;4.04;Sample Selection Modulus
;;4.05;Time Period Qualifier
;;4.06;Period Count
;;4.07;Delivery Frequency Code
;;4.08;Delivery Pattern Time
;;%END%
AMBTI ; Ambulance Transport Information fields
;;18.02;Patient Weight
;;18.01;Patient Weight Units
;;18.03;Transport Code;REQ
;;18.04;Transport Reason Code
;;18.06;Transport Distance
;;18.09;Round Trip Purpose Description
;;18.1;Stretcher Purpose Description
;;%END%
SPMSI ; Spinal Manipulation Service Information
;;7.05;Treatment Series #
;;7.06;Treatment Count
;;7.07;Subluxation Level #1
;;7.08;Subluxation Level #2
;;7.09;Patient Condition;REQ
;;7.1;Complication Indicator;REQ;N
;;7.11;Patient Condition Description Line 1
;;7.12;Patient Condition Description Line 2
;;7.13;X-Ray Availability Indicator;;N
;;%END%
HOTI ; Home Oxygen Therapy Information
;;8.01;Oxygen Equipment Type #1;REQ
;;8.02;Oxygen Equipment Type #2
;;8.03;Oxygen Equipment Type #3
;;8.04;Equipment Reason Description
;;8.05;Oxygen Flow Rate;REQ
;;8.06;Daily Oxygen Use Count
;;8.07;Oxygen User Period Hour Count
;;8.08;Repiratory Therapist Order Text
;;9.01;Arterial Blood Gas Quantity
;;9.02;Oxygen Saturation Quantity
;;9.03;Oxygen Test Condition
;;9.04;Oxygen Test Findings #1
;;9.05;Oxygen Test Findings #2
;;9.06;Oxygen Test Findings #3
;;9.07;Portable Oxygen System Flow Rate
;;9.08;Oxygen Delivery System;REQ
;;%END%
HHCI ; Home Health Care Information
;;2.15;Prognosis
;;10.01;Home Health Start Date;REQ
;;10.02;Home Health Cert. Start Date
;;10.03;Home Health Cert. End Date;REQ
;;10.05;Surgery Date
;;10.06;Procedure Coding Method
;;10.07;Surgical Procedure
;;10.08;Physician Verbal Order Date
;;10.09;Last Visit Date
;;10.1;Physician/Home Health Contact Date
;;10.11;Start Date of Last Admission
;;10.12;End Date of Last Admission
;;10.13;Last Admission Facility
;;%END%
SHCRSI ; Service HCRS Information
;;.15; Request Category
;;.02; Service Certification Type
;;.03; Service Type
;;.06; Service Location of Care
;;.07; Service Bill Classification;REQ
;;.05; Place of Service
;;%END%
CMPI ; Composite Medical Procedure Information
;;1.01; Procedure Coding Method;REQ
;;1.02; Procedure Code;REQ
;;1.03; Ending Procedure Code
;;1.04; Procedure Modifier #1
;;1.05; Procedure Modifier #2
;;1.06; Procedure Modifier #3
;;1.07; Procedure Modifier #4
;;1.08; Procedure Description
;;%END%
OCDI ; Oral Cavity Designation Information
;;3.01; Oral Cavity Designation #1;REQ
;;3.02; Oral Cavity Designation #2
;;3.03; Oral Cavity Designation #3
;;3.04; Oral Cavity Designation #4
;;3.05; Oral Cavity Designation #5
;;%END%
SHCSD ; Service Line Health Care Services Delivery
;;5.01; Service Quantity Qualifier
;;5.02; Service Unit Count
;;5.03; Sample Selection Units of Measurement
;;5.04; Sample Selection Modulus
;;5.05; Time Period Qualifier
;;5.06; Period Count
;;5.07; Delivery Frequency Code
;;5.08; Delivery Pattern Time
;;%END%
AEREL ; Accident Relation Information
;;2.08;Related Causes #1
;;2.09;Related Causes #2
;;2.1;Related Causes #3
;;2.11;Auto Accident State
;;2.12;Auto Accident Country
;;2.18;Accident Date
;;%END%
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBTRH5G 12636 printed Dec 13, 2024@02:28:13 Page 2
IBTRH5G ;ALB/FA - HCSR Create 278 Request ;01-OCT-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 ; CERTDATA - Determines which (if any) Certification Condition Categories
+9 ; contain data
+10 ; CONTINFO - Checks for contact number data for subsequent numbers
+11 ; SECTDATA - Determines if a specified section contains any fields with
+12 ; values and (optionally) displays the all the section's fields
+13 ; and their values
+14 ;-----------------------------------------------------------------------------
+15 ;
CONTINFO(IBTRIEN,FIELD) ;EP
+1 ; Called from Input Template IB CREATE 278 REQUEST for fields: 20, 21
+2 ; Checks to see if subsequent Contact number entries have values.
+3 ; Input: IBTRIEN - IEN of entry being processed
+4 ; FIELD - Field # of the field being checked
+5 ; Set to 'ALL' to see if any of the 3 have a value
+6 ; DA - IEN of the 356.22 entry being edited
+7 ; Returns: 1 - Subsequent entries have values, 0 otherwise
+8 NEW RETURN,XX,ZZ
+9 SET RETURN=0
+10 ;
+11 IF FIELD=20
Begin DoDot:1
+12 SET XX=$$GET1^DIQ(356.22,IBTRIEN_",",21,"I")
+13 SET ZZ=$$GET1^DIQ(356.22,IBTRIEN_",",22,"I")
+14 IF (XX'="")!(ZZ'="")
SET RETURN=1
QUIT
End DoDot:1
QUIT RETURN
+15 IF FIELD=21
Begin DoDot:1
+16 IF $$GET1^DIQ(356.22,IBTRIEN_",",22,"I")'=""
SET RETURN=1
QUIT
End DoDot:1
QUIT RETURN
+17 QUIT RETURN
+18 ;
CERTDATA(IBTRIEN) ;EP
+1 ; Called from within Input template IB CREATE 278 REQUEST
+2 ; Determines which Certification Condition Categories contains any fields with
+3 ; values and then displays a list of Categories that Contain data.
+4 ; Input: IBTRIEN - IEN of the 356.22 entry being examined
+5 ; Output: Displays a list of Certification Condition Categories that have at
+6 ; least one field with a value. If no Certification Condition
+7 ; Categories have a value then nothing is displayed.
+8 NEW CATS,CTR,IX,LEN,DISP,FIRST,XX
+9 SET CATS=""
SET CTR=1
+10 IF $$CHKFLDS(356.22,IBTRIEN_",","4.09^4.1^4.11^4.12^4.13^4.14")
Begin DoDot:1
+11 SET CATS(CTR)="Ambulance"
+12 IF $$CHKFLDS(356.22,IBTRIEN_",","18.01^18.02^18.03^18.04^18.05^18.06^18.09^18.1")
Begin DoDot:2
+13 SET CATS(CTR)=CATS(CTR)_" W/Amb Trans Info"
End DoDot:2
+14 IF $$CHKFLDSM(356.22,IBTRIEN,14,".01^.02^.03^.04^.05^.07")
Begin DoDot:2
+15 SET XX="Pat Trans Info"
+16 SET CATS(CTR)=CATS(CTR)_$SELECT(CATS(CTR)["Amb Trans Info":",",1:"")_" "_XX
End DoDot:2
+17 SET CTR=CTR+1
End DoDot:1
+18 IF $$CHKFLDS(356.22,IBTRIEN_",","5.01^5.02^5.03^5.04^5.05^5.06")
Begin DoDot:1
+19 SET CATS(CTR)="Chiropractic"
+20 IF $$CHKFLDS(356.22,IBTRIEN_",","7.05^7.06^7.07^7.08^7.09^7.1^7.11^7.12^7.13")
Begin DoDot:2
+21 SET CATS(CTR)=CATS(CTR)_" W/Spinal Service Info"
End DoDot:2
+22 SET CTR=CTR+1
End DoDot:1
+23 IF $$CHKFLDS(356.22,IBTRIEN_",","5.07^5.08^5.09^5.1^5.11^5.12")
Begin DoDot:1
+24 SET CATS(CTR)="DME"
SET CTR=CTR+1
End DoDot:1
+25 IF $$CHKFLDS(356.22,IBTRIEN_",","5.13^5.14^5.15^5.16^5.17^5.18")
Begin DoDot:1
+26 SET CATS(CTR)="Oxygen"
+27 SET XX="8.01^8.02^8.03^8.04^8.05^8.06^8.07^8.08^9.01^9.02^9.03^9.04^9.05^9.06^9.07^9.08"
+28 IF $$CHKFLDS(356.22,IBTRIEN_",",XX)
Begin DoDot:2
+29 SET CATS(CTR)=CATS(CTR)_" W/Home Oxygen Therapy Info"
End DoDot:2
+30 SET CTR=CTR+1
End DoDot:1
+31 IF $$CHKFLDS(356.22,IBTRIEN_",","6.01^6.02^6.03^6.04^6.05^6.06")
Begin DoDot:1
+32 SET CATS(CTR)="Functional Limits"
SET CTR=CTR+1
End DoDot:1
+33 IF $$CHKFLDS(356.22,IBTRIEN_",","6.07^6.08^6.09^6.1^6.11^6.12")
Begin DoDot:1
+34 SET CATS(CTR)="Activities"
SET CTR=CTR+1
End DoDot:1
+35 IF $$CHKFLDS(356.22,IBTRIEN_",","6.13^6.14^6.15^6.16^6.17^6.18")
Begin DoDot:1
+36 SET CATS(CTR)="Mental Status"
SET CTR=CTR+1
End DoDot:1
+37 ;
+38 ; No Certification Condition Categories contain data
+39 if CTR=1
QUIT
+40 ;
+41 WRITE !!,"The following Certification Condition Categories contain data:"
+42 SET IX=""
SET DISP=" "
SET FIRST=1
+43 FOR
Begin DoDot:1
+44 SET IX=$ORDER(CATS(IX))
+45 if IX=""
QUIT
+46 IF 'FIRST
IF ($LENGTH(DISP)+$LENGTH(CATS(IX))+2)>79
Begin DoDot:2
+47 WRITE !,DISP,","
+48 SET DISP=" "_CATS(IX)
End DoDot:2
QUIT
+49 IF FIRST
SET DISP=DISP_CATS(IX)
SET FIRST=0
QUIT
+50 SET DISP=DISP_", "_CATS(IX)
End DoDot:1
if IX=""
QUIT
+51 if $TRANSLATE(DISP," ","")'=""
WRITE !,DISP
+52 WRITE !
+53 QUIT
+54 ;
CHKFLDSM(FILE,IBTRIEN,NDE,FIELDS) ; Checks all multiples for a specified node to see if
+1 ; any of the specified fields are non-null
+2 ; Input: FILE - # of file being checked
+3 ; IBTRIEN - IEN of the entry being checked
+4 ; NDE - Multiple node to check for data
+5 ; FIELDS - '^' delimited list of fields to be examined
+6 ; Returns: 1 - At least one field of one multiple is non-null, 0 otherwise
+7 NEW FOUND,IEN,IENS,SFILE
+8 SET (FOUND,IEN)=0
SET SFILE=FILE_NDE
+9 FOR
Begin DoDot:1
+10 SET IEN=$ORDER(^IBT(FILE,IBTRIEN,NDE,IEN))
+11 if +IEN=0
QUIT
+12 SET IENS=IEN_","_IBTRIEN_","
+13 if $$CHKFLDS(SFILE,IENS,FIELDS)
SET FOUND=1
End DoDot:1
if +IEN=0!FOUND
QUIT
+14 QUIT FOUND
+15 ;
CHKFLDS(FILE,IENS,FIELDS) ; Checks to see if any of the specified pieces of the
+1 ; specified node are non-null
+2 ; Input: FILE - # of file being checked
+3 ; IENS - IEN list of the 356.22 entry being examined
+4 ; FIELDS - '^' delimited list of fields to be examined
+5 ; Returns: 1 - At least one field is non-null, 0 otherwise
+6 NEW FIELD,FOUND,IX
+7 SET FOUND=0
+8 FOR IX=1:1:$LENGTH(FIELDS,"^")
Begin DoDot:1
+9 SET FIELD=$PIECE(FIELDS,"^",IX)
+10 if $$GET1^DIQ(FILE,IENS_",",FIELD,"I")'=""
SET FOUND=1
End DoDot:1
if FOUND
QUIT
+11 if FOUND
QUIT 1
+12 QUIT 0
+13 ;
SECTDATA(IBTRIEN,SIEN,SECTION,HEADER,DISPLAY) ;EP
+1 ; Called from within Input template IB CREATE 278 REQUEST
+2 ; Determines if the specified section contains any fields with values and
+3 ; (optionally) displays all of the section's fields and their values.
+4 ; Input: IBTRIEN - IEN of the 356.22 entry being edited
+5 ; SIEN - IEN of the service line multiple being examined
+6 ; NOTE: Only passed if examinng a service line section.
+7 ; SECTION - Identifier for the section to be examined
+8 ; HCSD - Health Care Services Delivery Section
+9 ; AMBTI - Ambulance Transport Information Section
+10 ; SPMSI - Spinal Manipulation Service Info Section
+11 ; HOTI - Home Oxygen Therapy Info Section
+12 ; HHCI - Home Health Care Info Section
+13 ; SHCRSI - Service Line HCRS Information Section
+14 ; CMPI - Service Line Composite Medical Procedure Info
+15 ; Section
+16 ; OCDI - Service Line Oral Cavity Designation Info
+17 ; Section
+18 ; SHCSD - Service Line Health Care Services Delivery
+19 ; HEADER - Header text to show when displaying a section's field
+20 ; DISPLAY - 1 to display all of the section's field if at least one
+21 ; field has a value. 0 otherwise
+22 ; Output: Displays a section's fields and their values if DISPLAY=1 and the
+23 ; specified section has at least one field with a value
+24 ; Returns: '*' - At least one field in the section contains a value
+25 ; "" - Otherwise
+26 NEW DATA,FIELD,FILE,FLDS,FNUM,FPROMPT,IX,LINE,MAXL,NDE,NODE,PCE,VAL
+27 if '$DATA(SIEN)
SET SIEN=""
+28 SET MAXL=0
+29 ;
+30 ; First get and array of the fields in the section
+31 FOR IX=1:1
Begin DoDot:1
+32 SET LINE=SECTION_"+"_IX_"^IBTRH5G"
+33 SET LINE=$TEXT(@LINE)
+34 if $PIECE(LINE,";",3)="%END%"
QUIT
+35 SET FNUM=$PIECE(LINE,";",3)
SET FPROMPT=$PIECE(LINE,";",4)
+36 if $LENGTH(FPROMPT)>MAXL
SET MAXL=$LENGTH(FPROMPT)
+37 SET FLDS(IX)=FNUM_"^"_FPROMPT
End DoDot:1
if $PIECE(LINE,";",3)="%END%"
QUIT
+38 ;
+39 ; Next determine if any of the section's fields contain data
+40 SET DATA=""
SET IX=""
+41 FOR
Begin DoDot:1
+42 SET IX=$ORDER(FLDS(IX))
+43 if IX=""
QUIT
+44 SET FIELD=$PIECE(FLDS(IX),"^",1)
SET NDE=+$PIECE(FIELD,".",1)
SET PCE=$PIECE(FIELD,".",2)
+45 SET PCE=$SELECT(PCE="1":10,PCE="2":20,PCE="3":30,1:+PCE)
+46 IF SIEN=""
if $PIECE($GET(^IBT(356.22,IBTRIEN,NDE)),"^",PCE)'=""
SET DATA="*"
+47 IF SIEN'=""
if $PIECE($GET(^IBT(356.22,IBTRIEN,16,SIEN,NDE)),"^",PCE)'=""
SET DATA="*"
End DoDot:1
if (DATA="*")!(IX="")
QUIT
+48 if DATA=""
QUIT ""
+49 IF 'DISPLAY
QUIT "*"
+50 ;
+51 ; Next display the section and it's values
+52 WRITE !!,HEADER," contains the following values:",!
+53 SET FILE=$SELECT(SIEN="":356.22,1:356.2216)
SET MAXL=MAXL+3
+54 SET IX=""
+55 FOR
Begin DoDot:1
+56 SET IX=$ORDER(FLDS(IX))
+57 if IX=""
QUIT
+58 SET FIELD=$PIECE(FLDS(IX),"^",1)
SET NDE=+$PIECE(FIELD,".",1)
+59 SET PCE=$PIECE(FIELD,".",2)
SET PCE=$SELECT(PCE="1":10,PCE="2":20,PCE="3":30,1:+PCE)
+60 WRITE !,$PIECE(FLDS(IX),"^",2),": "
+61 IF SIEN=""
SET VAL=$PIECE($GET(^IBT(356.22,IBTRIEN,NDE)),"^",PCE)
+62 IF SIEN'=""
SET VAL=$PIECE($GET(^IBT(356.22,IBTRIEN,16,SIEN,NDE)),"^",PCE)
+63 WRITE ?MAXL,$$EXTERNAL^DILFD(FILE,FIELD,"",VAL)
End DoDot:1
if IX=""
QUIT
+64 WRITE !
+65 IF (SECTION="SHCRSI")!(SECTION="CMPI")!(SECTION="OCDI")!(SECTION="SHCSD")
WRITE !
+66 QUIT "*"
+67 ;
+68 ; -------------------------- IB CREATE 278 REQUEST Fields ----------------
+69 ; Below is a listing of all of the fields in the template that are in
+70 ; 'skipable' sections. The comment line of each section = ;;A1;A2;A3;A4 Where:
+71 ; A1 - Field number of the section field (1st '.' piece is the storage node
+72 ; 2nd '.' piece is stoarge piece)
+73 ; A2 - Prompt used in the Input Template
+74 ; NOTE: If this prompt is changed in the Input Template, it must be
+75 ; updated here
+76 ; A3 - REQ - If field is unconditionally required. "" otherwise
+77 ; A4 - Default value (if any)
+78 ;-----------------------------------------------------------------------------
+79 ;
HCSD ; Health Care Services Delivery Section fields
+1 ;;4.01;Service Quantity Qualifier
+2 ;;4.02;Service Unit Count
+3 ;;4.03;Sample Selection Units of Measurement
+4 ;;4.04;Sample Selection Modulus
+5 ;;4.05;Time Period Qualifier
+6 ;;4.06;Period Count
+7 ;;4.07;Delivery Frequency Code
+8 ;;4.08;Delivery Pattern Time
+9 ;;%END%
AMBTI ; Ambulance Transport Information fields
+1 ;;18.02;Patient Weight
+2 ;;18.01;Patient Weight Units
+3 ;;18.03;Transport Code;REQ
+4 ;;18.04;Transport Reason Code
+5 ;;18.06;Transport Distance
+6 ;;18.09;Round Trip Purpose Description
+7 ;;18.1;Stretcher Purpose Description
+8 ;;%END%
SPMSI ; Spinal Manipulation Service Information
+1 ;;7.05;Treatment Series #
+2 ;;7.06;Treatment Count
+3 ;;7.07;Subluxation Level #1
+4 ;;7.08;Subluxation Level #2
+5 ;;7.09;Patient Condition;REQ
+6 ;;7.1;Complication Indicator;REQ;N
+7 ;;7.11;Patient Condition Description Line 1
+8 ;;7.12;Patient Condition Description Line 2
+9 ;;7.13;X-Ray Availability Indicator;;N
+10 ;;%END%
HOTI ; Home Oxygen Therapy Information
+1 ;;8.01;Oxygen Equipment Type #1;REQ
+2 ;;8.02;Oxygen Equipment Type #2
+3 ;;8.03;Oxygen Equipment Type #3
+4 ;;8.04;Equipment Reason Description
+5 ;;8.05;Oxygen Flow Rate;REQ
+6 ;;8.06;Daily Oxygen Use Count
+7 ;;8.07;Oxygen User Period Hour Count
+8 ;;8.08;Repiratory Therapist Order Text
+9 ;;9.01;Arterial Blood Gas Quantity
+10 ;;9.02;Oxygen Saturation Quantity
+11 ;;9.03;Oxygen Test Condition
+12 ;;9.04;Oxygen Test Findings #1
+13 ;;9.05;Oxygen Test Findings #2
+14 ;;9.06;Oxygen Test Findings #3
+15 ;;9.07;Portable Oxygen System Flow Rate
+16 ;;9.08;Oxygen Delivery System;REQ
+17 ;;%END%
HHCI ; Home Health Care Information
+1 ;;2.15;Prognosis
+2 ;;10.01;Home Health Start Date;REQ
+3 ;;10.02;Home Health Cert. Start Date
+4 ;;10.03;Home Health Cert. End Date;REQ
+5 ;;10.05;Surgery Date
+6 ;;10.06;Procedure Coding Method
+7 ;;10.07;Surgical Procedure
+8 ;;10.08;Physician Verbal Order Date
+9 ;;10.09;Last Visit Date
+10 ;;10.1;Physician/Home Health Contact Date
+11 ;;10.11;Start Date of Last Admission
+12 ;;10.12;End Date of Last Admission
+13 ;;10.13;Last Admission Facility
+14 ;;%END%
SHCRSI ; Service HCRS Information
+1 ;;.15; Request Category
+2 ;;.02; Service Certification Type
+3 ;;.03; Service Type
+4 ;;.06; Service Location of Care
+5 ;;.07; Service Bill Classification;REQ
+6 ;;.05; Place of Service
+7 ;;%END%
CMPI ; Composite Medical Procedure Information
+1 ;;1.01; Procedure Coding Method;REQ
+2 ;;1.02; Procedure Code;REQ
+3 ;;1.03; Ending Procedure Code
+4 ;;1.04; Procedure Modifier #1
+5 ;;1.05; Procedure Modifier #2
+6 ;;1.06; Procedure Modifier #3
+7 ;;1.07; Procedure Modifier #4
+8 ;;1.08; Procedure Description
+9 ;;%END%
OCDI ; Oral Cavity Designation Information
+1 ;;3.01; Oral Cavity Designation #1;REQ
+2 ;;3.02; Oral Cavity Designation #2
+3 ;;3.03; Oral Cavity Designation #3
+4 ;;3.04; Oral Cavity Designation #4
+5 ;;3.05; Oral Cavity Designation #5
+6 ;;%END%
SHCSD ; Service Line Health Care Services Delivery
+1 ;;5.01; Service Quantity Qualifier
+2 ;;5.02; Service Unit Count
+3 ;;5.03; Sample Selection Units of Measurement
+4 ;;5.04; Sample Selection Modulus
+5 ;;5.05; Time Period Qualifier
+6 ;;5.06; Period Count
+7 ;;5.07; Delivery Frequency Code
+8 ;;5.08; Delivery Pattern Time
+9 ;;%END%
AEREL ; Accident Relation Information
+1 ;;2.08;Related Causes #1
+2 ;;2.09;Related Causes #2
+3 ;;2.1;Related Causes #3
+4 ;;2.11;Auto Accident State
+5 ;;2.12;Auto Accident Country
+6 ;;2.18;Accident Date
+7 ;;%END%