source: WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHIQD.m@ 623

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1DVBHIQD ;ISC-ALBANY/XAK,PKE-generate a HINQ request ;6/1/83@08:00
2 ;;4.0;HINQ;**21,52,55**;03/25/92
3 ;
4TM ;D EN^DVBHQTM I $D(DVBSTOP) K DVBSTOP Q
5 S DIC="^DPT(",DIC(0)="QEAMZ" D ^DIC Q:Y<0 S DFN=+Y
6 D:'$D(DT) DT^DICRW D EN Q
7 ;
8EN I $D(^DVB(395.5,DFN,0)),"PNEA"[$P(^(0),U,4) W !,$C(7),"A HINQ Request has already been made for this patient",!,"Do you wish to make another request " S %=2 D YN^DICN Q:%'=1
9 ;
10PASS X ^%ZOSF("EOFF") R !,"Enter HINQ PASSWORD: ",DVBP:DTIME X ^%ZOSF("EON") S:'$T DVBP="^" Q:'$T!("^."[DVBP) S X=DVBP X ^DD("FUNC",13,1) S DVBP=X I DVBP'?4E W !,*7,"Please enter 4 characters." G PASS
11 ;VBA has changed the format of the HINQ password to allow numbers and
12 ;special characters - DVB*4*55,ERC
13 ;
14BYPASS Q:'$D(DFN) I '$D(Y(0)),$D(^DPT(DFN,0)) S Y(0)=^(0)
15 N I,I2,I3,I4,I5
16 ;
17 Q:'$D(Y(0)) S DVBNAM=$P(Y(0),"^",1),I=$P(DVBNAM,",",1),I2=$P(DVBNAM,",",2),I3=$P(I2," ",2,99),I2=$P(I2," ",1)
18 F J=$L(I):-1:0 Q:$E(I,J)?1A S I=$E(I,1,J-1)
19 F J=1:1 Q:$F(I," ")=0 S K=$F(I," "),I4=$E(I,K,99),I=$E(I,1,K-2)
20 I $D(I4),$L(I4)<4 S I5=""
21 E I $D(I4),$L(I4)>3 I "SRJRIII"[$P(I4," ",2) S:"SRJRIII"'[$P(I4," ") I5=$P(I4," ") S I4=$P(I4," ",2)
22 I $D(I4),I4=" " K I4
23 I $D(I4) F J=$L(I4):-1:0 Q:$E(I4,J)'=" " S I4=$E(I4,1,J-1)
24 I '$D(I5),$D(I4) S I5=I4 K I4
25 F J=0:0 Q:$E(I3)'=" " S I3=$E(I3,2,99)
26 I '$D(I4) S I4=$P(I3," ",2),I3=$P(I3," ",1)
27 I I2["-" S I2=$P(I2,"-")_$P(I2,"-",2)
28 I I3["-" S I3=$P(I3,"-")_$P(I3,"-",2)
29 S DVBNAM=I_$S($D(I5):I5,1:"")_","_I2_$S($D(I3):","_I3,1:"")_$S($D(I4):","_I4,1:"") K I,I2,I3,I4,I5
30 I DVBNAM["'" S DVBNAM=$P(DVBNAM,"'")_$P(DVBNAM,"'",2)
31 I DVBNAM["." S DVBNAM=$P(DVBNAM,".")_$P(DVBNAM,".",2)
32 I DVBNAM["(" S DVBNAM=$P(DVBNAM,"(")
33 S:DVBNAM]"" DVBNAM="NM"_$E(DVBNAM,1,30)_"/"
34 I $D(^DVB(395,1,0)) S DVBSTN=$P(^DVB(395,1,0),U,2) Q:'DVBSTN
35 E W !,*7,"Station number not defined in HINQ Parameters file." Q
36ST ;
37 S DVBZ="HINQ"_DVBSTN_" "_"E"_$S($P(Y(0),"^",9)]""&($P(Y(0),"^",9)'["P"):"SS"_$E($P(Y(0),"^",9),1,9),1:"")_DVBNAM
38 I $P(Y(0),"^",9)]"",$P(Y(0),"^",9)'["P" S DVBZ="HINQ"_DVBSTN_" "_"E"_"SS"_$E($P(Y(0),"^",9),1,9)_DVBNAM G CN
39 S DVBZ="HINQ"_DVBSTN_" "_"E"_DVBNAM
40 ;send C#, S#
41CN S I=$S($D(^DPT(DFN,.31)):$P(^(.31),"^",3),1:"") G SN:I="",SN:I["P" F J=1:1 Q:$L(I)'<8 S I=0_I
42 S:$L(I)=8 I=" "_I S DVBZ=DVBZ_"CN"_I
43 G VDI
44SN S I=$S($D(^DPT(DFN,.32)):$P(^(.32),"^",8),1:"") G VDI:I="",VDI:I["P",VDI:I'?1N.N,VDI:$L(I)>9 F J=1:1 Q:$L(I)'<8 S I=0_I
45 S:$L(I)=8 I=" "_I S DVBZ=DVBZ_"SN"_I
46 ;
47VDI S DVBZ=DVBZ_DVBP,DVBZ=$E(DVBZ,1,9)_$E(DFN_" ",1,14)_$E(DVBZ,10,999)
48 ;
49 K DVBNAM,DVBSTN QUIT
50 ;
51BYPASS1 I '$D(^DVB(395.5,DFN,"HQ")) D BYPASS QUIT
52 E S DVBZ=^DVB(395.5,DFN,"HQ")_DVBP
53 QUIT
Note: See TracBrowser for help on using the repository browser.