source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDHL7.m@ 1166

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1PSDHL7 ;BIR/LTL-HL7 inteface for Control Subs invoked by post init ; 21 Feb 95
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3CHECK ;check for Narcotic Dispensing Equipment System/HL7 interface
4 N DA,DIC,DIE,DIR,DIRUT,DLAYGO,DR,PSD,X,Y
5 S DIR(0)="Y"
6 S DIR("A",1)="Do you want to enter/edit your interface setup"
7 S DIR("A")="for Narcotic Dispensing Equipment Systems",DIR("B")="No"
8 S DIR("?")="^N XQH S XQH=""PSD HL7"" D EN^XQH"
9 D ^DIR K DIR G:Y'=1 END D:Y=1
10 .W !!,"First, I'll check for a PSD-CS entry in your",!
11 .W "HL7 DHCP APPLICATION PARAMETER file (#771)."
12 .S (DIC,DIE)="^HL(771,",DIC(0)="L",DLAYGO=771,X="PSD-CS"
13 .D ^DIC K DIC W:$P(Y,U,3) " Added." I Y<0 W "Failed." G END
14 .W " Updating." S PSDC=+Y
15 .S DIC="^DIC(4,",DR=99,DA=+$P($G(^XMB(1,1,"XUS")),U,17),DIQ="PSD"
16 .D EN^DIQ1 S PSD=PSD(4,DA,99) K DIC,DR,DA,DIQ
17 .S DA=PSDC,PSD(1)="^~\&"
18 .S DR="2////a;3////"_PSD_";100////|;101////^S X=PSD(1)"
19 .D ^DIE K DIE,DR
20 .;S DIC="^HL(771,"_PSD_",""MSG"",",DIC(0)="L",DA(1)=PSD,X="DFT"
21 .;S DIC("P")=$P(^DD(771,6,0),"^",2),DIC("DR")="1////PSDFT"
22 .;D ^DIC K DA,DIC
23 .W !!,"Now, let's check for a PSD-NDES entry in your",!
24 .W "HL7 DHCP APPLICATION PARAMETER file (#771)."
25 .S (DIC,DIE)="^HL(771,",DIC(0)="L",DLAYGO=771,X="PSD-NDES"
26 .D ^DIC K DIC W:$P(Y,U,3) " Added." I Y<0 W "Failed." G END
27 .W " Updating.",!! S (DA,PSDN)=+Y
28 .;S DR="2////"_PSD_";3////PSD-NDES;4////245;5////3;7////1;8////"_PSD_";9////30;14////P;100///Narcotic Dispensing Equipment System" D ^DIE
29 .S DR="2////a;3////PSD-NDES" D ^DIE K DIE,DR,DLAYGO,DIC,PSD
30PROTO ;Pick HLLP or X3.28 protocol
31 S DIR(0)="S^H:Hybrid Lower Layer Protocol;X:X3.28 Protocol"
32 S DIR("A")="Select a communications protocol",DIR("B")="H"
33 S DIR("?")="Select the protocol that your Pharmacy's narcotic dispensing system vendor will use for communication." D ^DIR K DIR G:$D(DIRUT) END
34 G:Y="X" ^PSDHLX
35 S PSD="PSD-NDES HLLP",PSD(1)="PSD HLLP"
36HLLP W !!,"Let's check for a ",PSD," entry in your",!
37 W "HL LOWER LEVEL PROTOCOL PARAMETER file (#869.2)."
38 S (DIC,DIE)="^HLCS(869.2,",DIC(0)="L",DLAYGO=869.2,X=PSD
39 D ^DIC K DIC W:$P(Y,U,3) "Added." I Y<0 W "Failed." G END
40 W " Updating.",!! S (DA,PSDX)=+Y
41 S DR=".02////2;200.08////21;200.01//" D ^DIE
42 W !!,"Let's check for a ",PSD(1)," entry in your"
43 W !,"HL LOGICAL LINK file (#870)."
44 S (DIC,DIE)="^HLCS(870,",DIC(0)="L",DLAYGO=870,X=PSD(1)
45 D ^DIC K DIC W:$P(Y,U,3) "Added." I Y<0 W "Failed." Q
46 W " Updating." S (DA,PSDL)=+Y
47 S DR="2////"_$G(PSDX) D ^DIE K DIC,DA,DIE,DR,DLAYGO D NONK^PSDHLP
48 S DIR(0)="Y",DIR("A")="Do you need to set up another LOGICAL LINK"
49 S DIR("B")="No",DIR("?")="Are you a consolidated site? Do you have more than one host?" W ! D ^DIR K DIR I Y=1 S PSD(3)=$G(PSD(3))+1,PSD=PSD_PSD(3),PSD(1)=PSD(1)_PSD(3) G HLLP
50END Q
Note: See TracBrowser for help on using the repository browser.