~registry/dhis2-academy/trunk

« back to all changes in this revision

Viewing changes to local/in/dhis-mobile/J2ME/HP/HMIS-1/SCForm1/src/org/hispindia/mobile/SCForm1.java

  • Committer: Abyot Asalefew Gizaw
  • Date: 2012-10-12 00:13:55 UTC
  • Revision ID: abyota@gmail.com-20121012001355-yehfghfqirdvqmd7
Updating the acadmy trunk with the main DHIS2 trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hispindia.mobile;
 
2
 
 
3
import java.io.IOException;
 
4
import java.io.OutputStream;
 
5
import java.io.UnsupportedEncodingException;
 
6
import java.util.Calendar;
 
7
import java.util.Vector;
 
8
import javax.microedition.io.Connector;
 
9
import javax.microedition.io.HttpConnection;
 
10
import javax.microedition.midlet.*;
 
11
import javax.microedition.lcdui.*;
 
12
import javax.microedition.rms.RecordStore;
 
13
import javax.microedition.rms.RecordStoreException;
 
14
import javax.wireless.messaging.BinaryMessage;
 
15
import javax.wireless.messaging.MessageConnection;
 
16
import javax.wireless.messaging.TextMessage;
 
17
import org.netbeans.microedition.lcdui.SplashScreen;
 
18
 
 
19
public class SCForm1 extends MIDlet implements CommandListener {
 
20
 
 
21
    private boolean midletPaused = false;
 
22
    private boolean editingLastReport = false;
 
23
    private boolean firstRun = false;
 
24
    private RecordStore lastMsgStore = null;
 
25
    private boolean savedMsg = false;
 
26
    private int formID;
 
27
    private String msgVersion = "2";
 
28
    private ImageItem imgItem = new ImageItem(null, null, ImageItem.LAYOUT_TOP, null);
 
29
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
 
30
    private java.util.Hashtable __previousDisplayables = new java.util.Hashtable();
 
31
    private Form InstitutionalDeliveries;
 
32
    private TextField textField16;
 
33
    private TextField textField14;
 
34
    private TextField textField15;
 
35
    private TextField textField13;
 
36
    private Form Pregnancyoutcome;
 
37
    private TextField textField20;
 
38
    private TextField textField19;
 
39
    private TextField textField18;
 
40
    private TextField textField17;
 
41
    private Form Newbornsweighted;
 
42
    private TextField textField21;
 
43
    private TextField textField22;
 
44
    private TextField textField23;
 
45
    private Form ANC_Services;
 
46
    private TextField textField;
 
47
    private TextField textField1;
 
48
    private TextField textField2;
 
49
    private TextField textField3;
 
50
    private TextField textField8;
 
51
    private TextField textField5;
 
52
    private TextField textField4;
 
53
    private TextField textField7;
 
54
    private TextField textField6;
 
55
    private Form Deliveries;
 
56
    private TextField textField11;
 
57
    private TextField textField12;
 
58
    private StringItem stringItem;
 
59
    private TextField textField10;
 
60
    private TextField textField9;
 
61
    private Form PostNatalCare;
 
62
    private TextField textField24;
 
63
    private TextField textField25;
 
64
    private Form sendPage;
 
65
    private StringItem sendMsgLabel;
 
66
    private Form monthPage;
 
67
    private ChoiceGroup freqGroup;
 
68
    private ChoiceGroup monthChoice;
 
69
    private SplashScreen splashScreen;
 
70
    private Form loadPage;
 
71
    private StringItem questionLabel;
 
72
    private ChoiceGroup lastChoice;
 
73
    private ImageItem questionImage;
 
74
    private Form settingsPage;
 
75
    private TextField phone3Num;
 
76
    private TextField phone1Num;
 
77
    private TextField phone2Num;
 
78
    private Form Antinatalcare;
 
79
    private TextField ANC_ThirdVisit;
 
80
    private TextField ANC_TT1;
 
81
    private TextField ANC_TT2;
 
82
    private TextField ANC_Having;
 
83
    private TextField ANC_Hypertension;
 
84
    private TextField ANC_Registration;
 
85
    private TextField ANC_RegistrationWithin;
 
86
    private TextField ANC_Given;
 
87
    private Command institutionaldeliveriesCmd;
 
88
    private Command institutionaldeliveriesBackCmd;
 
89
    private Command pregnancyoutcomeBackCmd;
 
90
    private Command pregnancyoutcomeCmd;
 
91
    private Command newbornsweightedCmd;
 
92
    private Command newbornsweightedBackCmd;
 
93
    private Command ANC_ServicesBackCmd;
 
94
    private Command ANC_ServicesCmd;
 
95
    private Command DeliveriesBackCmd;
 
96
    private Command DeliveriesCmd;
 
97
    private Command childimmunizationCmd;
 
98
    private Command followingimmunizationCmd;
 
99
    private Command followingimmunizationBackCmd;
 
100
    private Command postnatalcareBackCmd;
 
101
    private Command postnatalcareCmd;
 
102
    private Command familyplanningBackCmd;
 
103
    private Command familyplanningCmd;
 
104
    private Command childimmunizationBackCmd;
 
105
    private Command healthfacilityservicesCmd;
 
106
    private Command healthfacilityservicesBackCmd;
 
107
    private Command childhoodCmd;
 
108
    private Command childhoodBackCmd;
 
109
    private Command saveCmd;
 
110
    private Command labtestsCmd;
 
111
    private Command labtestsBackCmd;
 
112
    private Command immunizationsessionsBackCmd;
 
113
    private Command sendBackCmd;
 
114
    private Command immunizationsessionsCmd;
 
115
    private Command sendCmd;
 
116
    private Command aefiCmd;
 
117
    private Command aefiBackCmd;
 
118
    private Command vitaminadoseCmd;
 
119
    private Command monthCmd;
 
120
    private Command vitaminadoseBackCmd;
 
121
    private Command sendExitCmd;
 
122
    private Command backCommand;
 
123
    private Command loadExitCmd;
 
124
    private Command loadCmd;
 
125
    private Command sendSettingsCmd;
 
126
    private Command settingsBackCmd;
 
127
    private Command settingsCmd;
 
128
    private Command sendGPRSCommand;
 
129
    private Command monthExitCmd;
 
130
    private Command antinatalcareBackCmd;
 
131
    private Command antinatalcareCmd;
 
132
    private Image nrhmlogo;
 
133
    private Image question;
 
134
    private Font font;
 
135
//</editor-fold>//GEN-END:|fields|0|
 
136
 
 
137
    /**
 
138
     * The SCForm1 constructor.
 
139
     */
 
140
    public SCForm1() {
 
141
        try {
 
142
            lastMsgStore = RecordStore.openRecordStore("lastMsgStore", true);
 
143
            if (lastMsgStore.getNumRecords() == 0) {
 
144
                firstRun = true;
 
145
            } else {
 
146
                firstRun = false;
 
147
            }
 
148
 
 
149
            if (firstRun) {
 
150
                for (int i = 0; i < 36; i++) {
 
151
                    try {
 
152
                        lastMsgStore.addRecord("".getBytes(), 0, "".getBytes().length);
 
153
                    } catch (RecordStoreException rsex) {
 
154
                        rsex.printStackTrace();
 
155
                    }
 
156
                }
 
157
            } else {
 
158
                if (lastMsgStore.getRecord(4) != null) {
 
159
                    String checkSaved = new String(lastMsgStore.getRecord(4));
 
160
                    if (checkSaved.equals("true")) {
 
161
                        savedMsg = true;
 
162
                    }
 
163
                }
 
164
            }
 
165
        } catch (RecordStoreException ex) {
 
166
            ex.printStackTrace();
 
167
        }
 
168
    }
 
169
 
 
170
//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
 
171
    /**
 
172
     * Switches a display to previous displayable of the current displayable.
 
173
     * The
 
174
     * <code>display</code> instance is obtain from the
 
175
     * <code>getDisplay</code> method.
 
176
     */
 
177
    private void switchToPreviousDisplayable() {
 
178
        Displayable __currentDisplayable = getDisplay().getCurrent();
 
179
        if (__currentDisplayable != null) {
 
180
            Displayable __nextDisplayable = (Displayable) __previousDisplayables.get(__currentDisplayable);
 
181
            if (__nextDisplayable != null) {
 
182
                switchDisplayable(null, __nextDisplayable);
 
183
            }
 
184
        }
 
185
    }
 
186
//</editor-fold>//GEN-END:|methods|0|
 
187
 
 
188
//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
 
189
    /**
 
190
     * Initializes the application. It is called only once when the MIDlet is
 
191
     * started. The method is called before the
 
192
     * <code>startMIDlet</code> method.
 
193
     */
 
194
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
 
195
        // write pre-initialize user code here
 
196
//GEN-LINE:|0-initialize|1|0-postInitialize
 
197
        // write post-initialize user code here
 
198
    }//GEN-BEGIN:|0-initialize|2|
 
199
//</editor-fold>//GEN-END:|0-initialize|2|
 
200
 
 
201
//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
 
202
    /**
 
203
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
 
204
     */
 
205
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
 
206
        // write pre-action user code here
 
207
        switchDisplayable(null, getSplashScreen());//GEN-LINE:|3-startMIDlet|1|3-postAction
 
208
        // write post-action user code here
 
209
    }//GEN-BEGIN:|3-startMIDlet|2|
 
210
//</editor-fold>//GEN-END:|3-startMIDlet|2|
 
211
 
 
212
//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
 
213
    /**
 
214
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
 
215
     */
 
216
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
 
217
        // write pre-action user code here
 
218
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
 
219
        // write post-action user code here
 
220
    }//GEN-BEGIN:|4-resumeMIDlet|2|
 
221
//</editor-fold>//GEN-END:|4-resumeMIDlet|2|
 
222
 
 
223
//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
 
224
    /**
 
225
     * Switches a current displayable in a display. The
 
226
     * <code>display</code> instance is taken from
 
227
     * <code>getDisplay</code> method. This method is used by all actions in the
 
228
     * design for switching displayable.
 
229
     *
 
230
     * @param alert the Alert which is temporarily set to the display; if
 
231
     * <code>null</code>, then
 
232
     * <code>nextDisplayable</code> is set immediately
 
233
     * @param nextDisplayable the Displayable to be set
 
234
     */
 
235
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
 
236
        // write pre-switch user code here
 
237
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
 
238
        Displayable __currentDisplayable = display.getCurrent();
 
239
        if (__currentDisplayable != null && nextDisplayable != null) {
 
240
            __previousDisplayables.put(nextDisplayable, __currentDisplayable);
 
241
        }
 
242
        if (alert == null) {
 
243
            display.setCurrent(nextDisplayable);
 
244
        } else {
 
245
            display.setCurrent(alert, nextDisplayable);
 
246
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
 
247
// write post-switch user code here
 
248
    }//GEN-BEGIN:|5-switchDisplayable|2|
 
249
//</editor-fold>//GEN-END:|5-switchDisplayable|2|
 
250
 
 
251
//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
 
252
    /**
 
253
     * Called by a system to indicated that a command has been invoked on a
 
254
     * particular displayable.
 
255
     *
 
256
     * @param command the Command that was invoked
 
257
     * @param displayable the Displayable where the command was invoked
 
258
     */
 
259
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
 
260
        // write pre-action user code here
 
261
        if (displayable == ANC_Services) {//GEN-BEGIN:|7-commandAction|1|520-preAction
 
262
            if (command == ANC_ServicesBackCmd) {//GEN-END:|7-commandAction|1|520-preAction
 
263
                // write pre-action user code here
 
264
                switchDisplayable(null, getMonthPage());//GEN-LINE:|7-commandAction|2|520-postAction
 
265
                // write post-action user code here
 
266
            } else if (command == ANC_ServicesCmd) {//GEN-LINE:|7-commandAction|3|522-preAction
 
267
                // write pre-action user code here
 
268
                switchDisplayable(null, getDeliveries());//GEN-LINE:|7-commandAction|4|522-postAction
 
269
                // write post-action user code here
 
270
            }//GEN-BEGIN:|7-commandAction|5|493-preAction
 
271
        } else if (displayable == Antinatalcare) {
 
272
            if (command == antinatalcareBackCmd) {//GEN-END:|7-commandAction|5|493-preAction
 
273
                // write pre-action user code here
 
274
                switchDisplayable(null, getMonthPage());//GEN-LINE:|7-commandAction|6|493-postAction
 
275
                // write post-action user code here
 
276
            } else if (command == antinatalcareCmd) {//GEN-LINE:|7-commandAction|7|488-preAction
 
277
                // write pre-action user code here
 
278
//GEN-LINE:|7-commandAction|8|488-postAction
 
279
                // write post-action user code here
 
280
            }//GEN-BEGIN:|7-commandAction|9|535-preAction
 
281
        } else if (displayable == Deliveries) {
 
282
            if (command == DeliveriesBackCmd) {//GEN-END:|7-commandAction|9|535-preAction
 
283
                // write pre-action user code here
 
284
                switchDisplayable(null, getANC_Services());//GEN-LINE:|7-commandAction|10|535-postAction
 
285
                // write post-action user code here
 
286
            } else if (command == DeliveriesCmd) {//GEN-LINE:|7-commandAction|11|537-preAction
 
287
                // write pre-action user code here
 
288
                switchDisplayable(null, getInstitutionalDeliveries());//GEN-LINE:|7-commandAction|12|537-postAction
 
289
                // write post-action user code here
 
290
            }//GEN-BEGIN:|7-commandAction|13|548-preAction
 
291
        } else if (displayable == InstitutionalDeliveries) {
 
292
            if (command == institutionaldeliveriesBackCmd) {//GEN-END:|7-commandAction|13|548-preAction
 
293
                // write pre-action user code here
 
294
                switchDisplayable(null, getDeliveries());//GEN-LINE:|7-commandAction|14|548-postAction
 
295
                // write post-action user code here
 
296
            } else if (command == institutionaldeliveriesCmd) {//GEN-LINE:|7-commandAction|15|550-preAction
 
297
                // write pre-action user code here
 
298
                switchDisplayable(null, getPregnancyoutcome());//GEN-LINE:|7-commandAction|16|550-postAction
 
299
                // write post-action user code here
 
300
            }//GEN-BEGIN:|7-commandAction|17|570-preAction
 
301
        } else if (displayable == Newbornsweighted) {
 
302
            if (command == newbornsweightedBackCmd) {//GEN-END:|7-commandAction|17|570-preAction
 
303
                // write pre-action user code here
 
304
                switchDisplayable(null, getPregnancyoutcome());//GEN-LINE:|7-commandAction|18|570-postAction
 
305
                // write post-action user code here
 
306
            } else if (command == newbornsweightedCmd) {//GEN-LINE:|7-commandAction|19|572-preAction
 
307
                // write pre-action user code here
 
308
                switchDisplayable(null, getPostNatalCare());//GEN-LINE:|7-commandAction|20|572-postAction
 
309
                // write post-action user code here
 
310
            }//GEN-BEGIN:|7-commandAction|21|580-preAction
 
311
        } else if (displayable == PostNatalCare) {
 
312
            if (command == postnatalcareBackCmd) {//GEN-END:|7-commandAction|21|580-preAction
 
313
                // write pre-action user code here
 
314
                switchDisplayable(null, getNewbornsweighted());//GEN-LINE:|7-commandAction|22|580-postAction
 
315
                // write post-action user code here
 
316
            } else if (command == postnatalcareCmd) {//GEN-LINE:|7-commandAction|23|582-preAction
 
317
                // write pre-action user code here
 
318
                getEmptyFields();
 
319
                switchDisplayable(null, getSendPage());//GEN-LINE:|7-commandAction|24|582-postAction
 
320
                // write post-action user code here
 
321
            }//GEN-BEGIN:|7-commandAction|25|559-preAction
 
322
        } else if (displayable == Pregnancyoutcome) {
 
323
            if (command == pregnancyoutcomeBackCmd) {//GEN-END:|7-commandAction|25|559-preAction
 
324
                // write pre-action user code here
 
325
                switchDisplayable(null, getInstitutionalDeliveries());//GEN-LINE:|7-commandAction|26|559-postAction
 
326
                // write post-action user code here
 
327
            } else if (command == pregnancyoutcomeCmd) {//GEN-LINE:|7-commandAction|27|561-preAction
 
328
                // write pre-action user code here
 
329
                switchDisplayable(null, getNewbornsweighted());//GEN-LINE:|7-commandAction|28|561-postAction
 
330
                // write post-action user code here
 
331
            }//GEN-BEGIN:|7-commandAction|29|226-preAction
 
332
        } else if (displayable == loadPage) {
 
333
            if (command == loadCmd) {//GEN-END:|7-commandAction|29|226-preAction
 
334
                int lastSelected = lastChoice.getSelectedIndex();
 
335
                if (lastSelected == 0) {
 
336
                    editingLastReport = true;
 
337
                } else {
 
338
                    editingLastReport = false;
 
339
                }
 
340
                switchDisplayable(null, getMonthPage());//GEN-LINE:|7-commandAction|30|226-postAction
 
341
                // write post-action user code here
 
342
            } else if (command == loadExitCmd) {//GEN-LINE:|7-commandAction|31|228-preAction
 
343
                // write pre-action user code here
 
344
                exitMIDlet();//GEN-LINE:|7-commandAction|32|228-postAction
 
345
                // write post-action user code here
 
346
            }//GEN-BEGIN:|7-commandAction|33|180-preAction
 
347
        } else if (displayable == monthPage) {
 
348
            if (command == monthCmd) {//GEN-END:|7-commandAction|33|180-preAction
 
349
                // write pre-action user code here
 
350
                switchDisplayable(null, getANC_Services());//GEN-LINE:|7-commandAction|34|180-postAction
 
351
                // write post-action user code here
 
352
            } else if (command == monthExitCmd) {//GEN-LINE:|7-commandAction|35|459-preAction
 
353
                // write pre-action user code here
 
354
                exitMIDlet();//GEN-LINE:|7-commandAction|36|459-postAction
 
355
                // write post-action user code here
 
356
            }//GEN-BEGIN:|7-commandAction|37|703-preAction
 
357
        } else if (displayable == sendPage) {
 
358
            if (command == saveCmd) {//GEN-END:|7-commandAction|37|703-preAction
 
359
                // write pre-action user code here
 
360
                final String monthStr = monthChoice.getString(monthChoice.getSelectedIndex());
 
361
                final String freqStr = freqGroup.getString(freqGroup.getSelectedIndex());
 
362
                saveDataToRMS(monthStr, freqStr);
 
363
                Alert myAlert = new Alert("Save success","Your data has been saved!",null,AlertType.INFO);
 
364
                myAlert.setTimeout(2000);
 
365
                Display.getDisplay(this).setCurrent(myAlert,sendPage);
 
366
//GEN-LINE:|7-commandAction|38|703-postAction
 
367
                // write post-action user code here
 
368
            } else if (command == sendBackCmd) {//GEN-LINE:|7-commandAction|39|171-preAction
 
369
                // write pre-action user code here
 
370
                switchDisplayable(null, getPostNatalCare());//GEN-LINE:|7-commandAction|40|171-postAction
 
371
                // write post-action user code here
 
372
            } else if (command == sendCmd) {//GEN-LINE:|7-commandAction|41|169-preAction
 
373
                sendMsgLabel.setText("Sending SMS...");
 
374
                final String monthStr = monthChoice.getString(monthChoice.getSelectedIndex());
 
375
                final String freqStr = freqGroup.getString(freqGroup.getSelectedIndex());
 
376
 
 
377
                final String scForm1Data = collectFormData(monthStr, freqStr);
 
378
                //<editor-fold defaultstate="collapsed" desc=" Thread to Save Records to RMS ">
 
379
                saveDataToRMS(monthStr,freqStr);
 
380
                //</editor-fold>
 
381
 
 
382
                //<editor-fold defaultstate="collapsed" desc=" Thread to Send SMS ">
 
383
                sendDataViaSMS(scForm1Data);
 
384
                //</editor-fold>
 
385
 
 
386
//GEN-LINE:|7-commandAction|42|169-postAction
 
387
                // write post-action user code here
 
388
            } else if (command == sendExitCmd) {//GEN-LINE:|7-commandAction|43|207-preAction
 
389
                // write pre-action user code here
 
390
                exitMIDlet();//GEN-LINE:|7-commandAction|44|207-postAction
 
391
                // write post-action user code here
 
392
            } else if (command == sendSettingsCmd) {//GEN-LINE:|7-commandAction|45|255-preAction
 
393
                // write pre-action user code here
 
394
                switchDisplayable(null, getSettingsPage());//GEN-LINE:|7-commandAction|46|255-postAction
 
395
                // write post-action user code here
 
396
            }//GEN-BEGIN:|7-commandAction|47|246-preAction
 
397
        } else if (displayable == settingsPage) {
 
398
            if (command == settingsBackCmd) {//GEN-END:|7-commandAction|47|246-preAction
 
399
                // write pre-action user code here
 
400
                switchDisplayable(null, getSendPage());//GEN-LINE:|7-commandAction|48|246-postAction
 
401
                // write post-action user code here
 
402
            } else if (command == settingsCmd) {//GEN-LINE:|7-commandAction|49|243-preAction
 
403
                try {
 
404
                    String phone1 = phone1Num.getString();
 
405
                    String phone2 = phone2Num.getString();
 
406
                    String phone3 = phone3Num.getString();
 
407
 
 
408
                    lastMsgStore.setRecord(1, phone1.getBytes(), 0, phone1.length());
 
409
                    lastMsgStore.setRecord(2, phone2.getBytes(), 0, phone2.length());
 
410
                    lastMsgStore.setRecord(3, phone3.getBytes(), 0, phone3.length());
 
411
                    //the id number 4 is already in use so i choose number 5
 
412
 
 
413
                    if (sendMsgLabel != null) {
 
414
                        sendMsgLabel.setText("Settings Saved... Press \"Send  to send report");
 
415
                    }
 
416
                } catch (RecordStoreException ex) {
 
417
                    ex.printStackTrace();
 
418
                }
 
419
                switchToPreviousDisplayable();//GEN-LINE:|7-commandAction|50|243-postAction
 
420
                // write post-action user code here
 
421
            }//GEN-BEGIN:|7-commandAction|51|203-preAction
 
422
        } else if (displayable == splashScreen) {
 
423
            if (command == SplashScreen.DISMISS_COMMAND) {//GEN-END:|7-commandAction|51|203-preAction
 
424
                if (savedMsg == false) {
 
425
                    switchDisplayable(null, getMonthPage());
 
426
                } else {
 
427
                    switchDisplayable(null, getLoadPage());//GEN-LINE:|7-commandAction|52|203-postAction
 
428
                }
 
429
            }//GEN-BEGIN:|7-commandAction|53|7-postCommandAction
 
430
        }//GEN-END:|7-commandAction|53|7-postCommandAction
 
