source: WorldVistAEHR/trunk/r/HEALTH_DATA_AND_INFORMATICS-HDI/HDISVCMR.m@ 1297

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

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1HDISVCMR ;CT/GRR Data Standardization ; 20 APR 2006 12:17
2 ;;1.0;HEALTH DATA & INFORMATICS;**1,2**;Feb 22, 2005
3 ;
4 ; 2005 05 16 (VA/JRP): fix broken IF/ELSE statement in EN.
5 ;
6 ; 2005 10 06 (VA/JRP): remove last parameter from call to
7 ; $$SNDXML^HDISVM02 at CREATE+12.
8 ;
9 ; 2006 04 11 (WV/TOAD): fix undefined error at CR8OUT when it is called
10 ; from CREATE+4, as was the case when GMRA*4*23 was installed on the
11 ; VOE server.
12 ;
13EN(HDISDOM,HDISFILE) ;
14 ;Input parameter:
15 ; HDISDOM - IEN to the HDIS Domain file (Required)
16 ; HDISFILE - Specific file # to be seeded (if not all domain files) (Optional)
17 N HDISNM,HDISDT,HDERR,HDISFILS,HDISOK,HDISFLIS,HDISDA,HDISOUT,HDISSDT
18 S HDISFLIS=""
19 S HDISFN=.01
20 S HDISNM=$G(^XMB("NETNAME"))
21 S HDISDT=$$NOW^XLFDT(),HDISSDT=$$FMTXML^HDISVU01(HDISDT)
22 I $G(HDISDOM)="" S HDISMESS="Required parameter (Domain) empty, File: "_HDISFILE_", Field: "_HDISFN D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) Q
23 I '$D(^HDIS(7115.1,HDISDOM)) S HDISMESS="Domain ("_HDISDOM_") does not exist. File: "_HDISFILE_", Field: "_HDISFN D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) Q
24 I $$GETVFAIL^HDISVF02() S HDISMESS="VUID DS processer called but is in failsafe mode" D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) Q
25 S HDISOK=$$GETFILS^HDISVF09(HDISDOM,0,.HDISFILS)
26 I 'HDISOK S HDISMESS="No files are pending VUID processing in Domain "_$P(^HDIS(7115.1,HDISDOM,0),"^",1) D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) Q ;modified 5/16/05 p-1
27 I $G(HDISFILE)]"" D Q
28 .I $D(HDISFILS(HDISFILE)) D CREATE(HDISDOM,HDISFILE,HDISFN) I 1
29 .E D ERR^HDISVF09(HDISNM,HDISDT,"File: "_HDISFILE_" is not awaiting processing")
30 S HDISDA=0 F S HDISDA=$O(HDISFILS(HDISDA)) Q:HDISDA'>0 D CREATE(HDISDOM,HDISDA,.01)
31 Q
32 ;
33CREATE(HDISDOM,HDISFILE,HDISFN) ;
34 N HDISARRY,HDISMESS
35 ;Update local status
36 S HDISOUT=$$STATUPD^HDISVCUT(HDISFILE,HDISFN,1)
37 I 'HDISOUT S HDISMESS=$P(HDISOUT,"^",2) D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) G CR8OUT
38 ;
39 ;Create XML doc containing facility data
40 S HDISARRY=$NA(^TMP("HDIS",$J))
41 S HDISOUT=$$FILE^HDISVCFX(HDISDOM,HDISFILE,HDISFN,HDISARRY)
42 I 'HDISOUT S HDISMESS=$P(HDISOUT,"^",2) D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) G CR8OUT
43 ;
44 ; Send XML doc to Central Server
45 S HDISOUT=$$SNDXML^HDISVM02(HDISARRY,1,"") ;removed last parameter 8/10/05 p-2
46 I 'HDISOUT S HDISMESS=$P(HDISOUT,"^",2) D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) G CR8OUT
47 ;
48 ;Update local status file
49 S HDISOUT=$$STATUPD^HDISVCUT(HDISFILE,HDISFN,2)
50 I 'HDISOUT S HDISMESS=$P(HDISOUT,"^",2) D ERR^HDISVF09(HDISNM,HDISDT,HDISMESS) G CR8OUT
51 ;
52CR8OUT I $G(DISARRAY)'="" K @HDISARRY ; WV/TOAD: added IF to avoid UNDEF
53 Q
Note: See TracBrowser for help on using the repository browser.