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

DGQEHLOR.m

Go to the documentation of this file.
  1. DGQEHLOR ;ALB/RPM - VIC REPLACEMENT HL7 BUILD ORC SEGMENT ; 2/23/04
  1. ;;5.3;Registration;**571,1015**;Aug 13, 1993;Build 21
  1. ;
  1. Q
  1. ;
  1. ORC(DGREQ,DGFLD,DGHL) ;ORC Segment API
  1. ;This function wraps the data retrieval and segment creation APIs and
  1. ;returns a formatted ORC segment.
  1. ;
  1. ; Input:
  1. ; DGREQ - (required) VIC REQUEST data array
  1. ; DGFLD - (optional) List of comma-separated fields (sequence #'s)
  1. ; to include. Defaults to all required fields (4).
  1. ; DGHL - HL7 environment array
  1. ;
  1. ; Output:
  1. ; Function Value - ORC segment on success, "" on failure
  1. ;
  1. N DGORC
  1. N DGVAL
  1. ;
  1. S DGORC=""
  1. I $D(DGREQ) D
  1. . S DGFLD=$$CKSTR^DGQEHLUT("1",DGFLD) ;validate the field string
  1. . S DGFLD=","_DGFLD_","
  1. . I $$ORCVAL(DGFLD,.DGREQ,.DGVAL) D
  1. . . S DGORC=$$BLDSEG^DGQEHLUT("ORC",.DGVAL,.DGHL)
  1. Q DGORC
  1. ;
  1. ORCVAL(DGFLD,DGREQ,DGVAL) ;build ORC value array
  1. ;
  1. ; Input:
  1. ; DGFLD - (required) Fields string
  1. ; DGREQ - (required) VIC REQUEST data array
  1. ;
  1. ; Output:
  1. ; Function Value - 1 on sucess, 0 on failure
  1. ; DGVAL - ORC field array [SUB1:field, SUB2:repetition,
  1. ; SUB3:component, SUB4:sub-component]
  1. ;
  1. N DGRSLT ;function value
  1. N DGSTAT ;temp value of DGREQ("CPRSTAT")
  1. ;
  1. S DGRSLT=0
  1. I $G(DGFLD)]"",+$G(DGREQ("DFN"))>0,$G(DGREQ("CARDID"))]"" D
  1. . ;
  1. . ; seq 1 Order Control
  1. . I DGFLD[",1," D ;required field
  1. . . S DGSTAT=$G(DGREQ("CPRSTAT"))
  1. . . S DGVAL(1)=$S(DGSTAT="P":"RL",DGSTAT="C":"CA",DGSTAT="I":"CA",1:"")
  1. . Q:DGVAL(1)=""
  1. . ;
  1. . ; seq 2 Placer Order Number
  1. . I DGFLD[",2," D
  1. . ;
  1. . ; seq 3 Filler Order Number
  1. . I DGFLD[",3," D
  1. . ;
  1. . ; seq 4 Placer Group Number
  1. . I DGFLD[",4," D
  1. . ;
  1. . ; seq 5 Order Status
  1. . I DGFLD[",5," D
  1. . ;
  1. . ; seq 6 Response Flag
  1. . I DGFLD[",6," D
  1. . ;
  1. . ; seq 7 Quantity/Timing
  1. . I DGFLD[",7," D
  1. . ;
  1. . ; seq 8 Parent
  1. . I DGFLD[",8," D
  1. . ;
  1. . ; seq 9 Date/Time of Transaction
  1. . I DGFLD[",9," D
  1. . ;
  1. . ; seq 10 Entered By
  1. . I DGFLD[",10," D
  1. . ;
  1. . ; seq 11 Verified By
  1. . I DGFLD[",11," D
  1. . ;
  1. . ; seq 12 Ordering Provider
  1. . I DGFLD[",12," D
  1. . ;
  1. . ; seq 13 Enterer's Location
  1. . I DGFLD[",13," D
  1. . ;
  1. . ; seq 14 Call Back Phone Number
  1. . I DGFLD[",14," D
  1. . ;
  1. . ; seq 15 Order Effective Date/Time
  1. . I DGFLD[",15," D
  1. . ;
  1. . ; seq 16 Order Control Code Reason
  1. . I DGFLD[",16," D
  1. . ;
  1. . ; seq 17 Entering Organization
  1. . I DGFLD[",17," D
  1. . ;
  1. . ; seq 18 Entering Device
  1. . I DGFLD[",18," D
  1. . ;
  1. . ; seq 19 Action By
  1. . I DGFLD[",19," D
  1. . ;
  1. . S DGRSLT=1
  1. I 'DGRSLT K DGVAL
  1. Q DGRSLT