Subversion Repository Public Repository

Aurocare_27_07_2018

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareemr.Controller;

import com.bestray.healthcarecommonutil.exception.ProcessingException;
import com.bestray.healthcareemr.Service.ReportService;
import com.bestray.healthcareemr.Vo.Treport;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Vector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

// TODO: Auto-generated Javadoc
/**
 * The Class ReportController.
 *
 * @author user2
 */
@Controller
public class ReportController {
    
    /** The report service. */
    @Autowired
    private ReportService reportService;
    
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");

    /**
     * Instantiates a new report controller.
     *
     * @param reportService the report service
     
    public ReportController(ReportService reportService) {
        this.reportService = reportService;
    }
    
    /**
     * Gets the daily report list.
     *
     * @param date the date
     * @param state the state
     * @param status the status
     * @return the daily report list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getDailyReportList(Date date,String state,String status,String gender) throws ProcessingException{
        try{
            Vector<Vector<String>> report = new Vector<Vector<String>>();
            Vector<String> rept;
            List<Treport> dtlReportList = reportService.getDailyReportList( date, state,status,gender);
            for(Treport rport:dtlReportList){
                rept= new Vector<String>();
                rept.add(String.valueOf(rport.getPatientId()));
                rept.add(rport.getName());
                rept.add(rport.getGender());
                String dobdateformate =sdf.format(rport.getDob());
                rept.add(dobdateformate);
                rept.add(rport.getContactNo());
                rept.add(rport.getAddress());
                report.add(rept);
            }
            return report;
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    /**
     * Gets the monthly report list.
     *
     * @param month the month
     * @param year the year
     * @param state the state
     * @param status the status
     * @return the monthly report list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getMonthlyReportList(String month,int year,String state,String status,String gender) throws ProcessingException{
        try{
            Vector<Vector<String>> report = new Vector<Vector<String>>();
            Vector<String> rept;
            List<Treport> dtlReportList = reportService.getMonthlyReportList( month, year, state, status, gender);
            for(Treport rport:dtlReportList){
                rept= new Vector<String>();
                rept.add(String.valueOf(rport.getPatientId()));
                rept.add(rport.getName());
                rept.add(rport.getGender());
                rept.add(String.valueOf(sdf.format(rport.getDob())));
                rept.add(rport.getContactNo());
                rept.add(rport.getAddress());
                report.add(rept);
            }
            return report;
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    /**
     * Gets the yearly report list.
     *
     * @param year the year
     * @param state the state
     * @param status the status
     * @return the yearly report list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getYearlyReportList(int year,String state,String status,String gender) throws ProcessingException{
        try{
            Vector<Vector<String>> report = new Vector<Vector<String>>();
            Vector<String> rept;
            List<Treport> dtlReportList = reportService.getYearlyReportList( year, state, status, gender);
            for(Treport rport:dtlReportList){
                rept= new Vector<String>();
                rept.add(String.valueOf(rport.getPatientId()));
                rept.add(rport.getName());
                rept.add(rport.getGender());
                rept.add(String.valueOf(sdf.format(rport.getDob())));
                rept.add(rport.getContactNo());
                rept.add(rport.getAddress());
                report.add(rept);
            }
            return report;
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the chart report list.
     *
     * @param month the month
     * @param year the year
     * @return the chart report list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getChartReportList(String month, int year) throws ProcessingException{
        try{
            return reportService.getMonthlyChartReportList( month, year);
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the monthly chart table list.
     *
     * @param month the month
     * @param year the year
     * @return the monthly chart table list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getMonthlyChartTableList(String month, int year)throws ProcessingException {
        try{
            Vector<Vector<String>> chartTable = new Vector<Vector<String>>();
            Vector<String> monthChartTable;
            List<Treport> chartTableList = reportService.getMonthlyChartTableList( month, year);
            for(Treport chrtTableList:chartTableList){
                monthChartTable= new Vector<String>();
                monthChartTable.add(chrtTableList.getName());
                monthChartTable.add(chrtTableList.getGender());
                chartTable.add(monthChartTable);
            }
            return chartTable;
        }catch(ProcessingException e){
            throw e;
        }
    }

    /**
     * Gets the yearly chart report list.
     *
     * @param year the year
     * @return the yearly chart report list
     * @throws ProcessingException the processing exception
     */
    public Vector<Vector<String>> getYearlyChartReportList(int year) throws ProcessingException{
       try{
            return reportService.getYearlyChartReportList(year);
        }catch(ProcessingException e){
            throw e;
        }
    }
    
    
}

Commits for Aurocare_27_07_2018/AuroCareEMR/src/main/java/com/bestray/healthcareemr/Controller/ReportController.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Fri 27 Jul, 2018 07:21:55 +0000