source: WorldVistAEHR/trunk/r/CLINICAL_PROCEDURES-MD/MDHL7U.m@ 1739

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1MDHL7U ; HOIFO/WAA -Routine utilities for CP ;7/23/01 11:41
2 ;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004
3 ;
4UPDATE(MDIEN) ; Update File
5 N DZ
6 S DZ=0
7UPD1 L +^MDD(703.1,MDIEN,.1,0):1 G:'$T UPD1
8 S DZ=$P(^MDD(703.1,MDIEN,.1,0),"^",3)+1
9 S $P(^MDD(703.1,MDIEN,.1,0),"^",3,4)=DZ_"^"_DZ
10 L -^MDD(703.1,MDIEN,.1,0)
11 Q DZ
12 ;
13ATT(DEV,ARRAY) ; Get the attributes of a device and pass them back in an
14 ; array.
15 N X
16 S ARRAY=0
17 I $G(^MDS(702.09,DEV,0))="" D
18 . S X=0
19 . S X=$O(^MDS(702.09,"B",DEV,X))
20 . Q
21 E S X=DEV
22 I X>0 D
23 . N LINE,I,Z
24 . S LINE=$G(^MDS(702.09,X,.3)) Q:LINE=""
25 . S Z=""
26 . F I=1:1:($L(LINE,U)) S Z=$P(LINE,U,I) I Z=1 D
27 . . N TEXT
28 . . S TEXT=$T(ATABLE+I)
29 . . S ARRAY(I)=TEXT,ARRAY=ARRAY+1
30 . . Q
31 . Q
32 Q
33PROC ; Create report entry in file (703.1)
34 N DA,DIK
35 I DTO=""!(DFN="") Q
36 S DA=0 F S DA=$O(^MDD(703.1,"B",UNIQ,DA)) Q:'DA I $P($G(^MDD(703.1,DA,0)),"^",5)=DFN Q
37 Q:DA
38P1 L +^MDD(703.1,0):0 G:'$T P1 D
39 .S DA=$P(^MDD(703.1,0),"^",3)+1
40 .S $P(^MDD(703.1,0),"^",3,4)=DA_"^"_DA
41 .L -^MDD(703.1,0)
42 .Q
43 I $D(^MDD(703.1,DA)) G P1
44 S ^MDD(703.1,DA,0)=UNIQ_"^"_DFN_"^"_$$HL7TFM(DATE)_"^"_INST_"^"_$G(MDD702)_"^"_HLMTIEN_"^^^P"
45 S ^MDD(703.1,DA,.1,0)="^703.11S^0^0"
46 S MDIEN=DA
47 S DIK="^MDD(703.1," D IX1^DIK
48 Q
49 ;
50HL7TFM(MDDATE) ; Convert an HL7 Date to FM
51 N MDDT,MDYR
52 S MDYR=$E(MDDATE,1,4)
53 S MDYR=MDYR-1700
54 S MDDT=MDYR_$E(MDDATE,5,8)
55 I $L(MDDATE)>8 S MDDT=MDDT_"."_$E(MDDATE,9,14)
56 Q MDDT
57REINDX ; Re-index record
58 S ^MDD(703.1,DA,.1,DZ,.2,0)="^^"_LN_"^"_LN_"^"_DTO
59 S DIK="^MDD(703.1," D IX1^DIK
60 D:ZCODE="C" GENACK^MDHL7X
61 Q
62ATABLE ;;This is a table of all the processing routines for devices
63 ;;PROCESS UNC;.301;UNC^MDHL7U1;3;
64 ;;PROCESS TEXT;.302;TEXT^MDHL7U2;2;
65 ;;PROCESS URL;.303;URL^MDHL7U1;4;
66 ;;PROCESS DLL;.304;DDL^MDHL7U1;6;
67 ;;PROCESS UUENCODE;.305;UUEN^MDHL7U1;5;
68 ;;PROCESS XML;.306;XML^MDHL7U1;7;
69 ;;PROCESS XMS;.307;XMS^MDHL7U1;8;
Note: See TracBrowser for help on using the repository browser.