source: FOIAVistA/trunk/r/CLINICAL_CASE_REGISTRIES-ROR/RORX008.m@ 811

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1RORX008 ;HOIFO/BH,SG - VERA REIMBURSEMENT REPORT ; 11/8/05 8:38am
2 ;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
3 ;
4 ;--------------------------------------------------------------------
5 ; Registry: [VA ICR]
6 ;--------------------------------------------------------------------
7 Q
8 ;
9 ;***** COMPILES THE "VERA REIMBURSEMENT" REPORT
10 ; REPORT CODE: 008
11 ;
12 ; .RORTSK Task number and task parameters
13 ;
14 ; The ^TMP("RORX008",$J) global node is used by this function.
15 ;
16 ; ^TMP("RORX008",$J,
17 ;
18 ; "DRG",
19 ; GenDrugIEN, Generic drug name
20 ; 0) Number of HIV+ patients
21 ; 1) Number of Clinical AIDS patients
22 ;
23 ; "PAT", Totals
24 ; ^01: Number of basic care patients
25 ; ^02: Number of complex care patients
26 ; ^03: Number of patients received ARVs
27 ; DFN) Patient Descriptor
28 ; ^01: Las 4 digits of SSN
29 ; ^02: Name
30 ; ^03: Date of Death (FileMan)
31 ; ^04: Received ARV drugs(0/1)
32 ; ^05: Complex care (0/1)
33 ;
34 ; Return Values:
35 ; <0 Error code
36 ; 0 Ok
37 ;
38ARVREIMB(RORTSK) ;
39 N ROREDT ; End date
40 N ROREDT1 ; End date + 1
41 N RORREG ; Registry IEN
42 N RORSDT ; Start date
43 N RORXL ; Drug list for the pharmacy search API
44 ;
45 N ECNT,RC,REPORT,SFLAGS,TMP
46 K ^TMP("RORX008",$J)
47 S RORXL="",(ECNT,RC)=0
48 ;--- Root node of the report
49 S REPORT=$$ADDVAL^RORTSK11(RORTSK,"REPORT")
50 Q:REPORT<0 REPORT
51 ;
52 D
53 . ;--- Get and prepare the report parameters
54 . S RORREG=$$PARAM^RORTSK01("REGIEN")
55 . S RC=$$PARAMS(REPORT,.RORSDT,.ROREDT,.SFLAGS) Q:RC<0
56 . S ROREDT1=$$FMADD^XLFDT(ROREDT\1,1)
57 . ;--- Report header
58 . S RC=$$HEADER(REPORT) Q:RC<0
59 . ;--- Query the registry
60 . D TPPSETUP^RORTSK01(75)
61 . S RC=$$QUERY^RORX008A(SFLAGS)
62 . I RC Q:RC<0 S ECNT=ECNT+RC
63 . ;--- Store the results
64 . D TPPSETUP^RORTSK01(25)
65 . S RC=$$STORE^RORX008A(REPORT)
66 . I RC Q:RC<0 S ECNT=ECNT+RC
67 ;
68 ;--- Cleanup
69 K ^TMP("RORX008",$J)
70 D FREE^RORTMP(RORXL)
71 Q $S(RC<0:RC,ECNT>0:-43,1:0)
72 ;
73 ;***** OUTPUTS THE REPORT HEADER
74 ;
75 ; PARTAG Reference (IEN) to the parent tag
76 ;
77 ; Return Values:
78 ; <0 Error code
79 ; >0 IEN of the HEADER element
80 ;
81HEADER(PARTAG) ;
82 ;;DRUGS(#,NAME,NP,NPHIV,NPAIDS) ^I $$PARAM^RORTSK01("OPTIONS","REGMEDSMRY")
83 ;;PATIENTS(#,NAME,LAST4,DOD,AIDSTAT,ARV,COMPLEX)^I $$PARAM^RORTSK01("OPTIONS","PTLIST")
84 ;
85 N HEADER,RC
86 S HEADER=$$HEADER^RORXU002(.RORTSK,PARTAG)
87 Q:HEADER<0 HEADER
88 S RC=$$TBLDEF^RORXU002("HEADER^RORX008",HEADER)
89 Q $S(RC<0:RC,1:HEADER)
90 ;
91 ;***** OUTPUTS THE PARAMETERS TO THE REPORT
92 ;
93 ; PARTAG Reference (IEN) to the parent tag
94 ;
95 ; [.STDT] Start and end dates of the report
96 ; [.ENDT] are returned via these parameters
97 ;
98 ; [.FLAGS] Flags for the $$SKIP^RORXU005 are
99 ; returned via this parameter
100 ;
101 ; Return Values:
102 ; <0 Error code
103 ; >0 IEN of the PARAMETERS element
104 ;
105PARAMS(PARTAG,STDT,ENDT,FLAGS) ;
106 N PARAMS,TMP
107 S PARAMS=$$PARAMS^RORXU002(.RORTSK,PARTAG,.STDT,.ENDT,.FLAGS)
108 Q:PARAMS<0 PARAMS
109 ;--- Process the drug list and options
110 S RORTSK("PARAMS","DRUGS","A","REGMEDS")=1
111 S TMP=$$DRUGLST^RORXU007(.RORTSK,PARAMS,.RORXL)
112 Q:TMP<0 TMP
113 ;---
114 Q PARAMS
Note: See TracBrowser for help on using the repository browser.