[613] | 1 | DGPFHLQ2 ;ALB/RPM - PRF HL7 BUILD QRF SEGMENT ; 02/02/03
|
---|
| 2 | ;;5.3;Registration;**425**;Aug 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | ;
|
---|
| 5 | QRF(DGSSN,DGDOB,DGFLD,DGHL) ;QRF HL7 segment API
|
---|
| 6 | ;This function wraps the data retrieval and segment crateion APIs and
|
---|
| 7 | ;returns a formatted QRF segment.
|
---|
| 8 | ;
|
---|
| 9 | ; Input:
|
---|
| 10 | ; DGSSN - (required) Patient's Social Security Number
|
---|
| 11 | ; DGDOB - (required) Patient's Date of Birth in FileMan format
|
---|
| 12 | ; DGFLD - (optional) List of comma-separated fields (sequence #'s)
|
---|
| 13 | ; to include. Defaults to all required fields (1).
|
---|
| 14 | ; DGHL - VistA HL7 environment array
|
---|
| 15 | ;
|
---|
| 16 | ; Output :
|
---|
| 17 | ; Function Value - QRF segment on success, "" on failure
|
---|
| 18 | ;
|
---|
| 19 | N DGQRF
|
---|
| 20 | N DGVAL
|
---|
| 21 | ;
|
---|
| 22 | S DGQRF=""
|
---|
| 23 | I $G(DGSSN),$G(DGDOB) D
|
---|
| 24 | . S DGFLD=$$CKSTR^DGPFHLUT("1",DGFLD) ;validate field string
|
---|
| 25 | . S DGFLD=","_DGFLD_","
|
---|
| 26 | . I $$QRFVAL(DGFLD,DGSSN,DGDOB,.DGVAL) D
|
---|
| 27 | . . S DGQRF=$$BLDSEG^DGPFHLUT("QRF",.DGVAL,.DGHL)
|
---|
| 28 | Q DGQRF
|
---|
| 29 | ;
|
---|
| 30 | QRFVAL(DGFLD,DGSSN,DGDOB,DGVAL) ;build QRF field value array
|
---|
| 31 | ;
|
---|
| 32 | ; Input:
|
---|
| 33 | ; DGFLD - (required) Fields string
|
---|
| 34 | ; DGSSN - (required) Patient's Social Security Number
|
---|
| 35 | ; DGDOB - (required) Patient's Date of Birth
|
---|
| 36 | ;
|
---|
| 37 | ; Output:
|
---|
| 38 | ; Function Value - 1 on success, 0 on failure
|
---|
| 39 | ; DGVAL - QRF field array [SUB1:field, SUB2:repetition,
|
---|
| 40 | ; SUB3:component, SUB4:sub-component]
|
---|
| 41 | ;
|
---|
| 42 | N DGRSLT
|
---|
| 43 | ;
|
---|
| 44 | S DGRSLT=0
|
---|
| 45 | I $G(DGFLD)]"",$G(DGSSN),$G(DGDOB) D
|
---|
| 46 | . ;
|
---|
| 47 | . ; seq 1 (required) Where Subj Filter
|
---|
| 48 | . I DGFLD[",1," D
|
---|
| 49 | . . S DGVAL(1)="PRF"
|
---|
| 50 | . ;
|
---|
| 51 | . ; seq 2 (optional) When Data Start Date/Time
|
---|
| 52 | . I DGFLD[",2," D
|
---|
| 53 | . . S DGVAL(2)=""
|
---|
| 54 | . ;
|
---|
| 55 | . ; seq 3 (optional) When Data End Date/Time
|
---|
| 56 | . I DGFLD[",3," D
|
---|
| 57 | . . S DGVAL(3)=""
|
---|
| 58 | . ;
|
---|
| 59 | . ; seq 4 (optional) What User Qualifier
|
---|
| 60 | . I DGFLD[",4," D
|
---|
| 61 | . . S DGVAL(4)=DGSSN
|
---|
| 62 | . ;
|
---|
| 63 | . ; seq 5 (optional) Other Query Subj Filter
|
---|
| 64 | . I DGFLD[",5," D
|
---|
| 65 | . . S DGVAL(5)=$$FMTHL7^XLFDT(DGDOB)
|
---|
| 66 | . ;
|
---|
| 67 | . ;- seq 6 (optional) Which Date/Time Qualifier
|
---|
| 68 | . I DGFLD[",6," D
|
---|
| 69 | . . S DGVAL(6)=""
|
---|
| 70 | . ;
|
---|
| 71 | . ; seq 7 (optional) Which Date/Time Status Qualifier
|
---|
| 72 | . I DGFLD[",7," D
|
---|
| 73 | . . S DGVAL(7)=""
|
---|
| 74 | . ;
|
---|
| 75 | . ; seq 8 (optional) Date/Time Selection Qualifier
|
---|
| 76 | . I DGFLD[",8," D
|
---|
| 77 | . . S DGVAL(8)=""
|
---|
| 78 | . ;
|
---|
| 79 | . ; seq 9 (optional) When Quantity/Timing Qualifier
|
---|
| 80 | . I DGFLD[",9," D
|
---|
| 81 | . . S DGVAL(9)=""
|
---|
| 82 | . ;
|
---|
| 83 | . S DGRSLT=1
|
---|
| 84 | I 'DGRSLT K DGVAL
|
---|
| 85 | Q DGRSLT
|
---|