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

DGPFHLQ2.m

Go to the documentation of this file.
  1. DGPFHLQ2 ;ALB/RPM - PRF HL7 BUILD QRF SEGMENT ; 02/02/03
  1. ;;5.3;Registration;**425**;Aug 13, 1993
  1. ;
  1. ;
  1. QRF(DGSSN,DGDOB,DGFLD,DGHL) ;QRF HL7 segment API
  1. ;This function wraps the data retrieval and segment crateion APIs and
  1. ;returns a formatted QRF segment.
  1. ;
  1. ; Input:
  1. ; DGSSN - (required) Patient's Social Security Number
  1. ; DGDOB - (required) Patient's Date of Birth in FileMan format
  1. ; DGFLD - (optional) List of comma-separated fields (sequence #'s)
  1. ; to include. Defaults to all required fields (1).
  1. ; DGHL - VistA HL7 environment array
  1. ;
  1. ; Output :
  1. ; Function Value - QRF segment on success, "" on failure
  1. ;
  1. N DGQRF
  1. N DGVAL
  1. ;
  1. S DGQRF=""
  1. I $G(DGSSN),$G(DGDOB) D
  1. . S DGFLD=$$CKSTR^DGPFHLUT("1",DGFLD) ;validate field string
  1. . S DGFLD=","_DGFLD_","
  1. . I $$QRFVAL(DGFLD,DGSSN,DGDOB,.DGVAL) D
  1. . . S DGQRF=$$BLDSEG^DGPFHLUT("QRF",.DGVAL,.DGHL)
  1. Q DGQRF
  1. ;
  1. QRFVAL(DGFLD,DGSSN,DGDOB,DGVAL) ;build QRF field value array
  1. ;
  1. ; Input:
  1. ; DGFLD - (required) Fields string
  1. ; DGSSN - (required) Patient's Social Security Number
  1. ; DGDOB - (required) Patient's Date of Birth
  1. ;
  1. ; Output:
  1. ; Function Value - 1 on success, 0 on failure
  1. ; DGVAL - QRF field array [SUB1:field, SUB2:repetition,
  1. ; SUB3:component, SUB4:sub-component]
  1. ;
  1. N DGRSLT
  1. ;
  1. S DGRSLT=0
  1. I $G(DGFLD)]"",$G(DGSSN),$G(DGDOB) D
  1. . ;
  1. . ; seq 1 (required) Where Subj Filter
  1. . I DGFLD[",1," D
  1. . . S DGVAL(1)="PRF"
  1. . ;
  1. . ; seq 2 (optional) When Data Start Date/Time
  1. . I DGFLD[",2," D
  1. . . S DGVAL(2)=""
  1. . ;
  1. . ; seq 3 (optional) When Data End Date/Time
  1. . I DGFLD[",3," D
  1. . . S DGVAL(3)=""
  1. . ;
  1. . ; seq 4 (optional) What User Qualifier
  1. . I DGFLD[",4," D
  1. . . S DGVAL(4)=DGSSN
  1. . ;
  1. . ; seq 5 (optional) Other Query Subj Filter
  1. . I DGFLD[",5," D
  1. . . S DGVAL(5)=$$FMTHL7^XLFDT(DGDOB)
  1. . ;
  1. . ;- seq 6 (optional) Which Date/Time Qualifier
  1. . I DGFLD[",6," D
  1. . . S DGVAL(6)=""
  1. . ;
  1. . ; seq 7 (optional) Which Date/Time Status Qualifier
  1. . I DGFLD[",7," D
  1. . . S DGVAL(7)=""
  1. . ;
  1. . ; seq 8 (optional) Date/Time Selection Qualifier
  1. . I DGFLD[",8," D
  1. . . S DGVAL(8)=""
  1. . ;
  1. . ; seq 9 (optional) When Quantity/Timing Qualifier
  1. . I DGFLD[",9," D
  1. . . S DGVAL(9)=""
  1. . ;
  1. . S DGRSLT=1
  1. I 'DGRSLT K DGVAL
  1. Q DGRSLT