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

LA7VOBR.m

Go to the documentation of this file.
  1. LA7VOBR ;VA/DALOI/JMC - LAB OBR segment builder ; 13-Aug-2013 09:09 ; MKK
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,1018,64,1027,68,1033**;NOV 01, 1997
  1. ;
  1. Q
  1. ;
  1. ;
  1. OBR1(LA7OBRSN) ; Build OBR-1 sequence - set segment id
  1. ; Call with LA7OBRSN = segment id (pass by reference)
  1. ;
  1. S LA7OBRSN=$G(LA7OBRSN)+1
  1. Q LA7OBRSN
  1. ;
  1. ;
  1. OBR2(LA7ID,LA7FS,LA7ECH) ; Build OBR-2 sequence - placer's specimen id
  1. ; Call with LA7ID = placer's specimen id (accn number/UID)
  1. ; LA7ID("NMSP") = application namespace (optional)
  1. ; LA7ID("SITE") = placer facility
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. N LA7X,LA7Y
  1. D OBR2^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR3(LA7ID,LA7FS,LA7ECH) ; Build OBR-3 sequence - filler's specimen id
  1. ; Call with LA7ID = filler's specimen id (accn number/UID)
  1. ; LA7ID("NMSP") = application namespace (optional)
  1. ; LA7ID("SITE") = filler facility
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. N LA7X,LA7Y
  1. D OBR3^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR4(LA7NLT,LA760,LA7ALT,LA7FS,LA7ECH) ; Build OBR-4 sequence - Universal service ID
  1. ; Call with LA7NLT = NLT test code
  1. ; LA760 = file #60 ien if known
  1. ; LA7ALT = alternate order code and system in form
  1. ; test code^test name^coding system
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns LA7Y = OBR-4 sequence
  1. ;
  1. N LA764,LA7COMP,LA7ERR,LA7TN,LA7X,LA7Y,LA7Z
  1. D OBR4^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR6(LA7DT) ; Build OBR-6 sequence - requested date/time
  1. ; Call with LA7DT = FileMan date/time
  1. ; Returns OBR-6 sequence
  1. ;
  1. S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
  1. Q $$FMTHL7^XLFDT(LA7DT)
  1. ;
  1. ;
  1. OBR7(LA7DT) ; Build OBR-7 sequence - collection date/time
  1. ; Call with LA7DT = FileMan date/time
  1. ; Returns OBR-7 sequence
  1. ;
  1. S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
  1. Q $$FMTHL7^XLFDT(LA7DT)
  1. ;
  1. ;
  1. OBR8(LA7DT) ; Build OBR-8 sequence - collection end date/time
  1. ; Call with LA7DT = FileMan date/time
  1. ; Returns OBR-8 sequence
  1. ;
  1. S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
  1. Q $$FMTHL7^XLFDT(LA7DT)
  1. ;
  1. ;
  1. OBR9(LA7VOL,LA764061,LA7FS,LA7ECH) ; Build OBR-9 sequence - collection volume
  1. ; Call with LA7VOL = collection volume
  1. ; LA764061 = units (pointer to #64.061)
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ; Returns OBR-9 sequence
  1. ;
  1. N LA7IENS,LA7X,LA7Y
  1. D OBR9^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR11(LA7X) ; Build OBR-11 sequence - speciman action code
  1. ; Call with LA7X = HL7 Table 0065 entry
  1. ; Returns OBR-11 sequence
  1. ;
  1. ; JMC-12/09/99 Need to expand this function to determine based on collection status
  1. ;
  1. Q LA7X
  1. ;
  1. ;
  1. OBR12(LRDFN,LA7FS,LA7ECH) ; Build OBR-12 sequence - patient info
  1. ; Call with LRDFN = ien of patient in #63
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL7 encoding characters
  1. ; Returns OBR-12 sequence
  1. ;
  1. N LA7X
  1. ;
  1. S LRDFN=$G(LRDFN),LA7ECH=$G(LA7ECH)
  1. ; Infection Warning
  1. S LA7X=$P($G(^LR(LRDFN,.091)),"^")
  1. I LA7X'="" D
  1. . S LA7X=$$CHKDATA^LA7VHLU3(LA7X,LA7FS_LA7ECH)
  1. . S LA7X=$E(LA7ECH,1)_LA7X
  1. ;
  1. Q LA7X
  1. ;
  1. ;
  1. OBR13(LA7TXT,LA7FS,LA7ECH) ; Build OBR-13 sequence - revelant clinical info
  1. ; Call with LA7TXT = text to place into OBR-13
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL7 encoding characters
  1. ; Returns OBR-12 sequence
  1. ;
  1. N LA7X
  1. S LA7X=$$CHKDATA^LA7VHLU3(LA7TXT,LA7FS_LA7ECH)
  1. Q LA7X
  1. ;
  1. ;
  1. OBR14(LA7DT) ; Build OBR-14 sequence - speciman arrival date/time
  1. ; Call with LA7DT = FileMan date/time
  1. ; Returns OBR-14 sequence
  1. ;
  1. S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
  1. Q $$FMTHL7^XLFDT(LA7DT)
  1. ;
  1. ;
  1. OBR15(LA761,LA762,LA7ALT,LA7FS,LA7ECH,LA7CM,LA7SNM) ; Build OBR-15 sequence - specimen source
  1. ; Call with LA761 = ien of topography file #61
  1. ; LA762 = ien of collection sample in file #62
  1. ; LA7ALT = alternate non-HL7 codes/text/coding system in form -
  1. ; specimen code^specimen text^specimen system^CONTROL^collection sample code^collection sample^collection system.
  1. ; "CONTROL" only present when specimen is a lab control from file #62.3.
  1. ; presence of these will override standard HL7 tables
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ; LA7CM = ien of shipping condition file #62.93 (collection method)
  1. ; LA7SNM = 1-flag to send SNOMED CT instead of HL7 table 0070
  1. ;
  1. ; Returns OBR-15 sequence in LA7Y
  1. ;
  1. N LA764061,LA7COMP,LA7ERR,LA7X,LA7Y,LA7Z,X,Y
  1. D OBR15^LA7VOBRB
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR18(LA7X,LA7FS,LA7ECH) ; Build OBR-18 sequence - Placer's field #1
  1. ; Call with LA7X = array containing components to store, pass by reference.
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-18 sequence
  1. ;
  1. N LA7I,LA7Y,LA7Z
  1. D OBRPF^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR19(LA7X,LA7FS,LA7ECH) ; Build OBR-19 sequence - Placer's field #2
  1. ; Call with LA7X() = array containing components to store, pass by reference.
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-19 sequence
  1. ;
  1. N LA7I,LA7Y,LA7Z
  1. D OBRPF^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR20(LA7X,LA7FS,LA7ECH) ; Build OBR-20 sequence - Filler's field #1
  1. ; Call with LA7X = array containing components to store, pass by reference.
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-20 sequence
  1. ;
  1. N LA7I,LA7Y,LA7Z
  1. D OBRPF^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR21(LA7X,LA7FS,LA7ECH) ; Build OBR-21 sequence - Filler's field #2
  1. ; Call with LA7X() = array containing components to store, pass by reference.
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-21 sequence
  1. ;
  1. N LA7I,LA7Y,LA7Z
  1. D OBRPF^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR22(LA7DT) ; Build OBR-22 sequence - date report completed
  1. ; Call with LA7DT = FileMan date/time
  1. ;
  1. ; Returns OBR-22 sequence
  1. ;
  1. S LA7DT=$$CHKDT^LA7VHLU1(LA7DT)
  1. Q $$FMTHL7^XLFDT(LA7DT)
  1. ;
  1. ;
  1. OBR24(LA7SS) ; Build OBR-24 sequence - diagnostic service id
  1. ; Call with LA7SS = File #63 subscript^section within subscript
  1. ;
  1. ; Returns OBR-24 sequence
  1. ;
  1. N LA7Y,LA7X
  1. D OBR24^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR25(LA7FLAG) ; Build OBR-25 sequence - Result status
  1. ; Call with LA7FLAG = VistA Lab status flag
  1. ; Returns result status based on HL7 table 0123
  1. ;
  1. N LA7Y
  1. D OBR25^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR26(LA7OBX3,LA7OBX4,LA7OBX5,LA7FS,LA7ECH) ; Build OBR-26 sequence - Parent result
  1. ; Call with LA7OBX3 = OBX-3 observation id of parent result
  1. ; LA7OBX4 = OBX-4 sub-id of parent result
  1. ; LA7OBX5 = OBX-5 parent result
  1. ; LA7FS = HL7 Field separator
  1. ; LA7ECH = HL7 encoding characters
  1. ;
  1. N LA7C,LA7SC,LA7Y,LA7Z
  1. D OBR26^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR27(LA7DUR,LA7DURU,LA76205,LA7FS,LA7ECH) ; Build OBR-27 sequence - Quantity/Timing
  1. ; Call with LA7DUR = collection duration
  1. ; LA7DURU = duration units (pointer to #64.061)
  1. ; LA76205 = test urgency
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-27 sequence
  1. ;
  1. ; Since field is same as ORC-7, use builder for ORC-7 field.
  1. ;
  1. Q $$ORC7^LA7VORC(LA7DUR,LA7DURU,LA76205,LA7FS,LA7ECH)
  1. ;
  1. ;
  1. OBR29(LA7PON,LA7FON,LA7FS,LA7ECH) ; Build OBR-29 sequence - Parent
  1. ; Call with LA7PON = parent's placer order number
  1. ; LA7FON = parent's filler order nubmer
  1. ; LA7FS = HL7 field separator
  1. ; LA7ECH = HL7 encoding characters
  1. ;
  1. N LA7Y,LA7Z
  1. D OBR29^LA7VOBRA
  1. Q LA7Y
  1. ;
  1. ;
  1. OBR32(LA7DUZ,LA7DIV,LA7FS,LA7ECH) ; Build OBR-32 sequence - Principle Result Interpreter field
  1. ; Call with LA7DUZ = DUZ of verifying user
  1. ; LA7DIV = Institution of user
  1. ; LA7FS = HL field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-32 sequence
  1. ;
  1. N LA7PRI,LA7X
  1. D OBR32^LA7VOBRA
  1. Q LA7PRI
  1. ;
  1. ;
  1. OBR33(LA7DUZ,LA7DIV,LA7FS,LA7ECH) ; Build OBR-32 sequence - Assistant Result Interpreter field
  1. ; Call with LA7DUZ = DUZ of assistant interpreter
  1. ; LA7DIV = Institution of user
  1. ; LA7FS = HL field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-33 sequence
  1. ;
  1. N LA7ARI,LA7X
  1. D OBR33^LA7VOBRA
  1. Q LA7ARI
  1. ;
  1. ;
  1. OBR34(LA7DUZ,LA7DIV,LA7FS,LA7ECH) ; Build OBR-34 sequence - Technician field
  1. ; Call with LA7DUZ = DUZ of techician
  1. ; LA7DIV = Institution of user
  1. ; LA7FS = HL field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-34 sequence
  1. ;
  1. N LA7TECH,LA7X
  1. D OBR34^LA7VOBRA
  1. Q LA7TECH
  1. ;
  1. ;
  1. OBR35(LA7DUZ,LA7DIV,LA7FS,LA7ECH) ; Build OBR-35 sequence - Transcriptionist field
  1. ; Call with LA7DUZ = DUZ of transcriptionist
  1. ; LA7DIV = Institution of user
  1. ; LA7FS = HL field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns OBR-35 sequence
  1. ;
  1. N LA7TSPT,LA7X
  1. D OBR35^LA7VOBRA
  1. Q LA7TSPT
  1. ;
  1. ;
  1. OBR44(LA7VAL,LA7FS,LA7ECH) ; Build OBR-44 sequence - Procedure Code
  1. ; Call with LA7VAL = Order NLT code
  1. ; LA7FS = HL field separator
  1. ; LA7ECH = HL encoding characters
  1. ;
  1. ; Returns LA7Y = OBR-44 sequence
  1. ;
  1. N LA764,LA781,LA7X,LA7Y,LA7Z
  1. D OBR44^LA7VOBRA
  1. Q LA7Y