source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMP6IC.m@ 1169

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1PXRMP6IC ; SLC/PKR - Inits for PXRM*2.0*6 ;10/26/2007
2 ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
3 ;========================
4MHCOND ;Check for definitions and terms that use an MH finding and a
5 ;condition and convert the condition.
6 N COND,FDA,FI,ICOND,IEN,IENS,MSG,NEWCOND,PTR
7 D BMES^XPDUTL("Converting Conditions for MH findings in definitions and terms.")
8 ;Check definitions.
9 S IEN=0
10 F S IEN=+$O(^PXD(811.9,IEN)) Q:IEN=0 D
11 . I '$D(^PXD(811.9,IEN,20,"E","YTT(601.71,")) Q
12 . S PTR=""
13 . F S PTR=$O(^PXD(811.9,IEN,20,"E","YTT(601.71,",PTR)) Q:PTR="" D
14 .. S FI=0
15 .. F S FI=$O(^PXD(811.9,IEN,20,"E","YTT(601.71,",PTR,FI)) Q:FI="" D
16 ... S COND=$P($G(^PXD(811.9,IEN,20,FI,3)),U,1)
17 ... I COND="" Q
18 ... W !,"811.9 - IEN=",IEN," FI=",FI," COND=",COND
19 ... S NEWCOND=$$NEWCOND(COND)
20 ... W !,NEWCOND
21 ... K FDA,MSG
22 ... S IENS=FI_","_IEN_","
23 ...;Force it to file by deleting the value.
24 ... S FDA(811.902,IENS,14)="@"
25 ... D FILE^DIE("E","FDA","MSG")
26 ... S FDA(811.902,IENS,14)=NEWCOND
27 ... D FILE^DIE("E","FDA","MSG")
28 ;Check terms
29 S IEN=0
30 F S IEN=+$O(^PXRMD(811.5,IEN)) Q:IEN=0 D
31 . I '$D(^PXRMD(811.5,IEN,20,"E","YTT(601.71,")) Q
32 . S PTR=""
33 . F S PTR=$O(^PXRMD(811.5,IEN,20,"E","YTT(601.71,",PTR)) Q:PTR="" D
34 .. S FI=0
35 .. F S FI=$O(^PXRMD(811.5,IEN,20,"E","YTT(601.71,",PTR,FI)) Q:FI="" D
36 ... S COND=$P($G(^PXRMD(811.5,IEN,20,FI,3)),U,1)
37 ... I COND="" Q
38 ... W !,"811.5 - IEN=",IEN," FI=",FI," COND=",COND
39 ... S NEWCOND=$$NEWCOND(COND)
40 ... W !,NEWCOND
41 ... K FDA,MSG
42 ... S IENS=FI_","_IEN_","
43 ...;Force it to file by deleting the value.
44 ... S FDA(811.902,IENS,14)="@"
45 ... D FILE^DIE("E","FDA","MSG")
46 ... S FDA(811.52,IENS,14)=NEWCOND
47 ... D FILE^DIE("E","FDA","MSG")
48 Q
49 ;
50 ;========================
51NEWCOND(COND) ;Replace V with +V for MH conditions using scale.
52 N CHAR,IND,NEWCOND
53 S COND=$TR(COND,"+","")
54 S NEWCOND=""
55 F IND=1:1:$L(COND) D
56 . S CHAR=$E(COND,IND)
57 . I CHAR'="V" S NEWCOND=NEWCOND_CHAR Q
58 .;If the condition is checking a response do not plus.
59 . I $E(COND,(IND+3))="R" S NEWCOND=NEWCOND_CHAR Q
60 . S NEWCOND=NEWCOND_"+"_CHAR
61 Q NEWCOND
Note: See TracBrowser for help on using the repository browser.