431
        // write post-action user code here
 
432
    }//GEN-BEGIN:|7-commandAction|54|
 
433
//</editor-fold>//GEN-END:|7-commandAction|54|
 
434
 
 
435
 
 
436
 
 
437
 
 
438
 
 
439
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendPage ">//GEN-BEGIN:|167-getter|0|167-preInit
 
440
    /**
 
441
     * Returns an initialized instance of sendPage component.
 
442
     *
 
443
     * @return the initialized component instance
 
444
     */
 
445
    public Form getSendPage() {
 
446
        if (sendPage == null) {//GEN-END:|167-getter|0|167-preInit
 
447
            // write pre-init user code here
 
448
            sendPage = new Form(LocalizationSupport.getMessage("sendPageTitle"), new Item[]{getSendMsgLabel()});//GEN-BEGIN:|167-getter|1|167-postInit
 
449
            sendPage.addCommand(getSendCmd());
 
450
            sendPage.addCommand(getSendBackCmd());
 
451
            sendPage.addCommand(getSendExitCmd());
 
452
            sendPage.addCommand(getSendSettingsCmd());
 
453
            sendPage.addCommand(getSaveCmd());
 
454
            sendPage.setCommandListener(this);//GEN-END:|167-getter|1|167-postInit
 
455
 
 
456
            if (sendPage.size() > 1) {
 
457
                sendPage.delete(sendPage.size() - 1);
 
458
            }
 
459
            sendPage.append(imgItem);
 
460
 
 
461
        }//GEN-BEGIN:|167-getter|2|
 
462
        return sendPage;
 
463
    }
 
464
//</editor-fold>//GEN-END:|167-getter|2|
 
465
 
 
466
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendCmd ">//GEN-BEGIN:|168-getter|0|168-preInit
 
467
    /**
 
468
     * Returns an initialized instance of sendCmd component.
 
469
     *
 
470
     * @return the initialized component instance
 
471
     */
 
472
    public Command getSendCmd() {
 
473
        if (sendCmd == null) {//GEN-END:|168-getter|0|168-preInit
 
474
            // write pre-init user code here
 
475
            sendCmd = new Command("Send SMS", Command.OK, 0);//GEN-LINE:|168-getter|1|168-postInit
 
476
            // write post-init user code here
 
477
        }//GEN-BEGIN:|168-getter|2|
 
478
        return sendCmd;
 
479
    }
 
480
//</editor-fold>//GEN-END:|168-getter|2|
 
481
 
 
482
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendBackCmd ">//GEN-BEGIN:|170-getter|0|170-preInit
 
483
    /**
 
484
     * Returns an initialized instance of sendBackCmd component.
 
485
     *
 
486
     * @return the initialized component instance
 
487
     */
 
488
    public Command getSendBackCmd() {
 
489
        if (sendBackCmd == null) {//GEN-END:|170-getter|0|170-preInit
 
490
            // write pre-init user code here
 
491
            sendBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|170-getter|1|170-postInit
 
492
            // write post-init user code here
 
493
        }//GEN-BEGIN:|170-getter|2|
 
494
        return sendBackCmd;
 
495
    }
 
496
//</editor-fold>//GEN-END:|170-getter|2|
 
497
 
 
498
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthPage ">//GEN-BEGIN:|178-getter|0|178-preInit
 
499
    /**
 
500
     * Returns an initialized instance of monthPage component.
 
501
     *
 
502
     * @return the initialized component instance
 
503
     */
 
504
    public Form getMonthPage() {
 
505
        if (monthPage == null) {//GEN-END:|178-getter|0|178-preInit
 
506
            // write pre-init user code here
 
507
            monthPage = new Form(LocalizationSupport.getMessage("monthPageTitle"), new Item[]{getFreqGroup(), getMonthChoice()});//GEN-BEGIN:|178-getter|1|178-postInit
 
508
            monthPage.addCommand(getMonthCmd());
 
509
            monthPage.addCommand(getMonthExitCmd());
 
510
            monthPage.setCommandListener(this);//GEN-END:|178-getter|1|178-postInit
 
511
            // write pre-init user code here
 
512
        }//GEN-BEGIN:|178-getter|2|
 
513
        return monthPage;
 
514
    }
 
515
//</editor-fold>//GEN-END:|178-getter|2|
 
516
 
 
517
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthChoice ">//GEN-BEGIN:|189-getter|0|189-preInit
 
518
    /**
 
519
     * Returns an initialized instance of monthChoice component.
 
520
     *
 
521
     * @return the initialized component instance
 
522
     */
 
523
    public ChoiceGroup getMonthChoice() {
 
524
        if (monthChoice == null) {//GEN-END:|189-getter|0|189-preInit
 
525
            // write pre-init user code here
 
526
            monthChoice = new ChoiceGroup(LocalizationSupport.getMessage("monthChoiceLabel"), Choice.POPUP);//GEN-BEGIN:|189-getter|1|189-postInit
 
527
            monthChoice.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | Item.LAYOUT_2);
 
528
            monthChoice.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);//GEN-END:|189-getter|1|189-postInit
 
529
            // write pre-init user code here
 
530
            try {
 
531
                    // create monthChoice list
 
532
                    Calendar cal = Calendar.getInstance();
 
533
                    String[] monthNames = {
 
534
                        "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 
535
                    };
 
536
 
 
537
                    // append current month in to monthChoice
 
538
                    monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
 
539
                    
 
540
                    // Calculate and continue add 12 previous months into monthChoice
 
541
                    for (int i = 0; i < 13; i++) {               
 
542
                        cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - 1);
 
543
                        if (cal.get(Calendar.MONTH) == -1) {
 
544
                            cal.set(Calendar.MONTH, 11);
 
545
                            cal.set(Calendar.YEAR, cal.get(Calendar.YEAR) - 1);
 
546
                        }
 
547
                        monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
 
548
 
 
549
                    }
 
550
                    
 
551
                    
 
552
//                    for (int i = 0; i < 13; i++) {               
 
553
//                        cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - 1);
 
554
//                        if (cal.get(Calendar.MONTH) == -1) {
 
555
//                            cal.set(Calendar.MONTH, 11);
 
556
//                            cal.set(Calendar.YEAR, cal.get(Calendar.YEAR) - 1);
 
557
//                        }
 
558
//                        monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
 
559
//
 
560
//                    }
 
561
                        
 
562
                    // Index to save default month.
 
563
                    // int index = 0;// current month
 
564
                    int index = 1; // last month
 
565
 
 
566
                    //setdefault selected item in monthChoice
 
567
                    if (editingLastReport) {
 
568
                        if (lastMsgStore.getRecord(10) != null) {
 
569
                            
 
570
                            for(index = 0; index < monthChoice.size(); index++)
 
571
                            {       
 
572
                                if(monthChoice.getString(index).equalsIgnoreCase(new String(lastMsgStore.getRecord(10)))){
 
573
                                    break;
 
574
                                }
 
575
                            }
 
576
                            monthChoice.setSelectedIndex(index, true); // need the last report value
 
577
                        }
 
578
                    } else {
 
579
                        monthChoice.setSelectedIndex(index, true); // if not need the last report value
 
580
                    }
 
581
                } catch (RecordStoreException rsex) {
 
582
                    rsex.printStackTrace();
 
583
                }
 
584
        }//GEN-BEGIN:|189-getter|2|
 
585
        return monthChoice;
 
586
    }
 
587
//</editor-fold>//GEN-END:|189-getter|2|
 
588
 
 
589
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthCmd ">//GEN-BEGIN:|179-getter|0|179-preInit
 
590
    /**
 
591
     * Returns an initialized instance of monthCmd component.
 
592
     *
 
593
     * @return the initialized component instance
 
594
     */
 
595
    public Command getMonthCmd() {
 
596
        if (monthCmd == null) {//GEN-END:|179-getter|0|179-preInit
 
597
            // write pre-init user code here
 
598
            monthCmd = new Command("Ok", Command.OK, 0);//GEN-LINE:|179-getter|1|179-postInit
 
599
            // write post-init user code here
 
600
        }//GEN-BEGIN:|179-getter|2|
 
601
        return monthCmd;
 
602
    }
 
603
//</editor-fold>//GEN-END:|179-getter|2|
 
604
 
 
605
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: splashScreen ">//GEN-BEGIN:|202-getter|0|202-preInit
 
606
    /**
 
607
     * Returns an initialized instance of splashScreen component.
 
608
     *
 
609
     * @return the initialized component instance
 
610
     */
 
611
    public SplashScreen getSplashScreen() {
 
612
        if (splashScreen == null) {//GEN-END:|202-getter|0|202-preInit
 
613
            // write pre-init user code here
 
614
            splashScreen = new SplashScreen(getDisplay());//GEN-BEGIN:|202-getter|1|202-postInit
 
615
            splashScreen.setTitle("");
 
616
            splashScreen.setCommandListener(this);
 
617
            splashScreen.setFullScreenMode(true);
 
618
            splashScreen.setImage(getNrhmlogo());
 
619
            splashScreen.setText(LocalizationSupport.getMessage("brandingLabel"));
 
620
            splashScreen.setTimeout(3000);//GEN-END:|202-getter|1|202-postInit
 
621
            // write post-init user code here
 
622
        }//GEN-BEGIN:|202-getter|2|
 
623
        return splashScreen;
 
624
    }
 
625
//</editor-fold>//GEN-END:|202-getter|2|
 
626
 
 
627
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: nrhmlogo ">//GEN-BEGIN:|205-getter|0|205-preInit
 
628
    /**
 
629
     * Returns an initialized instance of nrhmlogo component.
 
630
     *
 
631
     * @return the initialized component instance
 
632
     */
 
633
    public Image getNrhmlogo() {
 
634
        if (nrhmlogo == null) {//GEN-END:|205-getter|0|205-preInit
 
635
            // write pre-init user code here
 
636
            try {//GEN-BEGIN:|205-getter|1|205-@java.io.IOException
 
637
                nrhmlogo = Image.createImage("/org/hispindia/mobile/images/nrhm-logo.png");
 
638
            } catch (java.io.IOException e) {//GEN-END:|205-getter|1|205-@java.io.IOException
 
639
                e.printStackTrace();
 
640
            }//GEN-LINE:|205-getter|2|205-postInit
 
641
// write post-init user code here
 
642
        }//GEN-BEGIN:|205-getter|3|
 
643
        return nrhmlogo;
 
644
    }
 
645
//</editor-fold>//GEN-END:|205-getter|3|
 
646
 
 
647
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendExitCmd ">//GEN-BEGIN:|206-getter|0|206-preInit
 
648
    /**
 
649
     * Returns an initialized instance of sendExitCmd component.
 
650
     *
 
651
     * @return the initialized component instance
 
652
     */
 
653
    public Command getSendExitCmd() {
 
654
        if (sendExitCmd == null) {//GEN-END:|206-getter|0|206-preInit
 
655
            // write pre-init user code here
 
656
            sendExitCmd = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|206-getter|1|206-postInit
 
657
            // write post-init user code here
 
658
        }//GEN-BEGIN:|206-getter|2|
 
659
        return sendExitCmd;
 
660
    }
 
661
//</editor-fold>//GEN-END:|206-getter|2|
 
662
 
 
663
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendMsgLabel ">//GEN-BEGIN:|210-getter|0|210-preInit
 
664
    /**
 
665
     * Returns an initialized instance of sendMsgLabel component.
 
666
     *
 
667
     * @return the initialized component instance
 
668
     */
 
669
    public StringItem getSendMsgLabel() {
 
670
        if (sendMsgLabel == null) {//GEN-END:|210-getter|0|210-preInit
 
671
            // write pre-init user code here
 
672
            sendMsgLabel = new StringItem("Info:", "Data Collection Complete.\nPress \"Send SMS\" to send information to server", Item.PLAIN);//GEN-BEGIN:|210-getter|1|210-postInit
 
673
            sendMsgLabel.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_SHRINK | Item.LAYOUT_VSHRINK | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND | Item.LAYOUT_2);
 
674
            sendMsgLabel.setFont(getFont());//GEN-END:|210-getter|1|210-postInit
 
675
            // write post-init user code here
 
676
        }//GEN-BEGIN:|210-getter|2|
 
677
        return sendMsgLabel;
 
678
    }
 
679
//</editor-fold>//GEN-END:|210-getter|2|
 
680
 
 
681
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: font ">//GEN-BEGIN:|211-getter|0|211-preInit
 
682
    /**
 
683
     * Returns an initialized instance of font component.
 
684
     *
 
685
     * @return the initialized component instance
 
686
     */
 
687
    public Font getFont() {
 
688
        if (font == null) {//GEN-END:|211-getter|0|211-preInit
 
689
            // write pre-init user code here
 
690
            font = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD | Font.STYLE_UNDERLINED, Font.SIZE_MEDIUM);//GEN-LINE:|211-getter|1|211-postInit
 
691
            // write post-init user code here
 
692
        }//GEN-BEGIN:|211-getter|2|
 
