source: FOIAVistA/tag/r/SURGERY-SR/SRHLVUI2.m@ 1590

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1SRHLVUI2 ;B'ham ISC/DLR - Surgery Interface Con. Utility to process incoming segments ; [ 05/06/98 7:14 AM ]
2 ;;3.0; Surgery ;**41**;24 Jun 93
3 ; Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
4 ;;This routine utilizes the Surgery Interface file (133.2).
5NTE(NTE,OBR) ;process NTE-3
6 ;anesthesia comments
7 ;find the entry for this technique
8 N FILE,FIELD,IENS,FLAGS,WP,X,Y
9 N CASE S CASE=$P(OBR,HLFS,4) Q:CASE=""
10 S DIC="^SRF("_CASE_",6,",DIC(0)="OSXZ",X=$P($P(OBR,HLFS,5),HLCOMP,5) D ^DIC Q:Y<0
11 S FILE=130.06,FIELD=40,IENS=+Y_","_CASE_",",FLAGS="A",WP(1)=$P(NTE,HLFS,4) D WP^DIE(FILE,IENS,FIELD,FLAGS,"WP","SRE")
12 Q
13OBX(OBX,OBR) ;process Observation Segment (OBX) fields 3,5,14,16
14 ;
15 N SRUPD,VALUE,CHKV,SROUT
16 S ID=$P($P(OBX,HLFS,4),HLCOMP,2) I $G(ID)="" S HLERR="Missing Identifier with "_$P(OBX,HLFS)_" "_$P(OBX,HLFS,2) D ERR^SRHLVUI(OBX,IEN) Q
17 S IEN=$O(^SRO(133.2,"AC",ID,0)) I $G(IEN)="" D SET^SRHLVORU("Invalid OBX identifier, "_ID_", ",OBR,OBX,.SRHLX) Q
18 ;if field is set to receive, then set DR string for DIE call
19 I $$CHECK^SRHLVUI(IEN)=1 D
20 .I '$D(^SRO(133.2,IEN,1,0)) S VALUE=$$VALUE^SRHLVUI(IEN) D:VALUE="" I "^"'[$$CHKV^SRHLVUI(IEN,VALUE) S LVL=$P(^SRO(133.2,IEN,0),U,9) D DR^SRHLVUI(LVL,IEN) S UPDATE=1
21 ..;create discrepancy message entry for null or invalid entries
22 ..N TEXT S TEXT="Invalid value, "_$P($P(OBX,HLFS,6),HLCOMP,1,3)_$S($P(^SRO(133.2,IEN,0),U,11)'="":" for File #"_$P($P(^SRO(133.2,IEN,0),U,11),"99VA",2),1:"") D SET^SRHLVORU(TEXT,OBR,$G(OBX),.SRHLX)
23 .;process multiple field segments, ex. replacement fluids
24 .;SRUPD is used to update multiple field entries that are not multiples, ex. TOURNIQUET APPLIED. If the entry is not a multiple SRUPD is set to 0.
25 .I $D(^SRO(133.2,IEN,1,0)) S SRUPD=1,SRX=0 F S SRX=$O(^SRO(133.2,IEN,1,SRX)) Q:'SRX!($D(HLERR))!($G(SROUT)=1) S LVL=$P(^SRO(133.2,SRX,0),U,9) Q:"123"[$G(LVL)&($G(LVL)="") D:$$CHECK^SRHLVUI(SRX)=1
26 ..S CHKV=$$CHKV^SRHLVUI(SRX,$$VALUE^SRHLVUI(SRX)) D
27 ...I CHKV'="^" D DR^SRHLVUI(LVL,SRX) I $P(^SRO(133.2,SRX,0),U,3)=.01 S UPDATE=1 S LVL=$P(^SRO(133.2,IEN,0),U,9) D DR^SRHLVUI(LVL,IEN) S SRUPD=0
28 ...I CHKV="^" I $P(^SRO(133.2,SRX,0),U,3)=.01 S SROUT=1
29 .;if SRUPD = 1 a non-multiple was processed, so update original IEN
30 .I $D(^SRO(133.2,IEN,1,0))&($G(SRUPD)=1) S LVL=$P(^SRO(133.2,IEN,0),U,9) D DR^SRHLVUI(LVL,IEN)
31 Q
Note: See TracBrowser for help on using the repository browser.