source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGRUGMFU.m@ 1578

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1DGRUGMFU ;ALB/GRR - CREATE MFU MESSAGE
2 ;;5.3;Registration;**190,349,381**;AUG 13, 1993
3EN(DGRSEGC,DGRSEGN,DGRFNUM,DGRFNAM,DGROLDN,DGRENM,DGCIEN) ;
4 K ^TMP($J,"DGRUGMFU")
5 ;;Input parameters:
6 ;; DGRSEGC - Segment Code (Z36,LOC,STF)
7 ;; DGRSEGN - Segment Name (LOCATION, STAFF)
8 ;; DGRFNUM - File Number of master file
9 ;; DGRFNAM - Master File Name (NEW PERSON)
10 ;; DGROLDN - Value of name prior to change
11 ;; DGRENM - Name field of changed entry
12 ;; DGRCIEN - Internal Entry Number of changed entry
13 N DGREC,DGREDT,DGRROOM,DGRBED,DGRWARD,DGRWIEN
14 D INIT^HLFNC2("DGRU-RAI-MFU-SERVER",.HL) ;p-381 added
15 D NOW^%DTC S DGREDT=$$HLDATE^HLFNC(%) ;Current Date/Time
16 S DGREC="MFI"_HL("FS")_DGRSEGC_$E(HL("ECH"))_DGRSEGN_$E(HL("ECH"))_"HL7"_$E(HL("ECH"))_DGRFNUM_$E(HL("ECH"))_DGRFNAM_HL("FS")_HL("FS")_"UPD"_HL("FS")_DGREDT_HL("FS")_HL("FS")_"NE" ;Format MFI HL7 segment
17 S ^TMP($J,"DGRUGMFU",1)=DGREC ;Store MFI segment into global array
18 S DGREC="MFE"_HL("FS")_"MUP"_HL("FS")_HL("FS")_DGREDT_HL("FS")_DGCIEN_$E(HL("ECH"))_DGROLDN_$E(HL("ECH"))_"HL7" ;Format the MFE HL7 segment
19 S ^TMP($J,"DGRUGMFU",2)=DGREC ;Store MFE segment into array
20 I DGRSEGC="Z36" D G EXIT ;If Z36 segment (Insurance), do following and exit
21 .S DGREC="Z36"_HL("FS")_DGCIEN_$E(HL("ECH"))_DGRENM ;Format Z36 segment
22 .S ^TMP($J,"DGRUGMFU",3)=DGREC ;Store Z36 segment into array
23 I DGRSEGC="STF" D G EXIT ;If STF segment, do following and exit
24 .S DGREC="STF"_HL("FS")_DGCIEN_$E(HL("ECH"))_DGROLDN_$E(HL("ECH"))_DGRFNUM_HL("FS")_HL("FS")_$$HLNAME^HLFNC(DGRENM) ;Format the STF segment
25 .S $P(DGREC,HL("FS"),19)=$$GET1^DIQ(200,DGCIEN,8,"E") ;Set the Job title into sequence 18 (piece 19)
26 .S ^TMP($J,"DGRUGMFU",3)=DGREC ;Store STF segment into array
27 I DGRSEGC="LOC" D G EXIT ;If LOC segment, do the following and exit
28 .I DGRFNUM=405.4 D ;If the LOC is for Room-Bed change, do the following
29 ..S DGRROOM=$P(DGRENM,"-") ;Set room variable
30 ..S DGRBED=$P(DGRENM,"-",2) ;Set bed variable
31 ..S DGRWIEN=$O(^DG(405.4,DGCIEN,"W",0)) ;Set variable to Ward IEN
32 ..S I=$P($G(^DG(405.4,DGCIEN,"W",DGRWIEN,0)),"^") ;Set variable to IEN in Room-Bed file
33 ..S DGRWARD=$$GET1^DIQ(42,I,.01) ;Set variable to Ward location file name
34 ..I DGRWARD]"" S DGRWARD=$$WARDTRAN^DGRUUTL1(I,DGRWARD) ;p-381 added
35 ..S $P(^TMP($J,"DGRUGMFU",2),"^",5)=DGRWARD_$E(HL("ECH"))_DGROLDN_$E(HL("ECH"))_"HL7" ;
36 .I DGRFNUM=42 D
37 ..S DGRROOM="",DGRBED="",DGRWARD=$$GET1^DIQ(42,DGCIEN,.01)
38 .I DGRROOM]"" S DGRBH=$$RBTRAN^DGRUUTL1(DGCIEN,DGRROOM_"-"_DGRBED) S DGRROOM=$P(DGRBH,"-",1),DGRBED=$P(DGRBH,"-",2) ;modified p-328
39 .I DGRWARD]"" S DGRWARD=$$WARDTRAN^DGRUUTL1(DGCIEN,DGRWARD) ;changed p-349
40 .S DGREC="LOC"_HL("FS")_DGRWARD_$E(HL("ECH"))_DGRROOM_$E(HL("ECH"))_DGRBED_$E(HL("ECH"))_$E(HL("ECH"))_$E(HL("ECH"))_"NURSING UNIT"_HL("FS")_HL("FS")_"N"
41 .S ^TMP($J,"DGRUGMFU",3)=DGREC
42EXIT Q
43 ;
44ENGET() ;DETERMINE DIVISION TO GET SUBSCRIBERS
45 ;
46 N I,J,X
47 F I=1:1 X HLNEXT Q:HLQUIT'>0 D
48 .S X(I)=HLNODE,J=0
49 ..F S J=$O(HLNODE(J)) Q:'J S X(I,J)=HLNODE(J)
50 ;LOOK FOR LOC segment
51 S I=0
52 F S I=$O(X(I)) Q:'I D
53 .I $P(X(I),"^",1)="LOC" D
54 ..S DGWARD=$$WARD^DGRUDYN(X(I),2)
55 S DGDIV=+$$GET1^DIQ(42,DGWARD,.015,"I")
56 Q DGDIV
57 ;
Note: See TracBrowser for help on using the repository browser.