693
        return font;
 
694
    }
 
695
//</editor-fold>//GEN-END:|211-getter|2|
 
696
 
 
697
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: question ">//GEN-BEGIN:|213-getter|0|213-preInit
 
698
    /**
 
699
     * Returns an initialized instance of question component.
 
700
     *
 
701
     * @return the initialized component instance
 
702
     */
 
703
    public Image getQuestion() {
 
704
        if (question == null) {//GEN-END:|213-getter|0|213-preInit
 
705
            // write pre-init user code here
 
706
            try {//GEN-BEGIN:|213-getter|1|213-@java.io.IOException
 
707
                question = Image.createImage("/org/hispindia/mobile/images/question.png");
 
708
            } catch (java.io.IOException e) {//GEN-END:|213-getter|1|213-@java.io.IOException
 
709
                e.printStackTrace();
 
710
            }//GEN-LINE:|213-getter|2|213-postInit
 
711
// write post-init user code here
 
712
        }//GEN-BEGIN:|213-getter|3|
 
713
        return question;
 
714
    }
 
715
//</editor-fold>//GEN-END:|213-getter|3|
 
716
 
 
717
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadPage ">//GEN-BEGIN:|219-getter|0|219-preInit
 
718
    /**
 
719
     * Returns an initialized instance of loadPage component.
 
720
     *
 
721
     * @return the initialized component instance
 
722
     */
 
723
    public Form getLoadPage() {
 
724
        if (loadPage == null) {//GEN-END:|219-getter|0|219-preInit
 
725
            // write pre-init user code here
 
726
            loadPage = new Form(LocalizationSupport.getMessage("loadPageTitle"), new Item[]{getQuestionImage(), getQuestionLabel(), getLastChoice()});//GEN-BEGIN:|219-getter|1|219-postInit
 
727
            loadPage.addCommand(getLoadCmd());
 
728
            loadPage.addCommand(getLoadExitCmd());
 
729
            loadPage.setCommandListener(this);//GEN-END:|219-getter|1|219-postInit
 
730
            // write post-init user code here
 
731
        }//GEN-BEGIN:|219-getter|2|
 
732
        return loadPage;
 
733
    }
 
734
//</editor-fold>//GEN-END:|219-getter|2|
 
735
 
 
736
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: questionLabel ">//GEN-BEGIN:|221-getter|0|221-preInit
 
737
    /**
 
738
     * Returns an initialized instance of questionLabel component.
 
739
     *
 
740
     * @return the initialized component instance
 
741
     */
 
742
    public StringItem getQuestionLabel() {
 
743
        if (questionLabel == null) {//GEN-END:|221-getter|0|221-preInit
 
744
            // write pre-init user code here
 
745
            questionLabel = new StringItem("", LocalizationSupport.getMessage("questionLabel"));//GEN-LINE:|221-getter|1|221-postInit
 
746
            // write post-init user code here
 
747
        }//GEN-BEGIN:|221-getter|2|
 
748
        return questionLabel;
 
749
    }
 
750
//</editor-fold>//GEN-END:|221-getter|2|
 
751
 
 
752
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: lastChoice ">//GEN-BEGIN:|222-getter|0|222-preInit
 
753
    /**
 
754
     * Returns an initialized instance of lastChoice component.
 
755
     *
 
756
     * @return the initialized component instance
 
757
     */
 
758
    public ChoiceGroup getLastChoice() {
 
759
        if (lastChoice == null) {//GEN-END:|222-getter|0|222-preInit
 
760
            // write pre-init user code here
 
761
            lastChoice = new ChoiceGroup(LocalizationSupport.getMessage("lastChoiceLabel"), Choice.EXCLUSIVE);//GEN-BEGIN:|222-getter|1|222-postInit
 
762
            lastChoice.append(LocalizationSupport.getMessage("lastChoiceYes"), null);
 
763
            lastChoice.append(LocalizationSupport.getMessage("lastChoiceNo"), null);
 
764
            lastChoice.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);
 
765
            lastChoice.setSelectedFlags(new boolean[]{false, false});//GEN-END:|222-getter|1|222-postInit
 
766
            // write post-init user code here
 
767
        }//GEN-BEGIN:|222-getter|2|
 
768
        return lastChoice;
 
769
    }
 
770
//</editor-fold>//GEN-END:|222-getter|2|
 
771
 
 
772
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadCmd ">//GEN-BEGIN:|225-getter|0|225-preInit
 
773
    /**
 
774
     * Returns an initialized instance of loadCmd component.
 
775
     *
 
776
     * @return the initialized component instance
 
777
     */
 
778
    public Command getLoadCmd() {
 
779
        if (loadCmd == null) {//GEN-END:|225-getter|0|225-preInit
 
780
            // write pre-init user code here
 
781
            loadCmd = new Command("Ok", Command.OK, 0);//GEN-LINE:|225-getter|1|225-postInit
 
782
            // write post-init user code here
 
783
        }//GEN-BEGIN:|225-getter|2|
 
784
        return loadCmd;
 
785
    }
 
786
//</editor-fold>//GEN-END:|225-getter|2|
 
787
 
 
788
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadExitCmd ">//GEN-BEGIN:|227-getter|0|227-preInit
 
789
    /**
 
790
     * Returns an initialized instance of loadExitCmd component.
 
791
     *
 
792
     * @return the initialized component instance
 
793
     */
 
794
    public Command getLoadExitCmd() {
 
795
        if (loadExitCmd == null) {//GEN-END:|227-getter|0|227-preInit
 
796
            // write pre-init user code here
 
797
            loadExitCmd = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|227-getter|1|227-postInit
 
798
            // write post-init user code here
 
799
        }//GEN-BEGIN:|227-getter|2|
 
800
        return loadExitCmd;
 
801
    }
 
802
//</editor-fold>//GEN-END:|227-getter|2|
 
803
 
 
804
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsPage ">//GEN-BEGIN:|233-getter|0|233-preInit
 
805
    /**
 
806
     * Returns an initialized instance of settingsPage component.
 
807
     *
 
808
     * @return the initialized component instance
 
809
     */
 
810
    public Form getSettingsPage() {
 
811
        if (settingsPage == null) {//GEN-END:|233-getter|0|233-preInit
 
812
            // write pre-init user code here
 
813
            settingsPage = new Form(LocalizationSupport.getMessage("settingsPageTitle"), new Item[]{getPhone1Num(), getPhone2Num(), getPhone3Num()});//GEN-BEGIN:|233-getter|1|233-postInit
 
814
            settingsPage.addCommand(getSettingsCmd());
 
815
            settingsPage.addCommand(getSettingsBackCmd());
 
816
            settingsPage.setCommandListener(this);//GEN-END:|233-getter|1|233-postInit
 
817
            // write post-init user code here
 
818
        }//GEN-BEGIN:|233-getter|2|
 
819
        return settingsPage;
 
820
    }
 
821
//</editor-fold>//GEN-END:|233-getter|2|
 
822
 
 
823
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: questionImage ">//GEN-BEGIN:|241-getter|0|241-preInit
 
824
    /**
 
825
     * Returns an initialized instance of questionImage component.
 
826
     *
 
827
     * @return the initialized component instance
 
828
     */
 
