source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWIB.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1ORWIB ; SLC/KCM - wrap calls to AISC
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3VISIT(LST,CLINIC) ; get list of visit types for clinic
4 D GETLST^IBDF18A(CLINIC,"DG SELECT VISIT TYPE CPT PROCEDURES","LST")
5 Q
6PROC(LST,CLINIC) ; get list of procedures for clinic
7 D GETLST^IBDF18A(CLINIC,"DG SELECT CPT PROCEDURE CODES","LST")
8 Q
9DIAG(LST,CLINIC) ; get list of diagnoses for clinic
10 D GETLST^IBDF18A(CLINIC,"DG SELECT ICD-9 DIAGNOSIS CODES","LST")
11 Q
12EFVPD(LST,CLINIC) ; get list of encounter form elements
13 N PFN
14 S PFN(1)="DG SELECT VISIT TYPE CPT PROCEDURES"
15 S PFN(2)="DG SELECT CPT PROCEDURE CODES"
16 S PFN(3)="DG SELECT ICD-9 DIAGNOSIS CODES"
17 D GLL^IBDF18A(CLINIC,.PFN,"LST")
18 Q
19SAVEPCE(OK,ORPXAPI) ; save encounter information
20 N PKG,SRC,CODE,IEN,I
21 S PKG=$O(^DIC(9.4,"B","ORDER ENTRY/RESULTS REPORTING",0))
22 S SRC="TEXT INTEGRATION UTILITIES"
23 S I=0 F S I=$O(ORPXAPI("DX/PL",I)) Q:'I D ; ICD codes to ptrs
24 . S CODE=ORPXAPI("DX/PL",I,"DIAGNOSIS"),IEN=+$O(^ICD9("AB",CODE_" ",0))
25 . I IEN'>0 S IEN=$O(^ICD9("AB",CODE_"0 ",0)) ; do I need this??
26 . S ORPXAPI("DX/PL",I,"DIAGNOSIS")=IEN
27 S I=0 F S I=$O(ORPXAPI("PROCEDURE",I)) Q:'I D ; CPT codes to ptrs
28 . S CODE=ORPXAPI("PROCEDURE",I,"PROCEDURE"),IEN=+$O(^ICPT("B",CODE,0))
29 . S ORPXAPI("PROCEDURE",I,"PROCEDURE")=IEN
30 S OK=$$DATA2PCE^PXAPI("ORPXAPI",PKG,SRC)
31 Q
32SCSEL(VAL,DFN,ATM,LOC,VST) ; return SC conditions that may be selected
33 ; VAL=SCallow^SCdflt;AOallow^AOdflt;IRallow^IRdflt;ECallow^ECdflt
34 N X,S S S=";"
35 D SCCOND^PXUTLSCC(DFN,ATM,LOC,$G(VST),.X)
36 S VAL=$G(X("SC"))_S_$G(X("AO"))_S_$G(X("IR"))_S_$G(X("EC"))
37 Q
38SCDIS(LST,DFN) ; Return service connected % and rated disabilities
39 N VAEL,VAERR,I,ILST,DIS,SC,X
40 D ELIG^VADPT
41 S LST(1)="Service Connected: "_$S(+VAEL(3):$P(VAEL(3),U,2)_"%",1:"NO")
42 I 'VAEL(4),'$P($G(^DG(391,+VAEL(6),0)),U,2) S LST(2)="NOT A VETERAN." Q
43 S I=0,ILST=1 F S I=$O(^DPT(DFN,.372,I)) Q:'I S X=^(I,0) D
44 . S DIS=$P($G(^DIC(31,+X,0)),U) Q:DIS=""
45 . S SC=$S($P(X,U,3):"SC",$P(X,U,3)']"":"not specified",1:"NSC")
46 . S ILST=ILST+1,LST(ILST)=DIS_" ("_$P(X,U,2)_"% "_SC_")"
47 I ILST=1 S LST(2)="Rated Disabilities: NONE STATED"
48 Q
Note: See TracBrowser for help on using the repository browser.