source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSD40030.m@ 1437

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

initial load of WorldVistAEHR

File size: 2.1 KB
RevLine 
[613]1YSD40030 ;DALISC/LJA - Repoint MR data to DSM ;[ 07/13/94 2:52 PM ]
2 ;;5.01;MENTAL HEALTH;;Dec 30, 1994
3 ;;
4 ;
5CTRL ;
6 D INIT
7 D CHECK QUIT:'YSD4OK ;->
8 D REPOINT
9 QUIT
10 ;
11INIT ;
12 S YSD4MLC=0 ;Dot-generator counter
13 S YSD4NC=+$G(^YSD(627.99,"AS","MR NUMBER CONVERTED"))
14 S ^YSD(627.99,"AS","MR CONVERSION STARTED")=$H
15 QUIT
16 ;
17CHECK ;
18 S YSD4OK=1
19 QUIT:$G(^YSD(627.99,"AS","MR CONVERSION COMPLETED"))']"" ;->
20 W !!,"Medical Record Conversion has already been completed..."
21 S YSD4OK=0
22 QUIT
23 ;
24REPOINT ; Loop thru all Medical Records and repoint data...
25 ; MR Loop...
26 D STARTNO^YSD40032
27 I YSD4IEN'?1.N D QUIT ;->
28 . K ^YSD(627.99,"AS","MR LAST STARTED")
29 . S ^YSD(627.99,"AS","MR CONVERSION COMPLETED")=$H
30 ;
31 F S YSD4IEN=$O(^MR(YSD4IEN)) QUIT:YSD4IEN'>0 D
32 . S YSD4MLC=YSD4MLC+1 W:'(YSD4MLC#100) "."
33 . D HASDATA QUIT:'YSD4OK ;->
34 . D CONVNTRY ;->
35 ;
36 S ^YSD(627.99,"AS","MR CONVERSION COMPLETED")=$H
37 ;
38 ; Set the DSM-MR CONVERSION COMPLETION field in the Parameter file
39 D NOW^%DTC
40 S $P(^YSA(602,+1,"DSM"),U)=%
41 ;
42 QUIT
43 ;
44CONVNTRY ; Make a DSM CONVERSION file entry
45 ;
46 ; Make Conversion file entry... Quit if not done...
47 D CONVNTRY^YSD40032
48 QUIT:'YSD4CIEN!('YSD4OK)!(YSD4EREP) ;->
49 ;
50RECLP ; Loop thru individual ^MR entry multiples/nodes and record
51 ;
52 ; Lock ^MR entry...
53 L +^MR(+YSD4IEN):60
54 ;
55 ; Locked?
56 I '$T D QUIT ;->
57 . D NOW^%DTC
58 . D PED^YSD4E010(%,"MR Locking problem",90,"",+YSD4IEN,"",+$P($G(^MR(+YSD4IEN,0)),U,2))
59 . S $P(^YSD(627.99,+YSD4CIEN,0),U,2)="E",YSD4EREP=1
60 ;
61 ;
62 ; Locked... Now, repoint data.
63 D REP^YSD40031
64 ;
65 ; Unlock...
66 L -^MR(+YSD4IEN)
67 ;
68 ; Was record successfully repointed?
69 QUIT:'$G(YSD4CFLG) ;->
70 ;
71 ; Up counter...
72 S YSD4NC=YSD4NC+1,^YSD(627.99,"AS","MR NUMBER CONVERTED")=+YSD4NC
73 ;
74 QUIT
75 ;
76 ;----------------------------------------------------------------------
77HASDATA ; Does entry have data to convert, or only a header?
78 N X
79 S YSD4OK=1
80 QUIT:$O(^MR(+YSD4IEN,"DX",0))]"" ;->
81 S X=$G(^MR(+YSD4IEN,"DX1")) QUIT:$P(X,U,2)]""!($P(X,U,4)]"") ;->
82 QUIT:$O(^MR(+YSD4IEN,"PDX",0))]"" ;->
83 QUIT:$O(^MR(+YSD4IEN,"XDX",0))]"" ;->
84 S YSD4OK=0
85 QUIT
86 ;
87EOR ;YSD40030 - Repoint MR data to DSM ;12/7/93 15:12
Note: See TracBrowser for help on using the repository browser.