829
    public ImageItem getQuestionImage() {
 
830
        if (questionImage == null) {//GEN-END:|241-getter|0|241-preInit
 
831
            // write pre-init user code here
 
832
            questionImage = new ImageItem("", getQuestion(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_2, "");//GEN-LINE:|241-getter|1|241-postInit
 
833
            // write post-init user code here
 
834
        }//GEN-BEGIN:|241-getter|2|
 
835
        return questionImage;
 
836
    }
 
837
//</editor-fold>//GEN-END:|241-getter|2|
 
838
 
 
839
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsCmd ">//GEN-BEGIN:|242-getter|0|242-preInit
 
840
    /**
 
841
     * Returns an initialized instance of settingsCmd component.
 
842
     *
 
843
     * @return the initialized component instance
 
844
     */
 
845
    public Command getSettingsCmd() {
 
846
        if (settingsCmd == null) {//GEN-END:|242-getter|0|242-preInit
 
847
            // write pre-init user code here
 
848
            settingsCmd = new Command("Save", Command.OK, 0);//GEN-LINE:|242-getter|1|242-postInit
 
849
            // write post-init user code here
 
850
        }//GEN-BEGIN:|242-getter|2|
 
851
        return settingsCmd;
 
852
    }
 
853
//</editor-fold>//GEN-END:|242-getter|2|
 
854
 
 
855
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsBackCmd ">//GEN-BEGIN:|245-getter|0|245-preInit
 
856
    /**
 
857
     * Returns an initialized instance of settingsBackCmd component.
 
858
     *
 
859
     * @return the initialized component instance
 
860
     */
 
861
    public Command getSettingsBackCmd() {
 
862
        if (settingsBackCmd == null) {//GEN-END:|245-getter|0|245-preInit
 
863
            // write pre-init user code here
 
864
            settingsBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|245-getter|1|245-postInit
 
865
            // write post-init user code here
 
866
        }//GEN-BEGIN:|245-getter|2|
 
867
        return settingsBackCmd;
 
868
    }
 
869
//</editor-fold>//GEN-END:|245-getter|2|
 
870
 
 
871
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone1Num ">//GEN-BEGIN:|248-getter|0|248-preInit
 
872
    /**
 
873
     * Returns an initialized instance of phone1Num component.
 
874
     *
 
875
     * @return the initialized component instance
 
876
     */
 
877
    public TextField getPhone1Num() {
 
878
        if (phone1Num == null) {//GEN-END:|248-getter|0|248-preInit
 
879
            String str = "";
 
880
            try {
 
881
                if (lastMsgStore.getRecord(1) != null) {
 
882
                    str = new String(lastMsgStore.getRecord(1));
 
883
                }
 
884
            } catch (RecordStoreException rsex) {
 
885
                rsex.printStackTrace();
 
886
            }
 
887
            phone1Num = new TextField(LocalizationSupport.getMessage("phone1Num"), str, 13, TextField.PHONENUMBER);//GEN-LINE:|248-getter|1|248-postInit
 
888
            // write post-init user code here
 
889
        }//GEN-BEGIN:|248-getter|2|
 
890
        return phone1Num;
 
891
    }
 
892
//</editor-fold>//GEN-END:|248-getter|2|
 
893
 
 
894
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone2Num ">//GEN-BEGIN:|249-getter|0|249-preInit
 
895
    /**
 
896
     * Returns an initialized instance of phone2Num component.
 
897
     *
 
898
     * @return the initialized component instance
 
899
     */
 
900
    public TextField getPhone2Num() {
 
901
        if (phone2Num == null) {//GEN-END:|249-getter|0|249-preInit
 
902
            String str = "";
 
903
            try {
 
904
                if (lastMsgStore.getRecord(2) != null) {
 
905
                    str = new String(lastMsgStore.getRecord(2));
 
906
                }
 
907
            } catch (RecordStoreException rsex) {
 
908
                rsex.printStackTrace();
 
909
            }
 
910
            phone2Num = new TextField(LocalizationSupport.getMessage("phone2Num"), str, 13, TextField.PHONENUMBER);//GEN-LINE:|249-getter|1|249-postInit
 
911
            // write post-init user code here
 
912
        }//GEN-BEGIN:|249-getter|2|
 
913
        return phone2Num;
 
914
    }
 
915
//</editor-fold>//GEN-END:|249-getter|2|
 
916
 
 
917
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone3Num ">//GEN-BEGIN:|250-getter|0|250-preInit
 
918
    /**
 
919
     * Returns an initialized instance of phone3Num component.
 
920
     *
 
921
     * @return the initialized component instance
 
922
     */
 
923
    public TextField getPhone3Num() {
 
924
        if (phone3Num == null) {//GEN-END:|250-getter|0|250-preInit
 
925
            String str = "";
 
926
            try {
 
927
                if (lastMsgStore.getRecord(3) != null) {
 
928
                    str = new String(lastMsgStore.getRecord(3));
 
929
                }
 
930
            } catch (RecordStoreException rsex) {
 
931
                rsex.printStackTrace();
 
932
            }
 
933
            phone3Num = new TextField(LocalizationSupport.getMessage("phone3Num"), str, 13, TextField.PHONENUMBER);//GEN-LINE:|250-getter|1|250-postInit
 
934
            // write post-init user code here
 
935
        }//GEN-BEGIN:|250-getter|2|
 
936
        return phone3Num;
 
937
    }
 
938
//</editor-fold>//GEN-END:|250-getter|2|
 
939
 
 
940
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendSettingsCmd ">//GEN-BEGIN:|254-getter|0|254-preInit
 
941
    /**
 
942
     * Returns an initialized instance of sendSettingsCmd component.
 
943
     *
 
944
     * @return the initialized component instance
 
945
     */
 
946
    public Command getSendSettingsCmd() {
 
947
        if (sendSettingsCmd == null) {//GEN-END:|254-getter|0|254-preInit
 
948
            // write pre-init user code here
 
949
            sendSettingsCmd = new Command("Settings", Command.OK, 0);//GEN-LINE:|254-getter|1|254-postInit
 
950
            // write post-init user code here
 
951
        }//GEN-BEGIN:|254-getter|2|
 
952
        return sendSettingsCmd;
 
953
    }
 
954
//</editor-fold>//GEN-END:|254-getter|2|
 
955
 
 
956
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthExitCmd ">//GEN-BEGIN:|458-getter|0|458-preInit
 
957
    /**
 
958
     * Returns an initialized instance of monthExitCmd component.
 
959
     *
 
960
     * @return the initialized component instance
 
961
     */
 
962
    public Command getMonthExitCmd() {
 
963
        if (monthExitCmd == null) {//GEN-END:|458-getter|0|458-preInit
 
964
            // write pre-init user code here
 
965
            monthExitCmd = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|458-getter|1|458-postInit
 
966
            // write post-init user code here
 
967
        }//GEN-BEGIN:|458-getter|2|
 
968
        return monthExitCmd;
 
969
    }
 
970
//</editor-fold>//GEN-END:|458-getter|2|
 
971
 
 
972
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendGPRSCommand ">//GEN-BEGIN:|463-getter|0|463-preInit
 
973
    /**
 
974
     * Returns an initialized instance of sendGPRSCommand component.
 
975
     *
 
976
     * @return the initialized component instance
 
977
     */
 
978
    public Command getSendGPRSCommand() {
 
979
        if (sendGPRSCommand == null) {//GEN-END:|463-getter|0|463-preInit
 
980
            // write pre-init user code here
 
981
            sendGPRSCommand = new Command("Send", Command.OK, 0);//GEN-LINE:|463-getter|1|463-postInit
 
982
            // write post-init user code here
 
983
        }//GEN-BEGIN:|463-getter|2|
 
984
        return sendGPRSCommand;
 
985
    }
 
986
//</editor-fold>//GEN-END:|463-getter|2|
 
987
 
 
988
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: antinatalcareCmd ">//GEN-BEGIN:|487-getter|0|487-preInit
 
989
    /**
 
990
     * Returns an initialized instance of antinatalcareCmd component.
 
991
     *
 
992
     * @return the initialized component instance
 
993
     */
 
994
    public Command getAntinatalcareCmd() {
 
995
        if (antinatalcareCmd == null) {//GEN-END:|487-getter|0|487-preInit
 
996
            // write pre-init user code here
 
997
            antinatalcareCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|487-getter|1|487-postInit
 
998
            // write post-init user code here
 
999
        }//GEN-BEGIN:|487-getter|2|
 
1000
        return antinatalcareCmd;
 
1001
    }
 
1002
//</editor-fold>//GEN-END:|487-getter|2|
 
1003
 
 
1004
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: antinatalcareBackCmd ">//GEN-BEGIN:|492-getter|0|492-preInit
 
1005
    /**
 
1006
     * Returns an initialized instance of antinatalcareBackCmd component.
 
1007
     *
 
1008
     * @return the initialized component instance
 
1009
     */
 
1010
    public Command getAntinatalcareBackCmd() {
 
1011
        if (antinatalcareBackCmd == null) {//GEN-END:|492-getter|0|492-preInit
 
1012
            // write pre-init user code here
 
1013
            antinatalcareBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|492-getter|1|492-postInit
 
1014
            // write post-init user code here
 
1015
        }//GEN-BEGIN:|492-getter|2|
 
1016
        return antinatalcareBackCmd;
 
1017
    }
 
1018
//</editor-fold>//GEN-END:|492-getter|2|
 
1019
 
 
1020
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Given ">//GEN-BEGIN:|507-getter|0|507-preInit
 
1021
    /**
 
1022
     * Returns an initialized instance of ANC_Given component.
 
1023
     *
 
1024
     * @return the initialized component instance
 
1025
     */
 
1026
    public TextField getANC_Given() {
 
1027
        if (ANC_Given == null) {//GEN-END:|507-getter|0|507-preInit
 
1028
            // write pre-init user code here
 
1029
            String str = "";
 
1030
            if (editingLastReport) {
 
1031
                try {
 
1032
                    if (lastMsgStore.getRecord(11) != null) {
 
1033
                        str = new String(lastMsgStore.getRecord(11));
 
1034
                    }
 
1035
 
 
1036
                } catch (RecordStoreException rsex) {
 
1037
                    rsex.printStackTrace();
 
1038
                }
 
1039
            }
 
1040
            ANC_Given = new TextField(LocalizationSupport.getMessage("ANC_Given"), str, 4, TextField.NUMERIC);//GEN-LINE:|507-getter|1|507-postInit
 
1041
            // write post-init user code here
 
1042
        }//GEN-BEGIN:|507-getter|2|
 
1043
        return ANC_Given;
 
1044
    }
 
1045
//</editor-fold>//GEN-END:|507-getter|2|
 
1046
 
 
1047
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Having ">//GEN-BEGIN:|508-getter|0|508-preInit
 
1048
    /**
 
1049
     * Returns an initialized instance of ANC_Having component.
 
1050
     *
 
1051
     * @return the initialized component instance
 
1052
     */
 
1053
    public TextField getANC_Having() {
 
1054
        if (ANC_Having == null) {//GEN-END:|508-getter|0|508-preInit
 
1055
            // write pre-init user code here
 
1056
            String str = "";
 
1057
            if (editingLastReport) {
 
1058
                try {
 
1059
                    if (lastMsgStore.getRecord(12) != null) {
 
1060
                        str = new String(lastMsgStore.getRecord(12));
 
1061
                    }
 
1062
 
 
1063
                } catch (RecordStoreException rsex) {
 
1064
                    rsex.printStackTrace();
 
1065
                }
 
1066
            }
 
1067
            ANC_Having = new TextField(LocalizationSupport.getMessage("ANC_Having"), str, 4, TextField.NUMERIC);//GEN-LINE:|508-getter|1|508-postInit
 
1068
            // write post-init user code here
 
1069
        }//GEN-BEGIN:|508-getter|2|
 
1070
        return ANC_Having;
 
1071
    }
 
1072
//</editor-fold>//GEN-END:|508-getter|2|
 
1073
 
 
1074
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Hypertension ">//GEN-BEGIN:|509-getter|0|509-preInit
 
1075
    /**
 
1076
     * Returns an initialized instance of ANC_Hypertension component.
 
1077
     *
 
1078
     * @return the initialized component instance
 
1079
     */
 
1080
    public TextField getANC_Hypertension() {
 
1081
        if (ANC_Hypertension == null) {//GEN-END:|509-getter|0|509-preInit
 
1082
            // write pre-init user code here
 
1083
            String str = "";
 
1084
            if (editingLastReport) {
 
1085
                try {
 
1086
                    if (lastMsgStore.getRecord(13) != null) {
 
1087
                        str = new String(lastMsgStore.getRecord(13));
 
1088
                    }
 
1089
 
 
1090
                } catch (RecordStoreException rsex) {
 
1091
                    rsex.printStackTrace();
 
1092
                }
 
1093
            }
 
1094
            ANC_Hypertension = new TextField(LocalizationSupport.getMessage("ANC_Hypertension"), str, 4, TextField.NUMERIC);//GEN-LINE:|509-getter|1|509-postInit
 
1095
            // write post-init user code here
 
1096
        }//GEN-BEGIN:|509-getter|2|
 
1097
        return ANC_Hypertension;
 
1098
    }
 
1099
//</editor-fold>//GEN-END:|509-getter|2|
 
1100
 
 
1101
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Registration ">//GEN-BEGIN:|510-getter|0|510-preInit
 
1102
    /**
 
1103
     * Returns an initialized instance of ANC_Registration component.
 
1104
     *
 
1105
     * @return the initialized component instance
 
1106
     */
 
1107
    public TextField getANC_Registration() {
 
1108
        if (ANC_Registration == null) {//GEN-END:|510-getter|0|510-preInit
 
1109
            // write pre-init user code here
 
1110
            String str = "";
 
1111
            if (editingLastReport) {
 
1112
                try {
 
1113
                    if (lastMsgStore.getRecord(14) != null) {
 
1114
                        str = new String(lastMsgStore.getRecord(14));
 
1115
                    }
 
1116
 
 
1117
                } catch (RecordStoreException rsex) {
 
1118
                    rsex.printStackTrace();
 
1119
                }
 
1120
            }
 
1121
            ANC_Registration = new TextField(LocalizationSupport.getMessage("ANC_Registration"), str, 4, TextField.NUMERIC);//GEN-LINE:|510-getter|1|510-postInit
 
1122
            // write post-init user code here
 
1123
        }//GEN-BEGIN:|510-getter|2|
 
1124
        return ANC_Registration;
 
1125
    }
 
1126
//</editor-fold>//GEN-END:|510-getter|2|
 
1127
 
 
1128
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_RegistrationWithin ">//GEN-BEGIN:|511-getter|0|511-preInit
 
1129
    /**
 
1130
     * Returns an initialized instance of ANC_RegistrationWithin component.
 
1131
     *
 
1132
     * @return the initialized component instance
 
1133
     */
 
1134
    public TextField getANC_RegistrationWithin() {
 
1135
        if (ANC_RegistrationWithin == null) {//GEN-END:|511-getter|0|511-preInit
 
1136
            // write pre-init user code here
 
1137
            String str = "";
 
1138
            if (editingLastReport) {
 
1139
                try {
 
1140
                    if (lastMsgStore.getRecord(15) != null) {
 
1141
                        str = new String(lastMsgStore.getRecord(15));
 
1142
                    }
 
1143
 
 
1144
                } catch (RecordStoreException rsex) {
 
1145
                    rsex.printStackTrace();
 
1146
                }
 
1147
            }
 
1148
            ANC_RegistrationWithin = new TextField(LocalizationSupport.getMessage("ANC_RegistrationWithin"), str, 4, TextField.NUMERIC);//GEN-LINE:|511-getter|1|511-postInit
 
1149
            // write post-init user code here
 
1150
        }//GEN-BEGIN:|511-getter|2|
 
1151
        return ANC_RegistrationWithin;
 
1152
    }
 
1153
//</editor-fold>//GEN-END:|511-getter|2|
 
1154
 
 
1155
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ThirdVisit ">//GEN-BEGIN:|512-getter|0|512-preInit
 
1156
    /**
 
1157
     * Returns an initialized instance of ANC_ThirdVisit component.
 
1158
     *
 
1159
     * @return the initialized component instance
 
1160
     */
 
1161
    public TextField getANC_ThirdVisit() {
 
1162
        if (ANC_ThirdVisit == null) {//GEN-END:|512-getter|0|512-preInit
 
1163
            // write pre-init user code here
 
1164
            String str = "";
 
1165
            if (editingLastReport) {
 
1166
                try {
 
1167
                    if (lastMsgStore.getRecord(16) != null) {
 
1168
                        str = new String(lastMsgStore.getRecord(16));
 
1169
                    }
 
1170
 
 
1171
                } catch (RecordStoreException rsex) {
 
1172
                    rsex.printStackTrace();
 
1173
                }
 
1174
            }
 
1175
            ANC_ThirdVisit = new TextField(LocalizationSupport.getMessage("ANC_ThirdVisit"), str, 4, TextField.NUMERIC);//GEN-LINE:|512-getter|1|512-postInit
 
1176
            // write post-init user code here
 
1177
        }//GEN-BEGIN:|512-getter|2|
 
1178
        return ANC_ThirdVisit;
 
1179
    }
 
1180
//</editor-fold>//GEN-END:|512-getter|2|
 
1181
 
 
1182
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_TT1 ">//GEN-BEGIN:|513-getter|0|513-preInit
 
1183
    /**
 
1184
     * Returns an initialized instance of ANC_TT1 component.
 
1185
     *
 
1186
     * @return the initialized component instance
 
1187
     */
 
1188
    public TextField getANC_TT1() {
 
1189
        if (ANC_TT1 == null) {//GEN-END:|513-getter|0|513-preInit
 
1190
            // write pre-init user code here
 
1191
            String str = "";
 
1192
            if (editingLastReport) {
 
1193
                try {
 
1194
                    if (lastMsgStore.getRecord(17) != null) {
 
1195
                        str = new String(lastMsgStore.getRecord(17));
 
1196
                    }
 
1197
 
 
1198
                } catch (RecordStoreException rsex) {
 
1199
                    rsex.printStackTrace();
 
1200
                }
 
1201
            }
 
1202
            ANC_TT1 = new TextField(LocalizationSupport.getMessage("ANC_TT1"), str, 4, TextField.NUMERIC);//GEN-LINE:|513-getter|1|513-postInit
 
1203
            // write post-init user code here
 
1204
        }//GEN-BEGIN:|513-getter|2|
 
1205
        return ANC_TT1;
 
1206
    }
 
1207
//</editor-fold>//GEN-END:|513-getter|2|
 
1208
 
 
1209
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_TT2 ">//GEN-BEGIN:|514-getter|0|514-preInit
 
1210
    /**
 
1211
     * Returns an initialized instance of ANC_TT2 component.
 
1212
     *
 
1213
     * @return the initialized component instance
 
1214
     */
 
1215
    public TextField getANC_TT2() {
 
1216
        if (ANC_TT2 == null) {//GEN-END:|514-getter|0|514-preInit
 
1217
            // write pre-init user code here
 
1218
            String str = "";
 
1219
            if (editingLastReport) {
 
1220
                try {
 
1221
                    if (lastMsgStore.getRecord(18) != null) {
 
1222
                        str = new String(lastMsgStore.getRecord(18));
 
1223
                    }
 
1224
 
 
1225
                } catch (RecordStoreException rsex) {
 
1226
                    rsex.printStackTrace();
 
1227
                }
 
1228
            }
 
1229
            ANC_TT2 = new TextField(LocalizationSupport.getMessage("ANC_TT2"), str, 4, TextField.NUMERIC);//GEN-LINE:|514-getter|1|514-postInit
 
1230
            // write post-init user code here
 
1231
        }//GEN-BEGIN:|514-getter|2|
 
1232
        return ANC_TT2;
 
1233
    }
 
1234
//</editor-fold>//GEN-END:|514-getter|2|
 
1235
 
 
1236
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: freqGroup ">//GEN-BEGIN:|517-getter|0|517-preInit
 
1237
    /**
 
1238
     * Returns an initialized instance of freqGroup component.
 
1239
     *
 
1240
     * @return the initialized component instance
 
1241
     */
 
1242
    public ChoiceGroup getFreqGroup() {
 
1243
        if (freqGroup == null) {//GEN-END:|517-getter|0|517-preInit
 
1244
            // write pre-init user code here
 
1245
            freqGroup = new ChoiceGroup(LocalizationSupport.getMessage("freq"), Choice.POPUP);//GEN-BEGIN:|517-getter|1|517-postInit
 
1246
            freqGroup.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | Item.LAYOUT_2);//GEN-END:|517-getter|1|517-postInit
 
1247
            // write post-init user code here
 
1248
            try {
 
1249
                   String[] freqNames = {
 
1250
                        "Monthly"
 
1251
                    };
 
1252
 
 
1253
                    for (int i = 0; i < freqNames.length; i++) {
 
1254
                        freqGroup.append(freqNames[i], null);
 
1255
                    }
 
1256
 
 
1257
                    if (editingLastReport) {
 
1258
                        if (lastMsgStore.getRecord(7) != null) {
 
1259
                            int index = 0;
 
1260
                            for(index = 0; index < freqGroup.size(); index++)
 
1261
                            {       
 
1262
                                if(freqGroup.getString(index).equalsIgnoreCase(new String(lastMsgStore.getRecord(7)))){
 
1263
                                    break;
 
1264
                                }
 
1265
                            }
 
1266
                            freqGroup.setSelectedIndex(index, true); // need the last report value
 
1267
                        }
 
1268
                    } else {
 
1269
                        freqGroup.setSelectedIndex(0, true); // If not need the value of the last report
 
1270
                    }
 
1271
                } catch (RecordStoreException rsex) {
 
1272
                    rsex.printStackTrace();
 
1273
                }
 
1274
        }//GEN-BEGIN:|517-getter|2|
 
1275
        return freqGroup;
 
1276
    }
 
1277
//</editor-fold>//GEN-END:|517-getter|2|
 
1278
 
 
1279
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Antinatalcare ">//GEN-BEGIN:|473-getter|0|473-preInit
 
1280
    /**
 
1281
     * Returns an initialized instance of Antinatalcare component.
 
1282
     *
 
1283
     * @return the initialized component instance
 
1284
     */
 
1285
    public Form getAntinatalcare() {
 
1286
        if (Antinatalcare == null) {//GEN-END:|473-getter|0|473-preInit
 
1287
            // write pre-init user code here
 
1288
            Antinatalcare = new Form("DHIS Form", new Item[]{getANC_Given(), getANC_Having(), getANC_Hypertension(), getANC_Registration(), getANC_RegistrationWithin(), getANC_ThirdVisit(), getANC_TT1(), getANC_TT2()});//GEN-BEGIN:|473-getter|1|473-postInit
 
1289
            Antinatalcare.addCommand(getAntinatalcareCmd());
 
1290
            Antinatalcare.addCommand(getAntinatalcareBackCmd());
 
1291
            Antinatalcare.setCommandListener(this);//GEN-END:|473-getter|1|473-postInit
 
1292
            // write post-init user code here
 
1293
        }//GEN-BEGIN:|473-getter|2|
 
1294
        return Antinatalcare;
 
1295
    }
 
1296
//</editor-fold>//GEN-END:|473-getter|2|
 
1297
 
 
1298
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Services ">//GEN-BEGIN:|518-getter|0|518-preInit
 
1299
    /**
 
1300
     * Returns an initialized instance of ANC_Services component.
 
1301
     *
 
1302
     * @return the initialized component instance
 
1303
     */
 
1304
    public Form getANC_Services() {
 
1305
        if (ANC_Services == null) {//GEN-END:|518-getter|0|518-preInit
 
1306
            // write pre-init user code here
 
1307
            ANC_Services = new Form("ANC Services", new Item[]{getTextField(), getTextField1(), getTextField2(), getTextField3(), getTextField4(), getTextField5(), getTextField6(), getTextField7(), getTextField8()});//GEN-BEGIN:|518-getter|1|518-postInit
 
1308
            ANC_Services.addCommand(getANC_ServicesBackCmd());
 
1309
            ANC_Services.addCommand(getANC_ServicesCmd());
 
1310
            ANC_Services.setCommandListener(this);//GEN-END:|518-getter|1|518-postInit
 
1311
            // write post-init user code here
 
1312
        }//GEN-BEGIN:|518-getter|2|
 
1313
        return ANC_Services;
 
1314
    }
 
1315
//</editor-fold>//GEN-END:|518-getter|2|
 
1316
 
 
1317
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ServicesBackCmd ">//GEN-BEGIN:|519-getter|0|519-preInit
 
1318
    /**
 
1319
     * Returns an initialized instance of ANC_ServicesBackCmd component.
 
1320
     *
 
1321
     * @return the initialized component instance
 
1322
     */
 
1323
    public Command getANC_ServicesBackCmd() {
 
1324
        if (ANC_ServicesBackCmd == null) {//GEN-END:|519-getter|0|519-preInit
 
1325
            // write pre-init user code here
 
1326
            ANC_ServicesBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|519-getter|1|519-postInit
 
1327
            // write post-init user code here
 
1328
        }//GEN-BEGIN:|519-getter|2|
 
1329
        return ANC_ServicesBackCmd;
 
1330
    }
 
1331
//</editor-fold>//GEN-END:|519-getter|2|
 
1332
 
 
1333
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ServicesCmd ">//GEN-BEGIN:|521-getter|0|521-preInit
 
1334
    /**
 
1335
     * Returns an initialized instance of ANC_ServicesCmd component.
 
1336
     *
 
1337
     * @return the initialized component instance
 
1338
     */
 
1339
    public Command getANC_ServicesCmd() {
 
1340
        if (ANC_ServicesCmd == null) {//GEN-END:|521-getter|0|521-preInit
 
1341
            // write pre-init user code here
 
1342
            ANC_ServicesCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|521-getter|1|521-postInit
 
1343
            // write post-init user code here
 
1344
        }//GEN-BEGIN:|521-getter|2|
 
1345
        return ANC_ServicesCmd;
 
1346
    }
 
1347
//</editor-fold>//GEN-END:|521-getter|2|
 
1348
 
 
1349
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField ">//GEN-BEGIN:|524-getter|0|524-preInit
 
1350
    /**
 
1351
     * Returns an initialized instance of textField component.
 
1352
     *
 
1353
     * @return the initialized component instance
 
1354
     */
 
1355
    public TextField getTextField() {
 
1356
        if (textField == null) {//GEN-END:|524-getter|0|524-preInit
 
1357
            // write pre-init user code here
 
1358
            String str = getRecordValue(11);
 
1359
            textField = new TextField(LocalizationSupport.getMessage("Total_no."), str, 4, TextField.NUMERIC);//GEN-LINE:|524-getter|1|524-postInit
 
1360
            // write post-init user code here
 
1361
        }//GEN-BEGIN:|524-getter|2|
 
1362
        return textField;
 
1363
    }
 
1364
//</editor-fold>//GEN-END:|524-getter|2|
 
1365
 
 
1366
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField1 ">//GEN-BEGIN:|525-getter|0|525-preInit
 
1367
    /**
 
1368
     * Returns an initialized instance of textField1 component.
 
1369
     *
 
1370
     * @return the initialized component instance
 
1371
     */
 
1372
    public TextField getTextField1() {
 
1373
        if (textField1 == null) {//GEN-END:|525-getter|0|525-preInit
 
1374
            // write pre-init user code here
 
1375
            String str = getRecordValue(36); //  because my mistake on missing register the record for this textField
 
1376
            textField1 = new TextField(LocalizationSupport.getMessage("Of_Which"), str, 4, TextField.NUMERIC);//GEN-LINE:|525-getter|1|525-postInit
 
1377
            // write post-init user code here
 
1378
        }//GEN-BEGIN:|525-getter|2|
 
1379
        return textField1;
 
1380
    }
 
1381
//</editor-fold>//GEN-END:|525-getter|2|
 
1382
 
 
1383
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField2 ">//GEN-BEGIN:|526-getter|0|526-preInit
 
1384
    /**
 
1385
     * Returns an initialized instance of textField2 component.
 
1386
     *
 
1387
     * @return the initialized component instance
 
1388
     */
 
1389
    public TextField getTextField2() {
 
1390
        if (textField2 == null) {//GEN-END:|526-getter|0|526-preInit
 
1391
            // write pre-init user code here
 
1392
            String str = getRecordValue(12);
 
1393
            textField2 = new TextField(LocalizationSupport.getMessage("New_woman"), str, 4, TextField.NUMERIC);//GEN-LINE:|526-getter|1|526-postInit
 
1394
            // write post-init user code here
 
1395
        }//GEN-BEGIN:|526-getter|2|
 
1396
        return textField2;
 
1397
    }
 
