source: FOIAVistA/trunk/r/MEDICINE-MC/MCARUTL5.m@ 1314

Last change on this file since 1314 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1MCARUTL5 ;HOIFO/WAA-UTILITY FOR VALIDATING ENTRY ;04/13/01 12:00
2 ;;2.3;Medicine;**33**;09/13/1996
3 ;
4 ; VALID Validation function
5 ;
6 ; MC*2.3*33 this is a new module to validate the entry
7 ; is for the stated patient and matched the one on the "AC"
8 ; The subroutine will work out the "AC" from the procedure.
9 ; This will ensure that "AC" that the main program is using
10 ; and the "AC" that I am building are one and the same.
11 ; if they don't match I will not validate it.
12 ;
13 ;Input:
14 ; ROOT = The root Global Reference for the entry.
15 ; IEN = The Internal entry number for the procedure being checked
16 ; DFN = The Patient DFN with in the Medicine Patient file.
17 ;
18 ;Outout:
19 ; VALID = 1 or 0
20 ; 1 = The entry is a procedure for the indicated Patient
21 ; 0 = The entry is not a procedure for the indicated Patient
22 ;
23VALID(ROOT,IEN,DFN) ; Main entry point for this function
24 N VALID,LINE,FN
25 S VALID=0 ; Init VALID to 0
26 S FN=$P(ROOT,"(",2) ; parce out the internal entry number
27 S LINE=$G(^MCAR(FN,IEN,0)) ; validate that the entry exists
28 I LINE'="" D
29 . N IEN697,PL,PRODFN,PRODT
30 . S IEN697=$O(^MCAR(697.2,"C",ROOT,0)) Q:IEN697<1 ; get the procedure info
31 . S PL=$P(^MCAR(697.2,IEN697,0),U,12) Q:PL="" ; get the location if the pat DFN within the procedure
32 . S PRODFN=$$GET1^DIQ(FN,IEN,PL,"I") Q:PRODFN<1 ; get the pat DFN
33 . Q:PRODFN'=DFN ; compare the pat DFN from the procedure with the passed DFN
34 . S PRODT=9999999.9999-$P(LINE,U) ; get the Procedure date and invert it
35 . I '$D(^MCAR(690,"AC",PRODFN,PRODT,ROOT,IEN)) Q ; check to see if the entry is in the a valid entry within 690 "AC" Xref
36 . S VALID=1 ; Valid entry
37 . Q
38 Q VALID
Note: See TracBrowser for help on using the repository browser.