source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXRHS03.m@ 1133

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1PXRHS03 ; SLC/SBW - PCE Visit data immunization extract ;11/25/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**13**;Aug 12, 1996
3IMMUN(DFN) ; Control branching
4 ;INPUT : DFN - Pointer to PATIENT file (#2)
5 ;OUTPUT :
6 ; Data from V Immunization (9000010.11) file
7 ; ^TMP("PXI",$J,IMM,InvDt,IFN,0) = IMMUNIZATION [E;.01]
8 ; ^ IMMUNIZATION SHORT NAME [E;9999999.14,.02]
9 ; ^ EVENT DATE/TIME or VISIT/ADMIT DATE&TIME [I;1201 or .03]
10 ; ^ SERIES CODE [I;.04] ^ SERIES [E;.04] ^ REACTION [E;.06]
11 ; ^ CONTRAINDICATED [I;.07] ^ ORDERING PROVIDER [E;1202]
12 ; ^ ENCOUNTER PROVIDER [E;1204]
13 ; ^TMP("PXI",$J,IMM,InvDt,IFN,1) = ^ HOSPITAL LOCATION [E;9000010;.22]
14 ; ^ HOSP. LOC. ABBREVIATION [E;44;1]
15 ; ^ LOC OF ENCOUNTER [E;9000010;.06] ^ OUTSIDE LOC [E;9000010;2101]
16 ; ^TMP("PXI",$J,IMM,InvDt,IFN,"R",CNT) = REMARKS [E;1101]
17 ; ^TMP("PXI",$J,IMM,InvDt,IFN,"S") = DATA SOURCE [E;80102]
18 ;
19 ; [] = [I(nternal)/E(xternal); Optional file #; Record #]
20 ; Subscripts:
21 ; IMM - Immunization name
22 ; InvDt - Inverse FileMan date of DATE OF event or visit
23 ; IFN - Internal Record #
24 ;
25 Q:$G(DFN)']""!'$D(^AUPNVIMM("AA",DFN))
26 N PXIMM,PXIVD,PXIFN,IHSDATE
27 S IHSDATE=9999999-$$HSDATE^PXRHS01
28 K ^TMP("PXI",$J)
29 S PXIMM=""
30 F S PXIMM=$O(^AUPNVIMM("AA",DFN,PXIMM)) Q:PXIMM="" D
31 . S PXIVD=0
32 . F S PXIVD=$O(^AUPNVIMM("AA",DFN,PXIMM,PXIVD)) Q:PXIVD'>0 Q:PXIVD>IHSDATE D
33 . . S PXIFN=0
34 . . F S PXIFN=$O(^AUPNVIMM("AA",DFN,PXIMM,PXIVD,PXIFN)) Q:PXIFN'>0 D
35 . . . N DIC,DIQ,DR,DA,REC,IMM,SNIMM,IMDT,SERIESC,SERIES,REACT,CONT
36 . . . N OPROV,EPROV,HLOC,HLOCABB,SOURCE,VDATA,IDT,COMMENT
37 . . . S DIC=9000010.11,DA=PXIFN,DIQ="REC(",DIQ(0)="IE"
38 . . . S DR=".01;.03;.04;.06;.07;1201;1202;1204;80102;81101"
39 . . . D EN^DIQ1
40 . . . Q:'$D(REC)
41 . . . S VDATA=$$GETVDATA(+REC(9000010.11,DA,.03,"I"))
42 . . . S SNIMM=$P($G(^AUTTIMM(REC(9000010.11,DA,.01,"I"),0)),U,2)
43 . . . S IMM=$E(REC(9000010.11,DA,.01,"E"),1,10)
44 . . . I SNIMM']"" S SNIMM=IMM
45 . . . S IMDT=REC(9000010.11,DA,1201,"I")
46 . . . S:IMDT']"" IMDT=$P(VDATA,U)
47 . . . S IDT=9999999-IMDT
48 . . . S SERIESC=REC(9000010.11,DA,.04,"I")
49 . . . S SERIES=REC(9000010.11,DA,.04,"E")
50 . . . S REACT=REC(9000010.11,DA,.06,"E")
51 . . . S CONT=REC(9000010.11,DA,.07,"I")
52 . . . S OPROV=REC(9000010.11,DA,1202,"E")
53 . . . S EPROV=REC(9000010.11,DA,1204,"E")
54 . . . S HLOC=$P(VDATA,U,5)
55 . . . S HLOCABB=$P(VDATA,U,6)
56 . . . S SOURCE=REC(9000010.11,DA,80102,"E")
57 . . . S COMMENT=REC(9000010.11,DA,81101,"E")
58 . . . S ^TMP("PXI",$J,SNIMM,IDT,DA,0)=IMM_U_SNIMM_U_IMDT_U_SERIESC_U_SERIES_U_REACT_U_CONT_U_OPROV_U_EPROV
59 . . . S ^TMP("PXI",$J,SNIMM,IDT,DA,1)=HLOC_U_HLOCABB_U_$P(VDATA,U,2)_U_$P(VDATA,U,4)
60 . . . S ^TMP("PXI",$J,SNIMM,IDT,DA,"S")=SOURCE
61 . . . S ^TMP("PXI",$J,SNIMM,IDT,DA,"COM")=COMMENT
62 . . . D GETREM(SNIMM,IDT,DA)
63 Q
64GETREM(SNIMM,IDT,RNUM) ;Get the remark data
65 N CNT
66 S CNT=0
67 F S CNT=$O(^AUPNVIMM(RNUM,11,CNT)) Q:CNT'>0 D
68 . S ^TMP("PXI",$J,SNIMM,IDT,RNUM,"R",CNT)=$G(^AUPNVIMM(RNUM,11,CNT,0))
69 Q
70GETVDATA(DA) ;Get location of encounter and outside location from visit file
71 N DIC,DIQ,DR,VREC,HLOC,HLOCABB
72 S DIC=9000010,DIQ="VREC(",DIQ(0)="IE"
73 S DR=".01;.06;.07;.22;2101"
74 D EN^DIQ1
75 S HLOC=VREC(9000010,DA,.22,"E")
76 S HLOCABB=$$GETHLOC^PXRHS02(+VREC(9000010,DA,.22,"I"))
77 Q VREC(9000010,DA,.01,"I")_U_VREC(9000010,DA,.06,"E")_U_VREC(9000010,DA,.07,"I")_U_VREC(9000010,DA,2101,"E")_U_HLOC_U_HLOCABB
Note: See TracBrowser for help on using the repository browser.