1398
//</editor-fold>//GEN-END:|526-getter|2|
 
1399
 
 
1400
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField3 ">//GEN-BEGIN:|527-getter|0|527-preInit
 
1401
    /**
 
1402
     * Returns an initialized instance of textField3 component.
 
1403
     *
 
1404
     * @return the initialized component instance
 
1405
     */
 
1406
    public TextField getTextField3() {
 
1407
        if (textField3 == null) {//GEN-END:|527-getter|0|527-preInit
 
1408
            // write pre-init user code here
 
1409
            String str = getRecordValue(13);
 
1410
            textField3 = new TextField(LocalizationSupport.getMessage("Women_received"), str, 4, TextField.NUMERIC);//GEN-LINE:|527-getter|1|527-postInit
 
1411
            // write post-init user code here
 
1412
        }//GEN-BEGIN:|527-getter|2|
 
1413
        return textField3;
 
1414
    }
 
1415
//</editor-fold>//GEN-END:|527-getter|2|
 
1416
 
 
1417
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField4 ">//GEN-BEGIN:|528-getter|0|528-preInit
 
1418
    /**
 
1419
     * Returns an initialized instance of textField4 component.
 
1420
     *
 
1421
     * @return the initialized component instance
 
1422
     */
 
1423
    public TextField getTextField4() {
 
1424
        if (textField4 == null) {//GEN-END:|528-getter|0|528-preInit
 
1425
            // write pre-init user code here
 
1426
            String str = getRecordValue(14);
 
1427
            textField4 = new TextField(LocalizationSupport.getMessage("TT1"), str, 4, TextField.NUMERIC);//GEN-LINE:|528-getter|1|528-postInit
 
1428
            // write post-init user code here
 
1429
        }//GEN-BEGIN:|528-getter|2|
 
1430
        return textField4;
 
1431
    }
 
1432
//</editor-fold>//GEN-END:|528-getter|2|
 
1433
 
 
1434
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField5 ">//GEN-BEGIN:|529-getter|0|529-preInit
 
1435
    /**
 
1436
     * Returns an initialized instance of textField5 component.
 
1437
     *
 
1438
     * @return the initialized component instance
 
1439
     */
 
1440
    public TextField getTextField5() {
 
1441
        if (textField5 == null) {//GEN-END:|529-getter|0|529-preInit
 
1442
            // write pre-init user code here
 
1443
            String str = getRecordValue(15);
 
1444
            textField5 = new TextField(LocalizationSupport.getMessage("TT2"), str, 4, TextField.NUMERIC);//GEN-LINE:|529-getter|1|529-postInit
 
1445
            // write post-init user code here
 
1446
        }//GEN-BEGIN:|529-getter|2|
 
1447
        return textField5;
 
1448
    }
 
1449
//</editor-fold>//GEN-END:|529-getter|2|
 
1450
 
 
1451
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField6 ">//GEN-BEGIN:|530-getter|0|530-preInit
 
1452
    /**
 
1453
     * Returns an initialized instance of textField6 component.
 
1454
     *
 
1455
     * @return the initialized component instance
 
1456
     */
 
1457
    public TextField getTextField6() {
 
1458
        if (textField6 == null) {//GEN-END:|530-getter|0|530-preInit
 
1459
            // write pre-init user code here
 
1460
            String str = getRecordValue(16);
 
1461
            textField6 = new TextField(LocalizationSupport.getMessage("No.of_Women"), str, 4, TextField.NUMERIC);//GEN-LINE:|530-getter|1|530-postInit
 
1462
            // write post-init user code here
 
1463
        }//GEN-BEGIN:|530-getter|2|
 
1464
        return textField6;
 
1465
    }
 
1466
//</editor-fold>//GEN-END:|530-getter|2|
 
1467
 
 
1468
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField7 ">//GEN-BEGIN:|531-getter|0|531-preInit
 
1469
    /**
 
1470
     * Returns an initialized instance of textField7 component.
 
1471
     *
 
1472
     * @return the initialized component instance
 
1473
     */
 
1474
    public TextField getTextField7() {
 
1475
        if (textField7 == null) {//GEN-END:|531-getter|0|531-preInit
 
1476
            // write pre-init user code here
 
1477
            String str = getRecordValue(17);
 
1478
            textField7 = new TextField(LocalizationSupport.getMessage("New_Hypertension"), str, 4, TextField.NUMERIC);//GEN-LINE:|531-getter|1|531-postInit
 
1479
            // write post-init user code here
 
1480
        }//GEN-BEGIN:|531-getter|2|
 
1481
        return textField7;
 
1482
    }
 
1483
//</editor-fold>//GEN-END:|531-getter|2|
 
1484
 
 
1485
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField8 ">//GEN-BEGIN:|532-getter|0|532-preInit
 
1486
    /**
 
1487
     * Returns an initialized instance of textField8 component.
 
1488
     *
 
1489
     * @return the initialized component instance
 
1490
     */
 
1491
    public TextField getTextField8() {
 
1492
        if (textField8 == null) {//GEN-END:|532-getter|0|532-preInit
 
1493
            // write pre-init user code here
 
1494
            String str = getRecordValue(18);
 
1495
            textField8 = new TextField(LocalizationSupport.getMessage("Hb_level"), str, 4, TextField.NUMERIC);//GEN-LINE:|532-getter|1|532-postInit
 
1496
            // write post-init user code here
 
1497
        }//GEN-BEGIN:|532-getter|2|
 
1498
        return textField8;
 
1499
    }
 
1500
//</editor-fold>//GEN-END:|532-getter|2|
 
1501
 
 
1502
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Deliveries ">//GEN-BEGIN:|533-getter|0|533-preInit
 
1503
    /**
 
1504
     * Returns an initialized instance of Deliveries component.
 
1505
     *
 
1506
     * @return the initialized component instance
 
1507
     */
 
1508
    public Form getDeliveries() {
 
1509
        if (Deliveries == null) {//GEN-END:|533-getter|0|533-preInit
 
1510
            // write pre-init user code here
 
1511
            Deliveries = new Form("Deliveries", new Item[]{getStringItem(), getTextField9(), getTextField10(), getTextField11(), getTextField12()});//GEN-BEGIN:|533-getter|1|533-postInit
 
1512
            Deliveries.addCommand(getDeliveriesBackCmd());
 
1513
            Deliveries.addCommand(getDeliveriesCmd());
 
1514
            Deliveries.setCommandListener(this);//GEN-END:|533-getter|1|533-postInit
 
1515
            // write post-init user code here
 
1516
        }//GEN-BEGIN:|533-getter|2|
 
1517
        return Deliveries;
 
1518
    }
 
1519
//</editor-fold>//GEN-END:|533-getter|2|
 
1520
 
 
1521
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|541-getter|0|541-preInit
 
1522
    /**
 
1523
     * Returns an initialized instance of stringItem component.
 
1524
     *
 
1525
     * @return the initialized component instance
 
1526
     */
 
1527
    public StringItem getStringItem() {
 
1528
        if (stringItem == null) {//GEN-END:|541-getter|0|541-preInit
 
1529
            // write pre-init user code here
 
1530
            stringItem = new StringItem(LocalizationSupport.getMessage("Home_Deliveries"), null, Item.PLAIN);//GEN-BEGIN:|541-getter|1|541-postInit
 
1531
            stringItem.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | Item.LAYOUT_2);//GEN-END:|541-getter|1|541-postInit
 
1532
            // write post-init user code here
 
1533
        }//GEN-BEGIN:|541-getter|2|
 
1534
        return stringItem;
 
1535
    }
 
1536
//</editor-fold>//GEN-END:|541-getter|2|
 
1537
 
 
1538
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: DeliveriesBackCmd ">//GEN-BEGIN:|534-getter|0|534-preInit
 
1539
    /**
 
1540
     * Returns an initialized instance of DeliveriesBackCmd component.
 
1541
     *
 
1542
     * @return the initialized component instance
 
1543
     */
 
1544
    public Command getDeliveriesBackCmd() {
 
1545
        if (DeliveriesBackCmd == null) {//GEN-END:|534-getter|0|534-preInit
 
1546
            // write pre-init user code here
 
1547
            DeliveriesBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|534-getter|1|534-postInit
 
1548
            // write post-init user code here
 
1549
        }//GEN-BEGIN:|534-getter|2|
 
1550
        return DeliveriesBackCmd;
 
1551
    }
 
1552
//</editor-fold>//GEN-END:|534-getter|2|
 
1553
 
 
1554
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: DeliveriesCmd ">//GEN-BEGIN:|536-getter|0|536-preInit
 
1555
    /**
 
1556
     * Returns an initialized instance of DeliveriesCmd component.
 
1557
     *
 
1558
     * @return the initialized component instance
 
1559
     */
 
1560
    public Command getDeliveriesCmd() {
 
1561
        if (DeliveriesCmd == null) {//GEN-END:|536-getter|0|536-preInit
 
1562
            // write pre-init user code here
 
1563
            DeliveriesCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|536-getter|1|536-postInit
 
1564
            // write post-init user code here
 
1565
        }//GEN-BEGIN:|536-getter|2|
 
1566
        return DeliveriesCmd;
 
1567
    }
 
1568
//</editor-fold>//GEN-END:|536-getter|2|
 
1569
 
 
1570
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField9 ">//GEN-BEGIN:|542-getter|0|542-preInit
 
1571
    /**
 
1572
     * Returns an initialized instance of textField9 component.
 
1573
     *
 
1574
     * @return the initialized component instance
 
1575
     */
 
1576
    public TextField getTextField9() {
 
1577
        if (textField9 == null) {//GEN-END:|542-getter|0|542-preInit
 
1578
            // write pre-init user code here
 
1579
            String str = getRecordValue(19);
 
1580
            textField9 = new TextField(LocalizationSupport.getMessage("SBA"), str, 4, TextField.NUMERIC);//GEN-LINE:|542-getter|1|542-postInit
 
1581
            // write post-init user code here
 
1582
        }//GEN-BEGIN:|542-getter|2|
 
1583
        return textField9;
 
1584
    }
 
1585
//</editor-fold>//GEN-END:|542-getter|2|
 
1586
 
 
1587
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField10 ">//GEN-BEGIN:|543-getter|0|543-preInit
 
1588
    /**
 
1589
     * Returns an initialized instance of textField10 component.
 
1590
     *
 
1591
     * @return the initialized component instance
 
1592
     */
 
1593
    public TextField getTextField10() {
 
1594
        if (textField10 == null) {//GEN-END:|543-getter|0|543-preInit
 
1595
            // write pre-init user code here
 
1596
            String str = getRecordValue(20);
 
1597
            textField10 = new TextField(LocalizationSupport.getMessage("Non_SBA"), str, 4, TextField.NUMERIC);//GEN-LINE:|543-getter|1|543-postInit
 
1598
            // write post-init user code here
 
1599
        }//GEN-BEGIN:|543-getter|2|
 
1600
        return textField10;
 
1601
    }
 
1602
//</editor-fold>//GEN-END:|543-getter|2|
 
1603
 
 
1604
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField11 ">//GEN-BEGIN:|544-getter|0|544-preInit
 
1605
    /**
 
1606
     * Returns an initialized instance of textField11 component.
 
1607
     *
 
1608
     * @return the initialized component instance
 
1609
     */
 
1610
    public TextField getTextField11() {
 
1611
        if (textField11 == null) {//GEN-END:|544-getter|0|544-preInit
 
1612
            // write pre-init user code here
 
1613
            String str = getRecordValue(21);
 
1614
            textField11 = new TextField(LocalizationSupport.getMessage("Newborns"), str, 4, TextField.NUMERIC);//GEN-LINE:|544-getter|1|544-postInit
 
1615
            // write post-init user code here
 
1616
        }//GEN-BEGIN:|544-getter|2|
 
1617
        return textField11;
 
1618
    }
 
1619
//</editor-fold>//GEN-END:|544-getter|2|
 
1620
 
 
1621
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField12 ">//GEN-BEGIN:|545-getter|0|545-preInit
 
1622
    /**
 
1623
     * Returns an initialized instance of textField12 component.
 
1624
     *
 
1625
     * @return the initialized component instance
 
1626
     */
 
1627
    public TextField getTextField12() {
 
1628
        if (textField12 == null) {//GEN-END:|545-getter|0|545-preInit
 
1629
            // write pre-init user code here
 
1630
            String str = getRecordValue(22);
 
1631
            textField12 = new TextField(LocalizationSupport.getMessage("Mothers_Paid_JSY"), str, 4, TextField.NUMERIC);//GEN-LINE:|545-getter|1|545-postInit
 
1632
            // write post-init user code here
 
1633
        }//GEN-BEGIN:|545-getter|2|
 
1634
        return textField12;
 
1635
    }
 
1636
//</editor-fold>//GEN-END:|545-getter|2|
 
1637
 
 
1638
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: InstitutionalDeliveries ">//GEN-BEGIN:|546-getter|0|546-preInit
 
1639
    /**
 
1640
     * Returns an initialized instance of InstitutionalDeliveries component.
 
1641
     *
 
1642
     * @return the initialized component instance
 
1643
     */
 
1644
    public Form getInstitutionalDeliveries() {
 
1645
        if (InstitutionalDeliveries == null) {//GEN-END:|546-getter|0|546-preInit
 
1646
            // write pre-init user code here
 
1647
            InstitutionalDeliveries = new Form("Institutional Deliveries", new Item[]{getTextField13(), getTextField14(), getTextField15(), getTextField16()});//GEN-BEGIN:|546-getter|1|546-postInit
 
1648
            InstitutionalDeliveries.addCommand(getInstitutionaldeliveriesBackCmd());
 
1649
            InstitutionalDeliveries.addCommand(getInstitutionaldeliveriesCmd());
 
1650
            InstitutionalDeliveries.setCommandListener(this);//GEN-END:|546-getter|1|546-postInit
 
1651
            // write post-init user code here
 
1652
        }//GEN-BEGIN:|546-getter|2|
 
1653
        return InstitutionalDeliveries;
 
1654
    }
 
1655
//</editor-fold>//GEN-END:|546-getter|2|
 
1656
 
 
1657
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField13 ">//GEN-BEGIN:|553-getter|0|553-preInit
 
1658
    /**
 
1659
     * Returns an initialized instance of textField13 component.
 
1660
     *
 
1661
     * @return the initialized component instance
 
1662
     */
 
1663
    public TextField getTextField13() {
 
1664
        if (textField13 == null) {//GEN-END:|553-getter|0|553-preInit
 
1665
            // write pre-init user code here
 
1666
            String str = getRecordValue(23);
 
1667
            textField13 = new TextField(LocalizationSupport.getMessage("Deliveries_at"), str, 4, TextField.NUMERIC);//GEN-LINE:|553-getter|1|553-postInit
 
1668
            // write post-init user code here
 
1669
        }//GEN-BEGIN:|553-getter|2|
 
1670
        return textField13;
 
1671
    }
 
1672
//</editor-fold>//GEN-END:|553-getter|2|
 
1673
 
 
1674
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField14 ">//GEN-BEGIN:|554-getter|0|554-preInit
 
1675
    /**
 
1676
     * Returns an initialized instance of textField14 component.
 
1677
     *
 
1678
     * @return the initialized component instance
 
1679
     */
 
1680
    public TextField getTextField14() {
 
1681
        if (textField14 == null) {//GEN-END:|554-getter|0|554-preInit
 
1682
            // write pre-init user code here
 
1683
            String str = getRecordValue(24);
 
1684
            textField14 = new TextField(LocalizationSupport.getMessage("Discharged_under"), str, 4, TextField.NUMERIC);//GEN-BEGIN:|554-getter|1|554-postInit
 
1685
//GEN-END:|554-getter|1|554-postInit
 
1686
            // write post-init user code here
 
1687
        }//GEN-BEGIN:|554-getter|2|
 
1688
        return textField14;
 
1689
    }
 
1690
//</editor-fold>//GEN-END:|554-getter|2|
 
1691
 
 
1692
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField15 ">//GEN-BEGIN:|555-getter|0|555-preInit
 
1693
    /**
 
1694
     * Returns an initialized instance of textField15 component.
 
1695
     *
 
1696
     * @return the initialized component instance
 
1697
     */
 
1698
    public TextField getTextField15() {
 
1699
        if (textField15 == null) {//GEN-END:|555-getter|0|555-preInit
 
1700
            // write pre-init user code here
 
1701
            String str = getRecordValue(25);
 
1702
            textField15 = new TextField(LocalizationSupport.getMessage("JSY_Mothers"), str, 4, TextField.NUMERIC);//GEN-BEGIN:|555-getter|1|555-postInit
 
1703
//GEN-END:|555-getter|1|555-postInit
 
1704
            // write post-init user code here
 
1705
        }//GEN-BEGIN:|555-getter|2|
 
1706
        return textField15;
 
1707
    }
 
1708
//</editor-fold>//GEN-END:|555-getter|2|
 
1709
 
 
1710
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField16 ">//GEN-BEGIN:|556-getter|0|556-preInit
 
1711
    /**
 
1712
     * Returns an initialized instance of textField16 component.
 
1713
     *
 
1714
     * @return the initialized component instance
 
1715
     */
 
1716
    public TextField getTextField16() {
 
1717
        if (textField16 == null) {//GEN-END:|556-getter|0|556-preInit
 
1718
            // write pre-init user code here
 
1719
            String str = getRecordValue(26);
 
1720
            textField16 = new TextField(LocalizationSupport.getMessage("JSY_AWW"), str, 4, TextField.NUMERIC);//GEN-BEGIN:|556-getter|1|556-postInit
 
1721
//GEN-END:|556-getter|1|556-postInit
 
1722
            // write post-init user code here
 
1723
        }//GEN-BEGIN:|556-getter|2|
 
1724
        return textField16;
 
1725
    }
 
