VistA-WorldVistAEHR/r/MEDICINE-MC/MCRH3.m

31 lines
1.3 KiB
Mathematica

MCRH3 ; HOIFO/NCA - RHEUMATOLOGY Patient Background Info ;7/3/96 09:13
;;2.3;Medicine;**35**;09/13/1996
; Reference IA #10088
EN1 ; Get the Medicine View File #697.3 entry.
N MCARC,MCHDR,MCRHS,MCARR,MCLP,MCLP1,MCX,MCTR,MCNAM,MCCOL,MCROW
S (MCARC,MCCOL,MCROW)=0
S MCRHS=$O(^MCAR(697.3,"B",MCRHB,0)) I 'MCRHS W !!,"No Medicine View Screen for Rheumatology Patient Background." Q
S MCHDR=$P($G(^MCAR(697.3,MCRHS,0)),"^",7)
S MCLP=0 F S MCLP=$O(^MCAR(697.3,MCRHS,1,"A",MCLP)) Q:MCLP<1 D
.S MCLP1=0 F S MCLP1=$O(^MCAR(697.3,MCRHS,1,"A",MCLP,MCLP1)) Q:MCLP1<1 S MCARR(MCLP)=MCLP1
S MCLP=0 F S MCLP=$O(MCARR(MCLP)) Q:MCLP<1 S MCX=$G(MCARR(MCLP)),MCARR(MCLP)=$G(^MCAR(697.3,MCRHS,1,MCX,0))
S X="IOINHI;IOINLOW" D ENDR^%ZISS
W @IOF,?17,MCHDR S MCLP=0 F S MCLP=$O(MCARR(MCLP)) Q:MCLP<1 S MCX=$G(MCARR(MCLP)) D
.S MCNAM=$P(MCX,"^"),MCCOL=$P(MCX,"^",2)
.S MCROW=$P(MCCOL,","),MCCOL=$P(MCCOL,",",2)
.S MCROW=$P(MCROW,"DY=",2),MCCOL=$P(MCCOL,"DX=",2)
.I MCROW'=MCARC F MCTR=1:1 Q:MCARC=MCROW W ! S MCARC=MCARC+1
.W IOINHI
.W ?MCCOL,MCLP
.W IOINLOW
.W " ",MCNAM_$S($E(MCNAM,$L(MCNAM))=":":"",1:":")
.W IOINHI
.W $G(MCARR1(MCLP))
.W IOINLOW
W !!,"FUNCTION: "
W !!," ^ -- Quit"
W !," N -- New record",!
K DIR S DIR(0)="SOA^N:New Record",DIR("A")="FUNCTION:",DIR("B")="N" D ^DIR Q:$D(DIRUT)!($D(DIROUT))
K DIRUT,DIROUT,IOINLOW,IOINHI
Q