1726
//</editor-fold>//GEN-END:|556-getter|2|
 
1727
 
 
1728
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Pregnancyoutcome ">//GEN-BEGIN:|557-getter|0|557-preInit
 
1729
    /**
 
1730
     * Returns an initialized instance of Pregnancyoutcome component.
 
1731
     *
 
1732
     * @return the initialized component instance
 
1733
     */
 
1734
    public Form getPregnancyoutcome() {
 
1735
        if (Pregnancyoutcome == null) {//GEN-END:|557-getter|0|557-preInit
 
1736
            // write pre-init user code here
 
1737
            Pregnancyoutcome = new Form("Pregnancy outcome", new Item[]{getTextField17(), getTextField18(), getTextField19(), getTextField20()});//GEN-BEGIN:|557-getter|1|557-postInit
 
1738
            Pregnancyoutcome.addCommand(getPregnancyoutcomeBackCmd());
 
1739
            Pregnancyoutcome.addCommand(getPregnancyoutcomeCmd());
 
1740
            Pregnancyoutcome.setCommandListener(this);//GEN-END:|557-getter|1|557-postInit
 
1741
            // write post-init user code here
 
1742
        }//GEN-BEGIN:|557-getter|2|
 
1743
        return Pregnancyoutcome;
 
1744
    }
 
1745
//</editor-fold>//GEN-END:|557-getter|2|
 
1746
 
 
1747
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: institutionaldeliveriesBackCmd ">//GEN-BEGIN:|547-getter|0|547-preInit
 
1748
    /**
 
1749
     * Returns an initialized instance of institutionaldeliveriesBackCmd
 
1750
     * component.
 
1751
     *
 
1752
     * @return the initialized component instance
 
1753
     */
 
1754
    public Command getInstitutionaldeliveriesBackCmd() {
 
1755
        if (institutionaldeliveriesBackCmd == null) {//GEN-END:|547-getter|0|547-preInit
 
1756
            // write pre-init user code here
 
1757
            institutionaldeliveriesBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|547-getter|1|547-postInit
 
1758
            // write post-init user code here
 
1759
        }//GEN-BEGIN:|547-getter|2|
 
1760
        return institutionaldeliveriesBackCmd;
 
1761
    }
 
1762
//</editor-fold>//GEN-END:|547-getter|2|
 
1763
 
 
1764
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: institutionaldeliveriesCmd ">//GEN-BEGIN:|549-getter|0|549-preInit
 
1765
    /**
 
1766
     * Returns an initialized instance of institutionaldeliveriesCmd component.
 
1767
     *
 
1768
     * @return the initialized component instance
 
1769
     */
 
1770
    public Command getInstitutionaldeliveriesCmd() {
 
1771
        if (institutionaldeliveriesCmd == null) {//GEN-END:|549-getter|0|549-preInit
 
1772
            // write pre-init user code here
 
1773
            institutionaldeliveriesCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|549-getter|1|549-postInit
 
1774
            // write post-init user code here
 
1775
        }//GEN-BEGIN:|549-getter|2|
 
1776
        return institutionaldeliveriesCmd;
 
1777
    }
 
1778
//</editor-fold>//GEN-END:|549-getter|2|
 
1779
 
 
1780
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: pregnancyoutcomeBackCmd ">//GEN-BEGIN:|558-getter|0|558-preInit
 
1781
    /**
 
1782
     * Returns an initialized instance of pregnancyoutcomeBackCmd component.
 
1783
     *
 
1784
     * @return the initialized component instance
 
1785
     */
 
1786
    public Command getPregnancyoutcomeBackCmd() {
 
1787
        if (pregnancyoutcomeBackCmd == null) {//GEN-END:|558-getter|0|558-preInit
 
1788
            // write pre-init user code here
 
1789
            pregnancyoutcomeBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|558-getter|1|558-postInit
 
1790
            // write post-init user code here
 
1791
        }//GEN-BEGIN:|558-getter|2|
 
1792
        return pregnancyoutcomeBackCmd;
 
1793
    }
 
1794
//</editor-fold>//GEN-END:|558-getter|2|
 
1795
 
 
1796
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: pregnancyoutcomeCmd ">//GEN-BEGIN:|560-getter|0|560-preInit
 
1797
    /**
 
1798
     * Returns an initialized instance of pregnancyoutcomeCmd component.
 
1799
     *
 
1800
     * @return the initialized component instance
 
1801
     */
 
1802
    public Command getPregnancyoutcomeCmd() {
 
1803
        if (pregnancyoutcomeCmd == null) {//GEN-END:|560-getter|0|560-preInit
 
1804
            // write pre-init user code here
 
1805
            pregnancyoutcomeCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|560-getter|1|560-postInit
 
1806
            // write post-init user code here
 
1807
        }//GEN-BEGIN:|560-getter|2|
 
1808
        return pregnancyoutcomeCmd;
 
1809
    }
 
1810
//</editor-fold>//GEN-END:|560-getter|2|
 
1811
 
 
1812
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField17 ">//GEN-BEGIN:|564-getter|0|564-preInit
 
1813
    /**
 
1814
     * Returns an initialized instance of textField17 component.
 
1815
     *
 
1816
     * @return the initialized component instance
 
1817
     */
 
1818
    public TextField getTextField17() {
 
1819
        if (textField17 == null) {//GEN-END:|564-getter|0|564-preInit
 
1820
            // write pre-init user code here
 
1821
            String str = getRecordValue(27);
 
1822
            textField17 = new TextField(LocalizationSupport.getMessage("Live_BirthM"), str, 4, TextField.NUMERIC);//GEN-LINE:|564-getter|1|564-postInit
 
1823
            // write post-init user code here
 
1824
        }//GEN-BEGIN:|564-getter|2|
 
1825
        return textField17;
 
1826
    }
 
1827
//</editor-fold>//GEN-END:|564-getter|2|
 
1828
 
 
1829
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField18 ">//GEN-BEGIN:|565-getter|0|565-preInit
 
1830
    /**
 
1831
     * Returns an initialized instance of textField18 component.
 
1832
     *
 
1833
     * @return the initialized component instance
 
1834
     */
 
1835
    public TextField getTextField18() {
 
1836
        if (textField18 == null) {//GEN-END:|565-getter|0|565-preInit
 
1837
            // write pre-init user code here
 
1838
            String str = getRecordValue(28);
 
1839
            textField18 = new TextField(LocalizationSupport.getMessage("Live_BirthF"), str, 4, TextField.NUMERIC);//GEN-LINE:|565-getter|1|565-postInit
 
1840
            // write post-init user code here
 
1841
        }//GEN-BEGIN:|565-getter|2|
 
1842
        return textField18;
 
1843
    }
 
1844
//</editor-fold>//GEN-END:|565-getter|2|
 
1845
 
 
1846
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField19 ">//GEN-BEGIN:|566-getter|0|566-preInit
 
1847
    /**
 
1848
     * Returns an initialized instance of textField19 component.
 
1849
     *
 
1850
     * @return the initialized component instance
 
1851
     */
 
1852
    public TextField getTextField19() {
 
1853
        if (textField19 == null) {//GEN-END:|566-getter|0|566-preInit
 
1854
            // write pre-init user code here
 
1855
            String str = getRecordValue(29);
 
1856
            textField19 = new TextField(LocalizationSupport.getMessage("Still_Birth"), str, 4, TextField.NUMERIC);//GEN-LINE:|566-getter|1|566-postInit
 
1857
            // write post-init user code here
 
1858
        }//GEN-BEGIN:|566-getter|2|
 
1859
        return textField19;
 
1860
    }
 
1861
//</editor-fold>//GEN-END:|566-getter|2|
 
1862
 
 
1863
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField20 ">//GEN-BEGIN:|567-getter|0|567-preInit
 
1864
    /**
 
1865
     * Returns an initialized instance of textField20 component.
 
1866
     *
 
1867
     * @return the initialized component instance
 
1868
     */
 
1869
    public TextField getTextField20() {
 
1870
        if (textField20 == null) {//GEN-END:|567-getter|0|567-preInit
 
1871
            // write pre-init user code here
 
1872
            String str = getRecordValue(30);
 
1873
            textField20 = new TextField(LocalizationSupport.getMessage("Abortion"), str, 4, TextField.NUMERIC);//GEN-LINE:|567-getter|1|567-postInit
 
1874
            // write post-init user code here
 
1875
        }//GEN-BEGIN:|567-getter|2|
 
1876
        return textField20;
 
1877
    }
 
1878
//</editor-fold>//GEN-END:|567-getter|2|
 
1879
 
 
1880
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Newbornsweighted ">//GEN-BEGIN:|568-getter|0|568-preInit
 
1881
    /**
 
1882
     * Returns an initialized instance of Newbornsweighted component.
 
1883
     *
 
1884
     * @return the initialized component instance
 
1885
     */
 
1886
    public Form getNewbornsweighted() {
 
1887
        if (Newbornsweighted == null) {//GEN-END:|568-getter|0|568-preInit
 
1888
            // write pre-init user code here
 
1889
            Newbornsweighted = new Form("Newborns weighted", new Item[]{getTextField21(), getTextField22(), getTextField23()});//GEN-BEGIN:|568-getter|1|568-postInit
 
1890
            Newbornsweighted.addCommand(getNewbornsweightedBackCmd());
 
1891
            Newbornsweighted.addCommand(getNewbornsweightedCmd());
 
1892
            Newbornsweighted.setCommandListener(this);//GEN-END:|568-getter|1|568-postInit
 
1893
            // write post-init user code here
 
1894
        }//GEN-BEGIN:|568-getter|2|
 
1895
        return Newbornsweighted;
 
1896
    }
 
1897
//</editor-fold>//GEN-END:|568-getter|2|
 
1898
 
 
1899
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: newbornsweightedBackCmd ">//GEN-BEGIN:|569-getter|0|569-preInit
 
1900
    /**
 
1901
     * Returns an initialized instance of newbornsweightedBackCmd component.
 
1902
     *
 
1903
     * @return the initialized component instance
 
1904
     */
 
1905
    public Command getNewbornsweightedBackCmd() {
 
1906
        if (newbornsweightedBackCmd == null) {//GEN-END:|569-getter|0|569-preInit
 
1907
            // write pre-init user code here
 
1908
            newbornsweightedBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|569-getter|1|569-postInit
 
1909
            // write post-init user code here
 
1910
        }//GEN-BEGIN:|569-getter|2|
 
1911
        return newbornsweightedBackCmd;
 
1912
    }
 
1913
//</editor-fold>//GEN-END:|569-getter|2|
 
1914
 
 
1915
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: newbornsweightedCmd ">//GEN-BEGIN:|571-getter|0|571-preInit
 
1916
    /**
 
1917
     * Returns an initialized instance of newbornsweightedCmd component.
 
1918
     *
 
1919
     * @return the initialized component instance
 
1920
     */
 
1921
    public Command getNewbornsweightedCmd() {
 
1922
        if (newbornsweightedCmd == null) {//GEN-END:|571-getter|0|571-preInit
 
1923
            // write pre-init user code here
 
1924
            newbornsweightedCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|571-getter|1|571-postInit
 
1925
            // write post-init user code here
 
1926
        }//GEN-BEGIN:|571-getter|2|
 
1927
        return newbornsweightedCmd;
 
1928
    }
 
1929
//</editor-fold>//GEN-END:|571-getter|2|
 
1930
 
 
1931
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField21 ">//GEN-BEGIN:|575-getter|0|575-preInit
 
1932
    /**
 
1933
     * Returns an initialized instance of textField21 component.
 
1934
     *
 
1935
     * @return the initialized component instance
 
1936
     */
 
1937
    public TextField getTextField21() {
 
1938
        if (textField21 == null) {//GEN-END:|575-getter|0|575-preInit
 
1939
            // write pre-init user code here
 
1940
            String str = getRecordValue(31);
 
1941
            textField21 = new TextField(LocalizationSupport.getMessage("Newborns_Weighed"), str, 4, TextField.NUMERIC);//GEN-LINE:|575-getter|1|575-postInit
 
1942
            // write post-init user code here
 
1943
        }//GEN-BEGIN:|575-getter|2|
 
1944
        return textField21;
 
1945
    }
 
1946
//</editor-fold>//GEN-END:|575-getter|2|
 
1947
 
 
1948
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField22 ">//GEN-BEGIN:|576-getter|0|576-preInit
 
1949
    /**
 
1950
     * Returns an initialized instance of textField22 component.
 
1951
     *
 
1952
     * @return the initialized component instance
 
1953
     */
 
1954
    public TextField getTextField22() {
 
1955
        if (textField22 == null) {//GEN-END:|576-getter|0|576-preInit
 
1956
            // write pre-init user code here
 
1957
            String str = getRecordValue(32);
 
1958
            textField22 = new TextField(LocalizationSupport.getMessage("Newborns_2.5kg"), str, 4, TextField.NUMERIC);//GEN-LINE:|576-getter|1|576-postInit
 
1959
            // write post-init user code here
 
1960
        }//GEN-BEGIN:|576-getter|2|
 
1961
        return textField22;
 
1962
    }
 
1963
//</editor-fold>//GEN-END:|576-getter|2|
 
1964
 
 
1965
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField23 ">//GEN-BEGIN:|577-getter|0|577-preInit
 
1966
    /**
 
1967
     * Returns an initialized instance of textField23 component.
 
1968
     *
 
1969
     * @return the initialized component instance
 
1970
     */
 
1971
    public TextField getTextField23() {
 
1972
        if (textField23 == null) {//GEN-END:|577-getter|0|577-preInit
 
1973
            // write pre-init user code here
 
1974
            String str = getRecordValue(33);
 
1975
            textField23 = new TextField(LocalizationSupport.getMessage("Newborns_Breastfed"), str, 4, TextField.NUMERIC);//GEN-LINE:|577-getter|1|577-postInit
 
1976
            // write post-init user code here
 
1977
        }//GEN-BEGIN:|577-getter|2|
 
1978
        return textField23;
 
1979
    }
 
1980
//</editor-fold>//GEN-END:|577-getter|2|
 
1981
 
 
1982
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: PostNatalCare ">//GEN-BEGIN:|578-getter|0|578-preInit
 
1983
    /**
 
1984
     * Returns an initialized instance of PostNatalCare component.
 
1985
     *
 
1986
     * @return the initialized component instance
 
1987
     */
 
1988
    public Form getPostNatalCare() {
 
1989
        if (PostNatalCare == null) {//GEN-END:|578-getter|0|578-preInit
 
1990
            // write pre-init user code here
 
1991
            PostNatalCare = new Form("Post -Natal Care", new Item[]{getTextField24(), getTextField25()});//GEN-BEGIN:|578-getter|1|578-postInit
 
1992
            PostNatalCare.addCommand(getPostnatalcareBackCmd());
 
1993
            PostNatalCare.addCommand(getPostnatalcareCmd());
 
1994
            PostNatalCare.setCommandListener(this);//GEN-END:|578-getter|1|578-postInit
 
1995
            // write post-init user code here
 
1996
        }//GEN-BEGIN:|578-getter|2|
 
1997
        return PostNatalCare;
 
1998
    }
 
1999
//</editor-fold>//GEN-END:|578-getter|2|
 
2000
 
 
2001
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: postnatalcareBackCmd ">//GEN-BEGIN:|579-getter|0|579-preInit
 
2002
    /**
 
2003
     * Returns an initialized instance of postnatalcareBackCmd component.
 
2004
     *
 
2005
     * @return the initialized component instance
 
2006
     */
 
2007
    public Command getPostnatalcareBackCmd() {
 
2008
        if (postnatalcareBackCmd == null) {//GEN-END:|579-getter|0|579-preInit
 
2009
            // write pre-init user code here
 
2010
            postnatalcareBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|579-getter|1|579-postInit
 
2011
            // write post-init user code here
 
2012
        }//GEN-BEGIN:|579-getter|2|
 
2013
        return postnatalcareBackCmd;
 
2014
    }
 
2015
//</editor-fold>//GEN-END:|579-getter|2|
 
2016
 
 
2017
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: postnatalcareCmd ">//GEN-BEGIN:|581-getter|0|581-preInit
 
2018
    /**
 
2019
     * Returns an initialized instance of postnatalcareCmd component.
 
2020
     *
 
2021
     * @return the initialized component instance
 
2022
     */
 
2023
    public Command getPostnatalcareCmd() {
 
2024
        if (postnatalcareCmd == null) {//GEN-END:|581-getter|0|581-preInit
 
2025
            // write pre-init user code here
 
2026
            postnatalcareCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|581-getter|1|581-postInit
 
2027
            // write post-init user code here
 
2028
        }//GEN-BEGIN:|581-getter|2|
 
2029
        return postnatalcareCmd;
 
2030
    }
 
2031
//</editor-fold>//GEN-END:|581-getter|2|
 
2032
 
 
2033
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField24 ">//GEN-BEGIN:|585-getter|0|585-preInit
 
2034
    /**
 
2035
     * Returns an initialized instance of textField24 component.
 
2036
     *
 
2037
     * @return the initialized component instance
 
2038
     */
 
2039
    public TextField getTextField24() {
 
2040
        if (textField24 == null) {//GEN-END:|585-getter|0|585-preInit
 
2041
            // write pre-init user code here
 
2042
            String str = getRecordValue(34);
 
2043
            textField24 = new TextField(LocalizationSupport.getMessage("Post_partum"), str, 4, TextField.NUMERIC);//GEN-LINE:|585-getter|1|585-postInit
 
2044
            // write post-init user code here
 
2045
        }//GEN-BEGIN:|585-getter|2|
 
2046
        return textField24;
 
2047
    }
 
2048
//</editor-fold>//GEN-END:|585-getter|2|
 
2049
 
 
2050
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField25 ">//GEN-BEGIN:|586-getter|0|586-preInit
 
2051
    /**
 
2052
     * Returns an initialized instance of textField25 component.
 
2053
     *
 
2054
     * @return the initialized component instance
 
2055
     */
 
2056
    public TextField getTextField25() {
 
2057
        if (textField25 == null) {//GEN-END:|586-getter|0|586-preInit
 
2058
            // write pre-init user code here
 
2059
            String str = getRecordValue(35);
 
2060
            textField25 = new TextField(LocalizationSupport.getMessage("Post_partum_48"), str, 4, TextField.NUMERIC);//GEN-LINE:|586-getter|1|586-postInit
 
2061
            // write post-init user code here
 
2062
        }//GEN-BEGIN:|586-getter|2|
 
2063
        return textField25;
 
2064
    }
 
2065
//</editor-fold>//GEN-END:|586-getter|2|
 
2066
 
 
2067
 
 
2068
 
 
2069
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: familyplanningBackCmd ">//GEN-BEGIN:|588-getter|0|588-preInit
 
2070
    /**
 
2071
     * Returns an initialized instance of familyplanningBackCmd component.
 
2072
     *
 
2073
     * @return the initialized component instance
 
2074
     */
 
2075
    public Command getFamilyplanningBackCmd() {
 
2076
        if (familyplanningBackCmd == null) {//GEN-END:|588-getter|0|588-preInit
 
2077
            // write pre-init user code here
 
2078
            familyplanningBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|588-getter|1|588-postInit
 
2079
            // write post-init user code here
 
2080
        }//GEN-BEGIN:|588-getter|2|
 
2081
        return familyplanningBackCmd;
 
2082
    }
 
2083
//</editor-fold>//GEN-END:|588-getter|2|
 
2084
 
 
2085
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: familyplanningCmd ">//GEN-BEGIN:|590-getter|0|590-preInit
 
2086
    /**
 
2087
     * Returns an initialized instance of familyplanningCmd component.
 
2088
     *
 
2089
     * @return the initialized component instance
 
2090
     */
 
2091
    public Command getFamilyplanningCmd() {
 
2092
        if (familyplanningCmd == null) {//GEN-END:|590-getter|0|590-preInit
 
2093
            // write pre-init user code here
 
2094
            familyplanningCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|590-getter|1|590-postInit
 
2095
            // write post-init user code here
 
2096
        }//GEN-BEGIN:|590-getter|2|
 
2097
        return familyplanningCmd;
 
2098
    }
 
2099
//</editor-fold>//GEN-END:|590-getter|2|
 
2100
 
 
2101
 
 
2102
 
 
2103
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childimmunizationBackCmd ">//GEN-BEGIN:|607-getter|0|607-preInit
 
2104
    /**
 
2105
     * Returns an initialized instance of childimmunizationBackCmd component.
 
2106
     *
 
2107
     * @return the initialized component instance
 
2108
     */
 
2109
    public Command getChildimmunizationBackCmd() {
 
2110
        if (childimmunizationBackCmd == null) {//GEN-END:|607-getter|0|607-preInit
 
2111
            // write pre-init user code here
 
2112
            childimmunizationBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|607-getter|1|607-postInit
 
2113
            // write post-init user code here
 
2114
        }//GEN-BEGIN:|607-getter|2|
 
2115
        return childimmunizationBackCmd;
 
2116
    }
 
2117
//</editor-fold>//GEN-END:|607-getter|2|
 
2118
 
 
2119
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childimmunizationCmd ">//GEN-BEGIN:|609-getter|0|609-preInit
 
2120
    /**
 
2121
     * Returns an initialized instance of childimmunizationCmd component.
 
2122
     *
 
2123
     * @return the initialized component instance
 
2124
     */
 
2125
    public Command getChildimmunizationCmd() {
 
2126
        if (childimmunizationCmd == null) {//GEN-END:|609-getter|0|609-preInit
 
2127
            // write pre-init user code here
 
2128
            childimmunizationCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|609-getter|1|609-postInit
 
2129
            // write post-init user code here
 
2130
        }//GEN-BEGIN:|609-getter|2|
 
2131
        return childimmunizationCmd;
 
2132
    }
 
2133
//</editor-fold>//GEN-END:|609-getter|2|
 
2134
 
 
2135
 
 
2136
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: followingimmunizationBackCmd ">//GEN-BEGIN:|628-getter|0|628-preInit
 
2137
    /**
 
2138
     * Returns an initialized instance of followingimmunizationBackCmd
 
2139
     * component.
 
2140
     *
 
2141
     * @return the initialized component instance
 
2142
     */
 
2143
    public Command getFollowingimmunizationBackCmd() {
 
2144
        if (followingimmunizationBackCmd == null) {//GEN-END:|628-getter|0|628-preInit
 
2145
            // write pre-init user code here
 
2146
            followingimmunizationBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|628-getter|1|628-postInit
 
2147
            // write post-init user code here
 
2148
        }//GEN-BEGIN:|628-getter|2|
 
2149
        return followingimmunizationBackCmd;
 
2150
    }
 
2151
//</editor-fold>//GEN-END:|628-getter|2|
 
2152
 
 
2153
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: followingimmunizationCmd ">//GEN-BEGIN:|630-getter|0|630-preInit
 
2154
    /**
 
2155
     * Returns an initialized instance of followingimmunizationCmd component.
 
2156
     *
 
2157
     * @return the initialized component instance
 
2158
     */
 
2159
    public Command getFollowingimmunizationCmd() {
 
2160
        if (followingimmunizationCmd == null) {//GEN-END:|630-getter|0|630-preInit
 
2161
            // write pre-init user code here
 
2162
            followingimmunizationCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|630-getter|1|630-postInit
 
2163
            // write post-init user code here
 
2164
        }//GEN-BEGIN:|630-getter|2|
 
2165
        return followingimmunizationCmd;
 
2166
    }
 
2167
//</editor-fold>//GEN-END:|630-getter|2|
 
2168
 
 
2169
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: aefiBackCmd ">//GEN-BEGIN:|643-getter|0|643-preInit
 
2170
    /**
 
2171
     * Returns an initialized instance of aefiBackCmd component.
 
2172
     *
 
2173
     * @return the initialized component instance
 
2174
     */
 
2175
    public Command getAefiBackCmd() {
 
2176
        if (aefiBackCmd == null) {//GEN-END:|643-getter|0|643-preInit
 
2177
            // write pre-init user code here
 
2178
            aefiBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|643-getter|1|643-postInit
 
2179
            // write post-init user code here
 
2180
        }//GEN-BEGIN:|643-getter|2|
 
2181
        return aefiBackCmd;
 
2182
    }
 
2183
//</editor-fold>//GEN-END:|643-getter|2|
 
2184
 
 
2185
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: aefiCmd ">//GEN-BEGIN:|645-getter|0|645-preInit
 
2186
    /**
 
2187
     * Returns an initialized instance of aefiCmd component.
 
2188
     *
 
2189
     * @return the initialized component instance
 
2190
     */
 
2191
    public Command getAefiCmd() {
 
2192
        if (aefiCmd == null) {//GEN-END:|645-getter|0|645-preInit
 
2193
            // write pre-init user code here
 
2194
            aefiCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|645-getter|1|645-postInit
 
2195
            // write post-init user code here
 
2196
        }//GEN-BEGIN:|645-getter|2|
 
2197
        return aefiCmd;
 
2198
    }
 
2199
//</editor-fold>//GEN-END:|645-getter|2|
 
2200
 
 
2201
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: immunizationsessionsBackCmd ">//GEN-BEGIN:|653-getter|0|653-preInit
 
2202
    /**
 
2203
     * Returns an initialized instance of immunizationsessionsBackCmd component.
 
2204
     *
 
2205
     * @return the initialized component instance
 
2206
     */
 
2207
    public Command getImmunizationsessionsBackCmd() {
 
2208
        if (immunizationsessionsBackCmd == null) {//GEN-END:|653-getter|0|653-preInit
 
2209
            // write pre-init user code here
 
2210
            immunizationsessionsBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|653-getter|1|653-postInit
 
2211
            // write post-init user code here
 
2212
        }//GEN-BEGIN:|653-getter|2|
 
2213
        return immunizationsessionsBackCmd;
 
2214
    }
 
2215
//</editor-fold>//GEN-END:|653-getter|2|
 
2216
 
 
2217
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: immunizationsessionsCmd ">//GEN-BEGIN:|655-getter|0|655-preInit
 
2218
    /**
 
2219
     * Returns an initialized instance of immunizationsessionsCmd component.
 
2220
     *
 
2221
     * @return the initialized component instance
 
2222
     */
 
2223
    public Command getImmunizationsessionsCmd() {
 
2224
        if (immunizationsessionsCmd == null) {//GEN-END:|655-getter|0|655-preInit
 
2225
            // write pre-init user code here
 
2226
            immunizationsessionsCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|655-getter|1|655-postInit
 
2227
            // write post-init user code here
 
2228
        }//GEN-BEGIN:|655-getter|2|
 
2229
        return immunizationsessionsCmd;
 
2230
    }
 
2231
//</editor-fold>//GEN-END:|655-getter|2|
 
2232
 
 
2233
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: vitaminadoseBackCmd ">//GEN-BEGIN:|662-getter|0|662-preInit
 
2234
    /**
 
2235
     * Returns an initialized instance of vitaminadoseBackCmd component.
 
2236
     *
 
2237
     * @return the initialized component instance
 
2238
     */
 
2239
    public Command getVitaminadoseBackCmd() {
 
2240
        if (vitaminadoseBackCmd == null) {//GEN-END:|662-getter|0|662-preInit
 
2241
            // write pre-init user code here
 
2242
            vitaminadoseBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|662-getter|1|662-postInit
 
2243
            // write post-init user code here
 
2244
        }//GEN-BEGIN:|662-getter|2|
 
2245
        return vitaminadoseBackCmd;
 
2246
    }
 
2247
//</editor-fold>//GEN-END:|662-getter|2|
 
2248
 
 
2249
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: vitaminadoseCmd ">//GEN-BEGIN:|664-getter|0|664-preInit
 
2250
    /**
 
2251
     * Returns an initialized instance of vitaminadoseCmd component.
 
2252
     *
 
2253
     * @return the initialized component instance
 
2254
     */
 
2255
    public Command getVitaminadoseCmd() {
 
2256
        if (vitaminadoseCmd == null) {//GEN-END:|664-getter|0|664-preInit
 
2257
            // write pre-init user code here
 
2258
            vitaminadoseCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|664-getter|1|664-postInit
 
2259
            // write post-init user code here
 
2260
        }//GEN-BEGIN:|664-getter|2|
 
2261
        return vitaminadoseCmd;
 
2262
    }
 
2263
//</editor-fold>//GEN-END:|664-getter|2|
 
2264
 
 
2265
 
 
2266
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childhoodBackCmd ">//GEN-BEGIN:|672-getter|0|672-preInit
 
2267
    /**
 
2268
     * Returns an initialized instance of childhoodBackCmd component.
 
2269
     *
 
2270
     * @return the initialized component instance
 
2271
     */
 
2272
    public Command getChildhoodBackCmd() {
 
2273
        if (childhoodBackCmd == null) {//GEN-END:|672-getter|0|672-preInit
 
2274
            // write pre-init user code here
 
2275
            childhoodBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|672-getter|1|672-postInit
 
2276
            // write post-init user code here
 
2277
        }//GEN-BEGIN:|672-getter|2|
 
2278
        return childhoodBackCmd;
 
2279
    }
 
2280
//</editor-fold>//GEN-END:|672-getter|2|
 
2281
 
 
2282
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childhoodCmd ">//GEN-BEGIN:|674-getter|0|674-preInit
 
2283
    /**
 
2284
     * Returns an initialized instance of childhoodCmd component.
 
2285
     *
 
2286
     * @return the initialized component instance
 
2287
     */
 
2288
    public Command getChildhoodCmd() {
 
2289
        if (childhoodCmd == null) {//GEN-END:|674-getter|0|674-preInit
 
2290
            // write pre-init user code here
 
2291
            childhoodCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|674-getter|1|674-postInit
 
2292
            // write post-init user code here
 
2293
        }//GEN-BEGIN:|674-getter|2|
 
2294
        return childhoodCmd;
 
2295
    }
 
2296
//</editor-fold>//GEN-END:|674-getter|2|
 
2297
 
 
2298
 
 
2299
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: healthfacilityservicesBackCmd ">//GEN-BEGIN:|682-getter|0|682-preInit
 
2300
    /**
 
2301
     * Returns an initialized instance of healthfacilityservicesBackCmd
 
2302
     * component.
 
2303
     *
 
2304
     * @return the initialized component instance
 
2305
     */
 
2306
    public Command getHealthfacilityservicesBackCmd() {
 
2307
        if (healthfacilityservicesBackCmd == null) {//GEN-END:|682-getter|0|682-preInit
 
2308
            // write pre-init user code here
 
2309
            healthfacilityservicesBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|682-getter|1|682-postInit
 
2310
            // write post-init user code here
 
2311
        }//GEN-BEGIN:|682-getter|2|
 
2312
        return healthfacilityservicesBackCmd;
 
2313
    }
 
2314
//</editor-fold>//GEN-END:|682-getter|2|
 
2315
 
 
2316
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: healthfacilityservicesCmd ">//GEN-BEGIN:|684-getter|0|684-preInit
 
2317
    /**
 
2318
     * Returns an initialized instance of healthfacilityservicesCmd component.
 
2319
     *
 
2320
     * @return the initialized component instance
 
2321
     */
 
2322
    public Command getHealthfacilityservicesCmd() {
 
2323
        if (healthfacilityservicesCmd == null) {//GEN-END:|684-getter|0|684-preInit
 
2324
            // write pre-init user code here
 
2325
            healthfacilityservicesCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|684-getter|1|684-postInit
 
2326
            // write post-init user code here
 
2327
        }//GEN-BEGIN:|684-getter|2|
 
2328
        return healthfacilityservicesCmd;
 
2329
    }
 
2330
//</editor-fold>//GEN-END:|684-getter|2|
 
2331
 
 
2332
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: labtestsBackCmd ">//GEN-BEGIN:|689-getter|0|689-preInit
 
2333
    /**
 
2334
     * Returns an initialized instance of labtestsBackCmd component.
 
2335
     *
 
2336
     * @return the initialized component instance
 
2337
     */
 
2338
    public Command getLabtestsBackCmd() {
 
2339
        if (labtestsBackCmd == null) {//GEN-END:|689-getter|0|689-preInit
 
2340
            // write pre-init user code here
 
2341
            labtestsBackCmd = new Command("Back", Command.BACK, 0);//GEN-LINE:|689-getter|1|689-postInit
 
2342
            // write post-init user code here
 
2343
        }//GEN-BEGIN:|689-getter|2|
 
2344
        return labtestsBackCmd;
 
2345
    }
 
2346
//</editor-fold>//GEN-END:|689-getter|2|
 
2347
 
 
2348
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: labtestsCmd ">//GEN-BEGIN:|691-getter|0|691-preInit
 
2349
    /**
 
2350
     * Returns an initialized instance of labtestsCmd component.
 
2351
     *
 
2352
     * @return the initialized component instance
 
2353
     */
 
2354
    public Command getLabtestsCmd() {
 
2355
        if (labtestsCmd == null) {//GEN-END:|691-getter|0|691-preInit
 
2356
            // write pre-init user code here
 
2357
            labtestsCmd = new Command("Next", Command.OK, 0);//GEN-LINE:|691-getter|1|691-postInit
 
2358
            // write post-init user code here
 
2359
        }//GEN-BEGIN:|691-getter|2|
 
2360
        return labtestsCmd;
 
2361
    }
 
2362
//</editor-fold>//GEN-END:|691-getter|2|
 
2363
 
 
2364
 
 
2365
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: saveCmd ">//GEN-BEGIN:|702-getter|0|702-preInit
 
2366
    /**
 
2367
     * Returns an initialized instance of saveCmd component.
 
2368
     *
 
2369
     * @return the initialized component instance
 
2370
     */
 
2371
    public Command getSaveCmd() {
 
2372
        if (saveCmd == null) {//GEN-END:|702-getter|0|702-preInit
 
2373
            // write pre-init user code here
 
2374
            saveCmd = new Command("Save", Command.OK, 0);//GEN-LINE:|702-getter|1|702-postInit
 
2375
            // write post-init user code here
 
2376
        }//GEN-BEGIN:|702-getter|2|
 
2377
        return saveCmd;
 
2378
    }
 
2379
//</editor-fold>//GEN-END:|702-getter|2|
 
2380
 
 
2381
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|705-getter|0|705-preInit
 
2382
    /**
 
2383
     * Returns an initialized instance of backCommand component.
 
2384
     *
 
2385
     * @return the initialized component instance
 
2386
     */
 
2387
    public Command getBackCommand() {
 
2388
        if (backCommand == null) {//GEN-END:|705-getter|0|705-preInit
 
2389
            // write pre-init user code here
 
2390
            backCommand = new Command("Back", Command.BACK, 0);//GEN-LINE:|705-getter|1|705-postInit
 
2391
            // write post-init user code here
 
2392
        }//GEN-BEGIN:|705-getter|2|
 
2393
        return backCommand;
 
2394
    }
 
2395
//</editor-fold>//GEN-END:|705-getter|2|
 
2396
  //<editor-fold defaultstate="collapsed" desc=" getEmptyFields() ">
 
2397
    private void getEmptyFields() {
 
2398
        
 
2399
        String fullStr = "";
 
2400
        int j = 0;
 
2401
   
 
2402
        fullStr = getMyBaseData();
 
2403
        String[] allContent = split(fullStr, ":");
 
2404
 
 
2405
        for (int i = 0; i < allContent.length; i++) {
 
2406
            if (allContent[i].equals("")) {
 
2407
                j++;
 
2408
            }
 
2409
        }
 
2410
 
 
2411
        try {
 
2412
            if (j != 0) {
 
2413
                Image missingImg = Image.createImage("/org/hispindia/mobile/images/exclamation.png");
 
2414
                imgItem.setImage(missingImg);
 
2415
                if (j == 1) {
 
2416
                    imgItem.setLabel(j + " field is not filled. Please verify...");
 
2417
                } else {
 
2418
                    imgItem.setLabel(j + " fields are not filled. Please verify...");
 
2419
                }
 
2420
                imgItem.setLayout(ImageItem.LAYOUT_DEFAULT);
 
2421
            } else {
 
2422
                Image completeImg = Image.createImage("/org/hispindia/mobile/images/success.png");
 
2423
                imgItem.setImage(completeImg);
 
2424
                imgItem.setLabel("All fields are filled");
 
2425
                imgItem.setLayout(ImageItem.LAYOUT_DEFAULT);
 
2426
            }
 
2427
        } catch (IOException ex) {
 
2428
            ex.printStackTrace();
 
2429
        }
 
2430
    }
 
2431
    //</editor-fold>
 
2432
 
 
2433
    //<editor-fold defaultstate="collapsed" desc=" intToByteArray ">
 
2434
    public static final byte[] intToByteArray(int value) {
 
2435
        return new byte[]{
 
2436
                    (byte) (value >>> 24),
 
2437
                    (byte) (value >>> 16),
 
2438
                    (byte) (value >>> 8),
 
2439
                    (byte) value
 
2440
                };
 
2441
    }
 
2442
    //</editor-fold>
 
2443
 
 
2444
    //<editor-fold defaultstate="collapsed" desc=" split ">
 
2445
    //TODO: Replace Vector with Array to improve performance
 
2446
    private String[] split(String original, String separator) {
 
2447
        Vector nodes = new Vector();
 
2448
 
 
2449
        // Parse nodes into vector
 
2450
        int index = original.indexOf(separator);
 
2451
        while (index >= 0) {
 
2452
            nodes.addElement(original.substring(0, index));
 
2453
            original = original.substring(index + separator.length());
 
2454
            index = original.indexOf(separator);
 
2455
        }
 
2456
        // Get the last node
 
2457
        nodes.addElement(original);
 
2458
 
 
2459
        // Create splitted string array
 
2460
        String[] result = new String[nodes.size()];
 
2461
        if (nodes.size() > 0) {
 
2462
            for (int loop = 0; loop < nodes.size(); loop++) {
 
2463
                result[loop] = (String) nodes.elementAt(loop);
 
2464
            }
 
2465
        }
 
2466
        return result;
 
2467
    }
 
2468
    //</editor-fold>
 
2469
 
 
2470
    /**
 
2471
     * Returns a display instance.
 
2472
     * @return the display instance.
 
2473
     */
 
2474
    public Display getDisplay() {
 
2475
        return Display.getDisplay(this);
 
2476
    }
 
2477
 
 
2478
    public RecordStore getLastMsgStore() {
 
2479
        return lastMsgStore;
 
2480
    }
 
2481
 
 
2482
    public String getMsgVersion() {
 
2483
        return msgVersion;
 
2484
    }
 
2485
 
 
2486
    public boolean isSavedMsg() {
 
2487
        return savedMsg;
 
2488
    }
 
2489
 
 
2490
    public void setSavedMsg(boolean savedMsg) {
 
2491
        this.savedMsg = savedMsg;
 
2492
    }
 
2493
 
 
2494
    /**
 
2495
     * Exits MIDlet.
 
2496
     */
 
2497
    public void exitMIDlet() {
 
2498
        switchDisplayable(null, null);
 
2499
        destroyApp(true);
 
2500
        notifyDestroyed();
 
2501
    }
 
2502
 
 
2503
    /**
 
2504
     * Called when MIDlet is started.
 
2505
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
 
2506
     */
 
2507
    public void startApp() {
 
2508
        if (midletPaused) {
 
2509
            resumeMIDlet();
 
2510
        } else {
 
2511
            initialize();
 
2512
            startMIDlet();
 
2513
        }
 
2514
        midletPaused = false;
 
2515
    }
 
2516
 
 
2517
    /**
 
2518
     * Called when MIDlet is paused.
 
2519
     */
 
2520
    public void pauseApp() {
 
2521
        midletPaused = true;
 
2522
    }
 
2523
 
 
2524
    /**
 
2525
     * Called to signal the MIDlet to terminate.
 
2526
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
 
2527
     */
 
2528
    public void destroyApp(boolean unconditional) {
 
2529
    }
 
2530
    
 
2531
    private String getMyBaseData(){
 
2532
    String myData = textField.getString() + ":" +
 
2533
                textField1.getString() + ":" +
 
2534
                textField2.getString() + ":" +
 
2535
                textField3.getString() + ":" +
 
2536
                textField4.getString() + ":" +
 
2537
                textField5.getString() + ":" +
 
2538
                textField6.getString() + ":" +
 
2539
                textField7.getString() + ":" +
 
2540
                textField8.getString() + ":" +
 
2541
                textField9.getString() + ":" +
 
2542
                textField10.getString() + ":" +
 
2543
                textField11.getString() + ":" +
 
2544
                textField12.getString() + ":" +
 
2545
                textField13.getString() + ":" +
 
2546
                textField14.getString() + ":" +
 
2547
                textField15.getString() + ":" +
 
2548
                textField16.getString() + ":" +
 
2549
                textField17.getString() + ":" +
 
2550
                textField18.getString() + ":" +
 
2551
                textField19.getString() + ":" +
 
2552
                textField20.getString() + ":" +
 
2553
                textField21.getString() + ":" +
 
2554
                textField22.getString() + ":" +
 
2555
                textField23.getString() + ":" +
 
2556
                textField24.getString() + ":" +
 
2557
                textField25.getString() ;       
 
2558
    return myData;
 
2559
    }
 
2560
    private String collectFormData(String monthStr, String freqStr) {
 
2561
        String[] monthNames = {
 
2562
            "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 
2563
        };
 
2564
        int i = 0;
 
2565
        for (i = 0; i < monthNames.length; i++) {
 
2566
            if (monthNames[i].equalsIgnoreCase(monthStr.substring(0, 3))) {
 
2567
                break;
 
2568
            }
 
2569
        }
 
2570
        String monthData = "";
 
2571
        if (i < 9) {
 
2572
            // monthData = monthStr.substring(4).substring(2,2) + "-0" + (i + 1) + "-01";
 
2573
            monthData = monthStr.substring(4).substring(2,4)+ "0" + (i + 1);
 
2574
        } else {
 
2575
            // monthData = monthStr.substring(4).substring(2, 2) + "-" + (i + 1) + "-01";
 
2576
            monthData = monthStr.substring(4).substring(2, 4) +(i + 1);
 
2577
        }
 
2578
        
 
2579
        //for frequency setting of the program
 
2580
        String freqData = "";
 
2581
        freqData = freqStr;
 
2582
        
 
2583
        String myData = "";
 
2584
       
 
2585
        myData = getMyBaseData();
 
2586
        
 
2587
        // create myReturnData to content the last data to return
 
2588
        String myReturnData = "";
 
2589
        
 
2590
        int characters = 0;  // THE CHARACTERS OF DATA on one SMS
 
2591
        int seperateIndex = 0; // THE INDEX OF DATA IN STRING [] myDataTemp blow
 
2592
        
 
2593
        formID = 1;
 
2594
        String periodType = "3";
 
2595
        //return "HP NRHM "+ msgVersion + "!" + formID + "*" + periodType + "?" + monthData + "$" + myData;
 
2596
        
 
2597
        // If the message too long, seperate to 2 message
 
2598
        // lengh of "HP NRHM "+ formID + "*" + monthData + "$" is 15 characters
 
2599
        if(myData.length() > 145)
 
2600
        {
 
2601
            // assign data into String [] myDataTemp
 
2602
            String[] myDataTemp = split(myData, ":");
 
2603
            // reset myData
 
2604
            myData = "";
 
2605
 
 
2606
            while(seperateIndex < myDataTemp.length){
 
2607
                // addIndex to content the Index of data. Have to have 2 characters
 
2608
                String addIndex = Integer.toString(seperateIndex);
 
2609
                if (addIndex.length()<2)
 
2610
                    addIndex = "0"+ addIndex;
 
2611
                
 
2612
                // reset characters;
 
2613
                characters = 1;
 
2614
                // reset myData
 
2615
                myData = "";
 
2616
                // if characters <= 142. BECAUSE seperateIndex + "!" CONTENT 3 CHARACTERS
 
2617
                while(characters < 143){
 
2618
                if(myData.length() + myDataTemp[seperateIndex].length() < 143){
 
2619
                        myData += myDataTemp[seperateIndex] + ":";
 
2620
                        characters = myData.length();
 
2621
                        seperateIndex ++;
 
2622
                        if (seperateIndex == myDataTemp.length)
 
2623
                            break; // break if seperateIndex = myDataTemp.lengh
 
2624
                }else{
 
2625
                    break; // break if the cannot append more into myData
 
2626
                }
 
2627
 
 
2628
                }// end while
 
2629
                
 
2630
                // remove ":" at the end of each message
 
2631
                myData = myData.substring(0, myData.length() -1);
 
2632
                
 
2633
                // myData have to content 142 characters. And the last SMS doesn't need enough 142 characters
 
2634
                while (myData.length() < 142 && seperateIndex < myDataTemp.length)
 
2635
                    myData += "!";
 
2636
                
 
2637
                // append data to myReturnData
 
2638
                myReturnData += "HP NRHM "+ formID + "*" + monthData + "$" + addIndex + "?" + myData;
 
2639
                
 
2640
            }// end while
 
2641
        } // end if myData.leght > 145
 
2642
        else{
 
2643
            // myReturnData = "HP NRHM "+ formID + "*" + monthData + "$" + myData;
 
2644
            myReturnData += "HP NRHM "+ formID + "*" + monthData + "$" + "00" + "?" + myData;
 
2645
        }
 
2646
        
 
2647
        // return "HP NRHM "+ formID + "*" + monthData + "$" + myData;
 
2648
        return myReturnData;
 
2649
    }
 
2650
 
 
2651
    private void sendDataViaSMS(final String scForm1Data) {
 
2652
        new Thread(new Runnable() {
 
2653
 
 
2654
            public void run() {
 
2655
                try {
 
2656
                    int j = 0;
 
2657
                    for (int i = 0; i < 3; i++) {
 
2658
                        if (lastMsgStore.getRecord(i + 1) != null) {
 
2659
                            j++;
 
2660
                            MessageConnection smsConn = (MessageConnection) Connector.open("sms://" + new String(lastMsgStore.getRecord(i + 1)));
 
2661
                            TextMessage sms = (TextMessage) smsConn.newMessage(MessageConnection.TEXT_MESSAGE);
 
2662
                            sms.setPayloadText(scForm1Data);
 
2663
                            smsConn.send(sms);
 
2664
                            smsConn.close();
 
2665
                        }
 
2666
                    }
 
2667
                    if (j == 0) {
 
2668
                        sendMsgLabel.setText("No number to send SMS... Please go to settings and enter a phone number");
 
2669
                    } else {
 
2670
                        sendMsgLabel.setText("Message Sent Successfully. You can go back and edit or exit the application now.");
 
2671
                    }
 
2672
                } catch (UnsupportedEncodingException ex) {
 
2673
                    ex.printStackTrace();
 
2674
                } catch (RecordStoreException rsex) {
 
2675
                    rsex.printStackTrace();
 
2676
                } catch (IOException ex) {
 
2677
                    ex.printStackTrace();
 
2678
                } catch (SecurityException ex) {
 
2679
                    ex.printStackTrace();
 
2680
                } catch (NullPointerException npe) {
 
2681
                    npe.printStackTrace();
 
2682
                } catch (IllegalArgumentException ex) {
 
2683
                    ex.printStackTrace();
 
2684
                }
 
2685
            }
 
2686
        }).start();
 
2687
    }
 
2688
 
 
2689
    private void saveDataToRMS(final String monthStr, final String freqString) {
 
2690
        new Thread(new Runnable() {
 
2691
 
 
2692
            public void run() {
 
2693
                try {
 
2694
                    lastMsgStore.setRecord(8, msgVersion.getBytes(), 0, msgVersion.length());
 
2695
                    lastMsgStore.setRecord(9, intToByteArray(formID), 0, intToByteArray(formID).length);
 
2696
                    lastMsgStore.setRecord(10, monthStr.getBytes(), 0, monthStr.length()); // record for month
 
2697
                    lastMsgStore.setRecord(7, freqString.getBytes(), 0, freqString.length()); // record for frequency
 
2698
                    
 
2699
                    //<editor-fold defaultstate="collapsed" desc="update data into RMS ">
 
2700
                    lastMsgStore.setRecord(11, textField.getString().getBytes(), 0, textField.getString().length());
 
2701
                    lastMsgStore.setRecord(36, textField1.getString().getBytes(), 0, textField1.getString().length()); // missing textField1 so I add one more record in RMS
 
2702
                    lastMsgStore.setRecord(12, textField2.getString().getBytes(), 0, textField2.getString().length());
 
2703
                    lastMsgStore.setRecord(13, textField3.getString().getBytes(), 0, textField3.getString().length());
 
2704
                    lastMsgStore.setRecord(14, textField4.getString().getBytes(), 0, textField4.getString().length());
 
2705
                    lastMsgStore.setRecord(15, textField5.getString().getBytes(), 0, textField5.getString().length());
 
2706
                    lastMsgStore.setRecord(16, textField6.getString().getBytes(), 0, textField6.getString().length());
 
2707
                    lastMsgStore.setRecord(17, textField7.getString().getBytes(), 0, textField7.getString().length());
 
2708
                    lastMsgStore.setRecord(18, textField8.getString().getBytes(), 0, textField8.getString().length());
 
2709
                    lastMsgStore.setRecord(19, textField9.getString().getBytes(), 0, textField9.getString().length());
 
2710
                    lastMsgStore.setRecord(20, textField10.getString().getBytes(), 0, textField10.getString().length());
 
2711
                    lastMsgStore.setRecord(21, textField11.getString().getBytes(), 0, textField11.getString().length());
 
2712
                    lastMsgStore.setRecord(22, textField12.getString().getBytes(), 0, textField12.getString().length());
 
2713
                    lastMsgStore.setRecord(23, textField13.getString().getBytes(), 0, textField13.getString().length());
 
2714
                    lastMsgStore.setRecord(24, textField14.getString().getBytes(), 0, textField14.getString().length());
 
2715
                    lastMsgStore.setRecord(25, textField15.getString().getBytes(), 0, textField15.getString().length());
 
2716
                    lastMsgStore.setRecord(26, textField16.getString().getBytes(), 0, textField16.getString().length());
 
2717
                    lastMsgStore.setRecord(27, textField17.getString().getBytes(), 0, textField17.getString().length());
 
2718
                    lastMsgStore.setRecord(28, textField18.getString().getBytes(), 0, textField18.getString().length());
 
2719
                    lastMsgStore.setRecord(29, textField19.getString().getBytes(), 0, textField19.getString().length());
 
2720
                    lastMsgStore.setRecord(30, textField20.getString().getBytes(), 0, textField20.getString().length());
 
2721
                    lastMsgStore.setRecord(31, textField21.getString().getBytes(), 0, textField21.getString().length());
 
2722
                    lastMsgStore.setRecord(32, textField22.getString().getBytes(), 0, textField22.getString().length());
 
2723
                    lastMsgStore.setRecord(33, textField23.getString().getBytes(), 0, textField23.getString().length());
 
2724
                    lastMsgStore.setRecord(34, textField24.getString().getBytes(), 0, textField24.getString().length());
 
2725
                    lastMsgStore.setRecord(35, textField25.getString().getBytes(), 0, textField25.getString().length());
 
2726
                    
 
2727
                    //</editor-fold>
 
2728
 
 
2729
 
 
2730
                    lastMsgStore.setRecord(4, "true".getBytes(), 0, "true".getBytes().length); //record for edit or not edit option (on load page)
 
2731
                    savedMsg = true;
 
2732
                } catch (RecordStoreException ex) {
 
2733
                    ex.printStackTrace();
 
2734
                } catch (NullPointerException npe) {
 
2735
                    npe.printStackTrace();
 
2736
                }
 
2737
            }
 
2738
        }).start();
 
2739
    }
 
2740
    
 
2741
    
 
2742
    /*
 
2743
     * Author : Thai Chuong
 
2744
     * This function use to get value from RecordStore
 
2745
     * return String : the value of the record
 
2746
     * int recordNumber: the numberic of the record in RecordStore
 
2747
     */
 
2748
    public String getRecordValue (int recordNumber){
 
2749
        String str = "";
 
2750
            if (editingLastReport) {
 
2751
                try {
 
2752
                    byte[] myValue = lastMsgStore.getRecord(recordNumber);
 
2753
                    //fixed the problem that the textField was defined "numeric" still accept "-" character
 
2754
                    if (myValue != null) {
 
2755
                        str = new String(myValue);
 
2756
                        if(!isIntNumber(str)){str = "";} // Check if the value is not a integer
 
2757
                    }
 
2758
 
 
2759
                } catch (RecordStoreException rsex) {
 
2760
                    rsex.printStackTrace();
 
2761
                }
 
2762
            }
 
2763
            return str;
 
2764
    }
 
2765
    
 
2766
    /*
 
2767
     * Author : Thai Chuong
 
2768
     * This function use check a String is Integer or not
 
2769
     * return boolean : true/false
 
2770
     * String num: The String value need to check
 
2771
     */
 
2772
    private boolean isIntNumber(String num){
 
2773
        try{
 
2774
        Integer.parseInt(num);
 
2775
        } catch(NumberFormatException nfe) {
 
2776
            return false;
 
2777
        }
 
2778
            return true;
 
2779
    }
 
2780
}
 
 
b'\\ No newline at end of file'