1
package org.hispindia.mobile;
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;
19
public class SCForm1 extends MIDlet implements CommandListener {
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;
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;
135
//</editor-fold>//GEN-END:|fields|0|
138
* The SCForm1 constructor.
142
lastMsgStore = RecordStore.openRecordStore("lastMsgStore", true);
143
if (lastMsgStore.getNumRecords() == 0) {
150
for (int i = 0; i < 36; i++) {
152
lastMsgStore.addRecord("".getBytes(), 0, "".getBytes().length);
153
} catch (RecordStoreException rsex) {
154
rsex.printStackTrace();
158
if (lastMsgStore.getRecord(4) != null) {
159
String checkSaved = new String(lastMsgStore.getRecord(4));
160
if (checkSaved.equals("true")) {
165
} catch (RecordStoreException ex) {
166
ex.printStackTrace();
170
//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
172
* Switches a display to previous displayable of the current displayable.
174
* <code>display</code> instance is obtain from the
175
* <code>getDisplay</code> method.
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);
186
//</editor-fold>//GEN-END:|methods|0|
188
//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
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.
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|
201
//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
203
* Performs an action assigned to the Mobile Device - MIDlet Started point.
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|
212
//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
214
* Performs an action assigned to the Mobile Device - MIDlet Resumed point.
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|
223
//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
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.
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
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);
243
display.setCurrent(nextDisplayable);
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|
251
//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
253
* Called by a system to indicated that a command has been invoked on a
254
* particular displayable.
256
* @param command the Command that was invoked
257
* @param displayable the Displayable where the command was invoked
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
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;
338
editingLastReport = false;
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());
377
final String scForm1Data = collectFormData(monthStr, freqStr);
378
//<editor-fold defaultstate="collapsed" desc=" Thread to Save Records to RMS ">
379
saveDataToRMS(monthStr,freqStr);
382
//<editor-fold defaultstate="collapsed" desc=" Thread to Send SMS ">
383
sendDataViaSMS(scForm1Data);
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
404
String phone1 = phone1Num.getString();
405
String phone2 = phone2Num.getString();
406
String phone3 = phone3Num.getString();
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
413
if (sendMsgLabel != null) {
414
sendMsgLabel.setText("Settings Saved... Press \"Send to send report");
416
} catch (RecordStoreException ex) {
417
ex.printStackTrace();
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());
427
switchDisplayable(null, getLoadPage());//GEN-LINE:|7-commandAction|52|203-postAction
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|
439
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendPage ">//GEN-BEGIN:|167-getter|0|167-preInit
441
* Returns an initialized instance of sendPage component.
443
* @return the initialized component instance
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
456
if (sendPage.size() > 1) {
457
sendPage.delete(sendPage.size() - 1);
459
sendPage.append(imgItem);
461
}//GEN-BEGIN:|167-getter|2|
464
//</editor-fold>//GEN-END:|167-getter|2|
466
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendCmd ">//GEN-BEGIN:|168-getter|0|168-preInit
468
* Returns an initialized instance of sendCmd component.
470
* @return the initialized component instance
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|
480
//</editor-fold>//GEN-END:|168-getter|2|
482
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendBackCmd ">//GEN-BEGIN:|170-getter|0|170-preInit
484
* Returns an initialized instance of sendBackCmd component.
486
* @return the initialized component instance
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|
496
//</editor-fold>//GEN-END:|170-getter|2|
498
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthPage ">//GEN-BEGIN:|178-getter|0|178-preInit
500
* Returns an initialized instance of monthPage component.
502
* @return the initialized component instance
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|
515
//</editor-fold>//GEN-END:|178-getter|2|
517
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthChoice ">//GEN-BEGIN:|189-getter|0|189-preInit
519
* Returns an initialized instance of monthChoice component.
521
* @return the initialized component instance
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
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"
537
// append current month in to monthChoice
538
monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
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);
547
monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
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);
558
// monthChoice.append(monthNames[cal.get(Calendar.MONTH)] + " " + cal.get(Calendar.YEAR), null);
562
// Index to save default month.
563
// int index = 0;// current month
564
int index = 1; // last month
566
//setdefault selected item in monthChoice
567
if (editingLastReport) {
568
if (lastMsgStore.getRecord(10) != null) {
570
for(index = 0; index < monthChoice.size(); index++)
572
if(monthChoice.getString(index).equalsIgnoreCase(new String(lastMsgStore.getRecord(10)))){
576
monthChoice.setSelectedIndex(index, true); // need the last report value
579
monthChoice.setSelectedIndex(index, true); // if not need the last report value
581
} catch (RecordStoreException rsex) {
582
rsex.printStackTrace();
584
}//GEN-BEGIN:|189-getter|2|
587
//</editor-fold>//GEN-END:|189-getter|2|
589
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthCmd ">//GEN-BEGIN:|179-getter|0|179-preInit
591
* Returns an initialized instance of monthCmd component.
593
* @return the initialized component instance
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|
603
//</editor-fold>//GEN-END:|179-getter|2|
605
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: splashScreen ">//GEN-BEGIN:|202-getter|0|202-preInit
607
* Returns an initialized instance of splashScreen component.
609
* @return the initialized component instance
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|
625
//</editor-fold>//GEN-END:|202-getter|2|
627
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: nrhmlogo ">//GEN-BEGIN:|205-getter|0|205-preInit
629
* Returns an initialized instance of nrhmlogo component.
631
* @return the initialized component instance
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
640
}//GEN-LINE:|205-getter|2|205-postInit
641
// write post-init user code here
642
}//GEN-BEGIN:|205-getter|3|
645
//</editor-fold>//GEN-END:|205-getter|3|
647
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendExitCmd ">//GEN-BEGIN:|206-getter|0|206-preInit
649
* Returns an initialized instance of sendExitCmd component.
651
* @return the initialized component instance
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|
661
//</editor-fold>//GEN-END:|206-getter|2|
663
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendMsgLabel ">//GEN-BEGIN:|210-getter|0|210-preInit
665
* Returns an initialized instance of sendMsgLabel component.
667
* @return the initialized component instance
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|
679
//</editor-fold>//GEN-END:|210-getter|2|
681
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: font ">//GEN-BEGIN:|211-getter|0|211-preInit
683
* Returns an initialized instance of font component.
685
* @return the initialized component instance
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|
695
//</editor-fold>//GEN-END:|211-getter|2|
697
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: question ">//GEN-BEGIN:|213-getter|0|213-preInit
699
* Returns an initialized instance of question component.
701
* @return the initialized component instance
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
710
}//GEN-LINE:|213-getter|2|213-postInit
711
// write post-init user code here
712
}//GEN-BEGIN:|213-getter|3|
715
//</editor-fold>//GEN-END:|213-getter|3|
717
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadPage ">//GEN-BEGIN:|219-getter|0|219-preInit
719
* Returns an initialized instance of loadPage component.
721
* @return the initialized component instance
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|
734
//</editor-fold>//GEN-END:|219-getter|2|
736
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: questionLabel ">//GEN-BEGIN:|221-getter|0|221-preInit
738
* Returns an initialized instance of questionLabel component.
740
* @return the initialized component instance
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;
750
//</editor-fold>//GEN-END:|221-getter|2|
752
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: lastChoice ">//GEN-BEGIN:|222-getter|0|222-preInit
754
* Returns an initialized instance of lastChoice component.
756
* @return the initialized component instance
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|
770
//</editor-fold>//GEN-END:|222-getter|2|
772
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadCmd ">//GEN-BEGIN:|225-getter|0|225-preInit
774
* Returns an initialized instance of loadCmd component.
776
* @return the initialized component instance
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|
786
//</editor-fold>//GEN-END:|225-getter|2|
788
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: loadExitCmd ">//GEN-BEGIN:|227-getter|0|227-preInit
790
* Returns an initialized instance of loadExitCmd component.
792
* @return the initialized component instance
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|
802
//</editor-fold>//GEN-END:|227-getter|2|
804
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsPage ">//GEN-BEGIN:|233-getter|0|233-preInit
806
* Returns an initialized instance of settingsPage component.
808
* @return the initialized component instance
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|
821
//</editor-fold>//GEN-END:|233-getter|2|
823
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: questionImage ">//GEN-BEGIN:|241-getter|0|241-preInit
825
* Returns an initialized instance of questionImage component.
827
* @return the initialized component instance
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;
837
//</editor-fold>//GEN-END:|241-getter|2|
839
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsCmd ">//GEN-BEGIN:|242-getter|0|242-preInit
841
* Returns an initialized instance of settingsCmd component.
843
* @return the initialized component instance
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|
853
//</editor-fold>//GEN-END:|242-getter|2|
855
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: settingsBackCmd ">//GEN-BEGIN:|245-getter|0|245-preInit
857
* Returns an initialized instance of settingsBackCmd component.
859
* @return the initialized component instance
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;
869
//</editor-fold>//GEN-END:|245-getter|2|
871
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone1Num ">//GEN-BEGIN:|248-getter|0|248-preInit
873
* Returns an initialized instance of phone1Num component.
875
* @return the initialized component instance
877
public TextField getPhone1Num() {
878
if (phone1Num == null) {//GEN-END:|248-getter|0|248-preInit
881
if (lastMsgStore.getRecord(1) != null) {
882
str = new String(lastMsgStore.getRecord(1));
884
} catch (RecordStoreException rsex) {
885
rsex.printStackTrace();
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|
892
//</editor-fold>//GEN-END:|248-getter|2|
894
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone2Num ">//GEN-BEGIN:|249-getter|0|249-preInit
896
* Returns an initialized instance of phone2Num component.
898
* @return the initialized component instance
900
public TextField getPhone2Num() {
901
if (phone2Num == null) {//GEN-END:|249-getter|0|249-preInit
904
if (lastMsgStore.getRecord(2) != null) {
905
str = new String(lastMsgStore.getRecord(2));
907
} catch (RecordStoreException rsex) {
908
rsex.printStackTrace();
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|
915
//</editor-fold>//GEN-END:|249-getter|2|
917
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: phone3Num ">//GEN-BEGIN:|250-getter|0|250-preInit
919
* Returns an initialized instance of phone3Num component.
921
* @return the initialized component instance
923
public TextField getPhone3Num() {
924
if (phone3Num == null) {//GEN-END:|250-getter|0|250-preInit
927
if (lastMsgStore.getRecord(3) != null) {
928
str = new String(lastMsgStore.getRecord(3));
930
} catch (RecordStoreException rsex) {
931
rsex.printStackTrace();
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|
938
//</editor-fold>//GEN-END:|250-getter|2|
940
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendSettingsCmd ">//GEN-BEGIN:|254-getter|0|254-preInit
942
* Returns an initialized instance of sendSettingsCmd component.
944
* @return the initialized component instance
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;
954
//</editor-fold>//GEN-END:|254-getter|2|
956
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: monthExitCmd ">//GEN-BEGIN:|458-getter|0|458-preInit
958
* Returns an initialized instance of monthExitCmd component.
960
* @return the initialized component instance
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|
970
//</editor-fold>//GEN-END:|458-getter|2|
972
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendGPRSCommand ">//GEN-BEGIN:|463-getter|0|463-preInit
974
* Returns an initialized instance of sendGPRSCommand component.
976
* @return the initialized component instance
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;
986
//</editor-fold>//GEN-END:|463-getter|2|
988
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: antinatalcareCmd ">//GEN-BEGIN:|487-getter|0|487-preInit
990
* Returns an initialized instance of antinatalcareCmd component.
992
* @return the initialized component instance
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;
1002
//</editor-fold>//GEN-END:|487-getter|2|
1004
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: antinatalcareBackCmd ">//GEN-BEGIN:|492-getter|0|492-preInit
1006
* Returns an initialized instance of antinatalcareBackCmd component.
1008
* @return the initialized component instance
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;
1018
//</editor-fold>//GEN-END:|492-getter|2|
1020
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Given ">//GEN-BEGIN:|507-getter|0|507-preInit
1022
* Returns an initialized instance of ANC_Given component.
1024
* @return the initialized component instance
1026
public TextField getANC_Given() {
1027
if (ANC_Given == null) {//GEN-END:|507-getter|0|507-preInit
1028
// write pre-init user code here
1030
if (editingLastReport) {
1032
if (lastMsgStore.getRecord(11) != null) {
1033
str = new String(lastMsgStore.getRecord(11));
1036
} catch (RecordStoreException rsex) {
1037
rsex.printStackTrace();
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|
1045
//</editor-fold>//GEN-END:|507-getter|2|
1047
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Having ">//GEN-BEGIN:|508-getter|0|508-preInit
1049
* Returns an initialized instance of ANC_Having component.
1051
* @return the initialized component instance
1053
public TextField getANC_Having() {
1054
if (ANC_Having == null) {//GEN-END:|508-getter|0|508-preInit
1055
// write pre-init user code here
1057
if (editingLastReport) {
1059
if (lastMsgStore.getRecord(12) != null) {
1060
str = new String(lastMsgStore.getRecord(12));
1063
} catch (RecordStoreException rsex) {
1064
rsex.printStackTrace();
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|
1072
//</editor-fold>//GEN-END:|508-getter|2|
1074
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Hypertension ">//GEN-BEGIN:|509-getter|0|509-preInit
1076
* Returns an initialized instance of ANC_Hypertension component.
1078
* @return the initialized component instance
1080
public TextField getANC_Hypertension() {
1081
if (ANC_Hypertension == null) {//GEN-END:|509-getter|0|509-preInit
1082
// write pre-init user code here
1084
if (editingLastReport) {
1086
if (lastMsgStore.getRecord(13) != null) {
1087
str = new String(lastMsgStore.getRecord(13));
1090
} catch (RecordStoreException rsex) {
1091
rsex.printStackTrace();
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;
1099
//</editor-fold>//GEN-END:|509-getter|2|
1101
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Registration ">//GEN-BEGIN:|510-getter|0|510-preInit
1103
* Returns an initialized instance of ANC_Registration component.
1105
* @return the initialized component instance
1107
public TextField getANC_Registration() {
1108
if (ANC_Registration == null) {//GEN-END:|510-getter|0|510-preInit
1109
// write pre-init user code here
1111
if (editingLastReport) {
1113
if (lastMsgStore.getRecord(14) != null) {
1114
str = new String(lastMsgStore.getRecord(14));
1117
} catch (RecordStoreException rsex) {
1118
rsex.printStackTrace();
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;
1126
//</editor-fold>//GEN-END:|510-getter|2|
1128
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_RegistrationWithin ">//GEN-BEGIN:|511-getter|0|511-preInit
1130
* Returns an initialized instance of ANC_RegistrationWithin component.
1132
* @return the initialized component instance
1134
public TextField getANC_RegistrationWithin() {
1135
if (ANC_RegistrationWithin == null) {//GEN-END:|511-getter|0|511-preInit
1136
// write pre-init user code here
1138
if (editingLastReport) {
1140
if (lastMsgStore.getRecord(15) != null) {
1141
str = new String(lastMsgStore.getRecord(15));
1144
} catch (RecordStoreException rsex) {
1145
rsex.printStackTrace();
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;
1153
//</editor-fold>//GEN-END:|511-getter|2|
1155
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ThirdVisit ">//GEN-BEGIN:|512-getter|0|512-preInit
1157
* Returns an initialized instance of ANC_ThirdVisit component.
1159
* @return the initialized component instance
1161
public TextField getANC_ThirdVisit() {
1162
if (ANC_ThirdVisit == null) {//GEN-END:|512-getter|0|512-preInit
1163
// write pre-init user code here
1165
if (editingLastReport) {
1167
if (lastMsgStore.getRecord(16) != null) {
1168
str = new String(lastMsgStore.getRecord(16));
1171
} catch (RecordStoreException rsex) {
1172
rsex.printStackTrace();
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;
1180
//</editor-fold>//GEN-END:|512-getter|2|
1182
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_TT1 ">//GEN-BEGIN:|513-getter|0|513-preInit
1184
* Returns an initialized instance of ANC_TT1 component.
1186
* @return the initialized component instance
1188
public TextField getANC_TT1() {
1189
if (ANC_TT1 == null) {//GEN-END:|513-getter|0|513-preInit
1190
// write pre-init user code here
1192
if (editingLastReport) {
1194
if (lastMsgStore.getRecord(17) != null) {
1195
str = new String(lastMsgStore.getRecord(17));
1198
} catch (RecordStoreException rsex) {
1199
rsex.printStackTrace();
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|
1207
//</editor-fold>//GEN-END:|513-getter|2|
1209
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_TT2 ">//GEN-BEGIN:|514-getter|0|514-preInit
1211
* Returns an initialized instance of ANC_TT2 component.
1213
* @return the initialized component instance
1215
public TextField getANC_TT2() {
1216
if (ANC_TT2 == null) {//GEN-END:|514-getter|0|514-preInit
1217
// write pre-init user code here
1219
if (editingLastReport) {
1221
if (lastMsgStore.getRecord(18) != null) {
1222
str = new String(lastMsgStore.getRecord(18));
1225
} catch (RecordStoreException rsex) {
1226
rsex.printStackTrace();
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|
1234
//</editor-fold>//GEN-END:|514-getter|2|
1236
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: freqGroup ">//GEN-BEGIN:|517-getter|0|517-preInit
1238
* Returns an initialized instance of freqGroup component.
1240
* @return the initialized component instance
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
1249
String[] freqNames = {
1253
for (int i = 0; i < freqNames.length; i++) {
1254
freqGroup.append(freqNames[i], null);
1257
if (editingLastReport) {
1258
if (lastMsgStore.getRecord(7) != null) {
1260
for(index = 0; index < freqGroup.size(); index++)
1262
if(freqGroup.getString(index).equalsIgnoreCase(new String(lastMsgStore.getRecord(7)))){
1266
freqGroup.setSelectedIndex(index, true); // need the last report value
1269
freqGroup.setSelectedIndex(0, true); // If not need the value of the last report
1271
} catch (RecordStoreException rsex) {
1272
rsex.printStackTrace();
1274
}//GEN-BEGIN:|517-getter|2|
1277
//</editor-fold>//GEN-END:|517-getter|2|
1279
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Antinatalcare ">//GEN-BEGIN:|473-getter|0|473-preInit
1281
* Returns an initialized instance of Antinatalcare component.
1283
* @return the initialized component instance
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;
1296
//</editor-fold>//GEN-END:|473-getter|2|
1298
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_Services ">//GEN-BEGIN:|518-getter|0|518-preInit
1300
* Returns an initialized instance of ANC_Services component.
1302
* @return the initialized component instance
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;
1315
//</editor-fold>//GEN-END:|518-getter|2|
1317
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ServicesBackCmd ">//GEN-BEGIN:|519-getter|0|519-preInit
1319
* Returns an initialized instance of ANC_ServicesBackCmd component.
1321
* @return the initialized component instance
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;
1331
//</editor-fold>//GEN-END:|519-getter|2|
1333
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: ANC_ServicesCmd ">//GEN-BEGIN:|521-getter|0|521-preInit
1335
* Returns an initialized instance of ANC_ServicesCmd component.
1337
* @return the initialized component instance
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;
1347
//</editor-fold>//GEN-END:|521-getter|2|
1349
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField ">//GEN-BEGIN:|524-getter|0|524-preInit
1351
* Returns an initialized instance of textField component.
1353
* @return the initialized component instance
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|
1364
//</editor-fold>//GEN-END:|524-getter|2|
1366
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField1 ">//GEN-BEGIN:|525-getter|0|525-preInit
1368
* Returns an initialized instance of textField1 component.
1370
* @return the initialized component instance
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|
1381
//</editor-fold>//GEN-END:|525-getter|2|
1383
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField2 ">//GEN-BEGIN:|526-getter|0|526-preInit
1385
* Returns an initialized instance of textField2 component.
1387
* @return the initialized component instance
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|
1398
//</editor-fold>//GEN-END:|526-getter|2|
1400
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField3 ">//GEN-BEGIN:|527-getter|0|527-preInit
1402
* Returns an initialized instance of textField3 component.
1404
* @return the initialized component instance
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|
1415
//</editor-fold>//GEN-END:|527-getter|2|
1417
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField4 ">//GEN-BEGIN:|528-getter|0|528-preInit
1419
* Returns an initialized instance of textField4 component.
1421
* @return the initialized component instance
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|
1432
//</editor-fold>//GEN-END:|528-getter|2|
1434
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField5 ">//GEN-BEGIN:|529-getter|0|529-preInit
1436
* Returns an initialized instance of textField5 component.
1438
* @return the initialized component instance
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|
1449
//</editor-fold>//GEN-END:|529-getter|2|
1451
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField6 ">//GEN-BEGIN:|530-getter|0|530-preInit
1453
* Returns an initialized instance of textField6 component.
1455
* @return the initialized component instance
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|
1466
//</editor-fold>//GEN-END:|530-getter|2|
1468
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField7 ">//GEN-BEGIN:|531-getter|0|531-preInit
1470
* Returns an initialized instance of textField7 component.
1472
* @return the initialized component instance
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|
1483
//</editor-fold>//GEN-END:|531-getter|2|
1485
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField8 ">//GEN-BEGIN:|532-getter|0|532-preInit
1487
* Returns an initialized instance of textField8 component.
1489
* @return the initialized component instance
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|
1500
//</editor-fold>//GEN-END:|532-getter|2|
1502
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Deliveries ">//GEN-BEGIN:|533-getter|0|533-preInit
1504
* Returns an initialized instance of Deliveries component.
1506
* @return the initialized component instance
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|
1519
//</editor-fold>//GEN-END:|533-getter|2|
1521
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|541-getter|0|541-preInit
1523
* Returns an initialized instance of stringItem component.
1525
* @return the initialized component instance
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|
1536
//</editor-fold>//GEN-END:|541-getter|2|
1538
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: DeliveriesBackCmd ">//GEN-BEGIN:|534-getter|0|534-preInit
1540
* Returns an initialized instance of DeliveriesBackCmd component.
1542
* @return the initialized component instance
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;
1552
//</editor-fold>//GEN-END:|534-getter|2|
1554
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: DeliveriesCmd ">//GEN-BEGIN:|536-getter|0|536-preInit
1556
* Returns an initialized instance of DeliveriesCmd component.
1558
* @return the initialized component instance
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;
1568
//</editor-fold>//GEN-END:|536-getter|2|
1570
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField9 ">//GEN-BEGIN:|542-getter|0|542-preInit
1572
* Returns an initialized instance of textField9 component.
1574
* @return the initialized component instance
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|
1585
//</editor-fold>//GEN-END:|542-getter|2|
1587
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField10 ">//GEN-BEGIN:|543-getter|0|543-preInit
1589
* Returns an initialized instance of textField10 component.
1591
* @return the initialized component instance
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|
1602
//</editor-fold>//GEN-END:|543-getter|2|
1604
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField11 ">//GEN-BEGIN:|544-getter|0|544-preInit
1606
* Returns an initialized instance of textField11 component.
1608
* @return the initialized component instance
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|
1619
//</editor-fold>//GEN-END:|544-getter|2|
1621
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField12 ">//GEN-BEGIN:|545-getter|0|545-preInit
1623
* Returns an initialized instance of textField12 component.
1625
* @return the initialized component instance
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|
1636
//</editor-fold>//GEN-END:|545-getter|2|
1638
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: InstitutionalDeliveries ">//GEN-BEGIN:|546-getter|0|546-preInit
1640
* Returns an initialized instance of InstitutionalDeliveries component.
1642
* @return the initialized component instance
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;
1655
//</editor-fold>//GEN-END:|546-getter|2|
1657
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField13 ">//GEN-BEGIN:|553-getter|0|553-preInit
1659
* Returns an initialized instance of textField13 component.
1661
* @return the initialized component instance
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|
1672
//</editor-fold>//GEN-END:|553-getter|2|
1674
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField14 ">//GEN-BEGIN:|554-getter|0|554-preInit
1676
* Returns an initialized instance of textField14 component.
1678
* @return the initialized component instance
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|
1690
//</editor-fold>//GEN-END:|554-getter|2|
1692
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField15 ">//GEN-BEGIN:|555-getter|0|555-preInit
1694
* Returns an initialized instance of textField15 component.
1696
* @return the initialized component instance
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|
1708
//</editor-fold>//GEN-END:|555-getter|2|
1710
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField16 ">//GEN-BEGIN:|556-getter|0|556-preInit
1712
* Returns an initialized instance of textField16 component.
1714
* @return the initialized component instance
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|
1726
//</editor-fold>//GEN-END:|556-getter|2|
1728
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Pregnancyoutcome ">//GEN-BEGIN:|557-getter|0|557-preInit
1730
* Returns an initialized instance of Pregnancyoutcome component.
1732
* @return the initialized component instance
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;
1745
//</editor-fold>//GEN-END:|557-getter|2|
1747
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: institutionaldeliveriesBackCmd ">//GEN-BEGIN:|547-getter|0|547-preInit
1749
* Returns an initialized instance of institutionaldeliveriesBackCmd
1752
* @return the initialized component instance
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;
1762
//</editor-fold>//GEN-END:|547-getter|2|
1764
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: institutionaldeliveriesCmd ">//GEN-BEGIN:|549-getter|0|549-preInit
1766
* Returns an initialized instance of institutionaldeliveriesCmd component.
1768
* @return the initialized component instance
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;
1778
//</editor-fold>//GEN-END:|549-getter|2|
1780
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: pregnancyoutcomeBackCmd ">//GEN-BEGIN:|558-getter|0|558-preInit
1782
* Returns an initialized instance of pregnancyoutcomeBackCmd component.
1784
* @return the initialized component instance
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;
1794
//</editor-fold>//GEN-END:|558-getter|2|
1796
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: pregnancyoutcomeCmd ">//GEN-BEGIN:|560-getter|0|560-preInit
1798
* Returns an initialized instance of pregnancyoutcomeCmd component.
1800
* @return the initialized component instance
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;
1810
//</editor-fold>//GEN-END:|560-getter|2|
1812
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField17 ">//GEN-BEGIN:|564-getter|0|564-preInit
1814
* Returns an initialized instance of textField17 component.
1816
* @return the initialized component instance
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|
1827
//</editor-fold>//GEN-END:|564-getter|2|
1829
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField18 ">//GEN-BEGIN:|565-getter|0|565-preInit
1831
* Returns an initialized instance of textField18 component.
1833
* @return the initialized component instance
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|
1844
//</editor-fold>//GEN-END:|565-getter|2|
1846
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField19 ">//GEN-BEGIN:|566-getter|0|566-preInit
1848
* Returns an initialized instance of textField19 component.
1850
* @return the initialized component instance
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|
1861
//</editor-fold>//GEN-END:|566-getter|2|
1863
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField20 ">//GEN-BEGIN:|567-getter|0|567-preInit
1865
* Returns an initialized instance of textField20 component.
1867
* @return the initialized component instance
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|
1878
//</editor-fold>//GEN-END:|567-getter|2|
1880
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: Newbornsweighted ">//GEN-BEGIN:|568-getter|0|568-preInit
1882
* Returns an initialized instance of Newbornsweighted component.
1884
* @return the initialized component instance
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;
1897
//</editor-fold>//GEN-END:|568-getter|2|
1899
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: newbornsweightedBackCmd ">//GEN-BEGIN:|569-getter|0|569-preInit
1901
* Returns an initialized instance of newbornsweightedBackCmd component.
1903
* @return the initialized component instance
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;
1913
//</editor-fold>//GEN-END:|569-getter|2|
1915
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: newbornsweightedCmd ">//GEN-BEGIN:|571-getter|0|571-preInit
1917
* Returns an initialized instance of newbornsweightedCmd component.
1919
* @return the initialized component instance
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;
1929
//</editor-fold>//GEN-END:|571-getter|2|
1931
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField21 ">//GEN-BEGIN:|575-getter|0|575-preInit
1933
* Returns an initialized instance of textField21 component.
1935
* @return the initialized component instance
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|
1946
//</editor-fold>//GEN-END:|575-getter|2|
1948
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField22 ">//GEN-BEGIN:|576-getter|0|576-preInit
1950
* Returns an initialized instance of textField22 component.
1952
* @return the initialized component instance
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|
1963
//</editor-fold>//GEN-END:|576-getter|2|
1965
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField23 ">//GEN-BEGIN:|577-getter|0|577-preInit
1967
* Returns an initialized instance of textField23 component.
1969
* @return the initialized component instance
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|
1980
//</editor-fold>//GEN-END:|577-getter|2|
1982
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: PostNatalCare ">//GEN-BEGIN:|578-getter|0|578-preInit
1984
* Returns an initialized instance of PostNatalCare component.
1986
* @return the initialized component instance
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;
1999
//</editor-fold>//GEN-END:|578-getter|2|
2001
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: postnatalcareBackCmd ">//GEN-BEGIN:|579-getter|0|579-preInit
2003
* Returns an initialized instance of postnatalcareBackCmd component.
2005
* @return the initialized component instance
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;
2015
//</editor-fold>//GEN-END:|579-getter|2|
2017
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: postnatalcareCmd ">//GEN-BEGIN:|581-getter|0|581-preInit
2019
* Returns an initialized instance of postnatalcareCmd component.
2021
* @return the initialized component instance
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;
2031
//</editor-fold>//GEN-END:|581-getter|2|
2033
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField24 ">//GEN-BEGIN:|585-getter|0|585-preInit
2035
* Returns an initialized instance of textField24 component.
2037
* @return the initialized component instance
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|
2048
//</editor-fold>//GEN-END:|585-getter|2|
2050
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: textField25 ">//GEN-BEGIN:|586-getter|0|586-preInit
2052
* Returns an initialized instance of textField25 component.
2054
* @return the initialized component instance
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|
2065
//</editor-fold>//GEN-END:|586-getter|2|
2069
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: familyplanningBackCmd ">//GEN-BEGIN:|588-getter|0|588-preInit
2071
* Returns an initialized instance of familyplanningBackCmd component.
2073
* @return the initialized component instance
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;
2083
//</editor-fold>//GEN-END:|588-getter|2|
2085
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: familyplanningCmd ">//GEN-BEGIN:|590-getter|0|590-preInit
2087
* Returns an initialized instance of familyplanningCmd component.
2089
* @return the initialized component instance
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;
2099
//</editor-fold>//GEN-END:|590-getter|2|
2103
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childimmunizationBackCmd ">//GEN-BEGIN:|607-getter|0|607-preInit
2105
* Returns an initialized instance of childimmunizationBackCmd component.
2107
* @return the initialized component instance
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;
2117
//</editor-fold>//GEN-END:|607-getter|2|
2119
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childimmunizationCmd ">//GEN-BEGIN:|609-getter|0|609-preInit
2121
* Returns an initialized instance of childimmunizationCmd component.
2123
* @return the initialized component instance
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;
2133
//</editor-fold>//GEN-END:|609-getter|2|
2136
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: followingimmunizationBackCmd ">//GEN-BEGIN:|628-getter|0|628-preInit
2138
* Returns an initialized instance of followingimmunizationBackCmd
2141
* @return the initialized component instance
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;
2151
//</editor-fold>//GEN-END:|628-getter|2|
2153
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: followingimmunizationCmd ">//GEN-BEGIN:|630-getter|0|630-preInit
2155
* Returns an initialized instance of followingimmunizationCmd component.
2157
* @return the initialized component instance
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;
2167
//</editor-fold>//GEN-END:|630-getter|2|
2169
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: aefiBackCmd ">//GEN-BEGIN:|643-getter|0|643-preInit
2171
* Returns an initialized instance of aefiBackCmd component.
2173
* @return the initialized component instance
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|
2183
//</editor-fold>//GEN-END:|643-getter|2|
2185
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: aefiCmd ">//GEN-BEGIN:|645-getter|0|645-preInit
2187
* Returns an initialized instance of aefiCmd component.
2189
* @return the initialized component instance
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|
2199
//</editor-fold>//GEN-END:|645-getter|2|
2201
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: immunizationsessionsBackCmd ">//GEN-BEGIN:|653-getter|0|653-preInit
2203
* Returns an initialized instance of immunizationsessionsBackCmd component.
2205
* @return the initialized component instance
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;
2215
//</editor-fold>//GEN-END:|653-getter|2|
2217
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: immunizationsessionsCmd ">//GEN-BEGIN:|655-getter|0|655-preInit
2219
* Returns an initialized instance of immunizationsessionsCmd component.
2221
* @return the initialized component instance
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;
2231
//</editor-fold>//GEN-END:|655-getter|2|
2233
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: vitaminadoseBackCmd ">//GEN-BEGIN:|662-getter|0|662-preInit
2235
* Returns an initialized instance of vitaminadoseBackCmd component.
2237
* @return the initialized component instance
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;
2247
//</editor-fold>//GEN-END:|662-getter|2|
2249
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: vitaminadoseCmd ">//GEN-BEGIN:|664-getter|0|664-preInit
2251
* Returns an initialized instance of vitaminadoseCmd component.
2253
* @return the initialized component instance
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;
2263
//</editor-fold>//GEN-END:|664-getter|2|
2266
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childhoodBackCmd ">//GEN-BEGIN:|672-getter|0|672-preInit
2268
* Returns an initialized instance of childhoodBackCmd component.
2270
* @return the initialized component instance
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;
2280
//</editor-fold>//GEN-END:|672-getter|2|
2282
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: childhoodCmd ">//GEN-BEGIN:|674-getter|0|674-preInit
2284
* Returns an initialized instance of childhoodCmd component.
2286
* @return the initialized component instance
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;
2296
//</editor-fold>//GEN-END:|674-getter|2|
2299
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: healthfacilityservicesBackCmd ">//GEN-BEGIN:|682-getter|0|682-preInit
2301
* Returns an initialized instance of healthfacilityservicesBackCmd
2304
* @return the initialized component instance
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;
2314
//</editor-fold>//GEN-END:|682-getter|2|
2316
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: healthfacilityservicesCmd ">//GEN-BEGIN:|684-getter|0|684-preInit
2318
* Returns an initialized instance of healthfacilityservicesCmd component.
2320
* @return the initialized component instance
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;
2330
//</editor-fold>//GEN-END:|684-getter|2|
2332
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: labtestsBackCmd ">//GEN-BEGIN:|689-getter|0|689-preInit
2334
* Returns an initialized instance of labtestsBackCmd component.
2336
* @return the initialized component instance
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;
2346
//</editor-fold>//GEN-END:|689-getter|2|
2348
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: labtestsCmd ">//GEN-BEGIN:|691-getter|0|691-preInit
2350
* Returns an initialized instance of labtestsCmd component.
2352
* @return the initialized component instance
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|
2362
//</editor-fold>//GEN-END:|691-getter|2|
2365
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: saveCmd ">//GEN-BEGIN:|702-getter|0|702-preInit
2367
* Returns an initialized instance of saveCmd component.
2369
* @return the initialized component instance
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|
2379
//</editor-fold>//GEN-END:|702-getter|2|
2381
//<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|705-getter|0|705-preInit
2383
* Returns an initialized instance of backCommand component.
2385
* @return the initialized component instance
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|
2395
//</editor-fold>//GEN-END:|705-getter|2|
2396
//<editor-fold defaultstate="collapsed" desc=" getEmptyFields() ">
2397
private void getEmptyFields() {
2399
String fullStr = "";
2402
fullStr = getMyBaseData();
2403
String[] allContent = split(fullStr, ":");
2405
for (int i = 0; i < allContent.length; i++) {
2406
if (allContent[i].equals("")) {
2413
Image missingImg = Image.createImage("/org/hispindia/mobile/images/exclamation.png");
2414
imgItem.setImage(missingImg);
2416
imgItem.setLabel(j + " field is not filled. Please verify...");
2418
imgItem.setLabel(j + " fields are not filled. Please verify...");
2420
imgItem.setLayout(ImageItem.LAYOUT_DEFAULT);
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);
2427
} catch (IOException ex) {
2428
ex.printStackTrace();
2433
//<editor-fold defaultstate="collapsed" desc=" intToByteArray ">
2434
public static final byte[] intToByteArray(int value) {
2436
(byte) (value >>> 24),
2437
(byte) (value >>> 16),
2438
(byte) (value >>> 8),
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();
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);
2456
// Get the last node
2457
nodes.addElement(original);
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);
2471
* Returns a display instance.
2472
* @return the display instance.
2474
public Display getDisplay() {
2475
return Display.getDisplay(this);
2478
public RecordStore getLastMsgStore() {
2479
return lastMsgStore;
2482
public String getMsgVersion() {
2486
public boolean isSavedMsg() {
2490
public void setSavedMsg(boolean savedMsg) {
2491
this.savedMsg = savedMsg;
2497
public void exitMIDlet() {
2498
switchDisplayable(null, null);
2504
* Called when MIDlet is started.
2505
* Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
2507
public void startApp() {
2514
midletPaused = false;
2518
* Called when MIDlet is paused.
2520
public void pauseApp() {
2521
midletPaused = true;
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.
2528
public void destroyApp(boolean unconditional) {
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() ;
2560
private String collectFormData(String monthStr, String freqStr) {
2561
String[] monthNames = {
2562
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
2565
for (i = 0; i < monthNames.length; i++) {
2566
if (monthNames[i].equalsIgnoreCase(monthStr.substring(0, 3))) {
2570
String monthData = "";
2572
// monthData = monthStr.substring(4).substring(2,2) + "-0" + (i + 1) + "-01";
2573
monthData = monthStr.substring(4).substring(2,4)+ "0" + (i + 1);
2575
// monthData = monthStr.substring(4).substring(2, 2) + "-" + (i + 1) + "-01";
2576
monthData = monthStr.substring(4).substring(2, 4) +(i + 1);
2579
//for frequency setting of the program
2580
String freqData = "";
2585
myData = getMyBaseData();
2587
// create myReturnData to content the last data to return
2588
String myReturnData = "";
2590
int characters = 0; // THE CHARACTERS OF DATA on one SMS
2591
int seperateIndex = 0; // THE INDEX OF DATA IN STRING [] myDataTemp blow
2594
String periodType = "3";
2595
//return "HP NRHM "+ msgVersion + "!" + formID + "*" + periodType + "?" + monthData + "$" + myData;
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)
2601
// assign data into String [] myDataTemp
2602
String[] myDataTemp = split(myData, ":");
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;
2612
// reset characters;
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();
2622
if (seperateIndex == myDataTemp.length)
2623
break; // break if seperateIndex = myDataTemp.lengh
2625
break; // break if the cannot append more into myData
2630
// remove ":" at the end of each message
2631
myData = myData.substring(0, myData.length() -1);
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)
2637
// append data to myReturnData
2638
myReturnData += "HP NRHM "+ formID + "*" + monthData + "$" + addIndex + "?" + myData;
2641
} // end if myData.leght > 145
2643
// myReturnData = "HP NRHM "+ formID + "*" + monthData + "$" + myData;
2644
myReturnData += "HP NRHM "+ formID + "*" + monthData + "$" + "00" + "?" + myData;
2647
// return "HP NRHM "+ formID + "*" + monthData + "$" + myData;
2648
return myReturnData;
2651
private void sendDataViaSMS(final String scForm1Data) {
2652
new Thread(new Runnable() {
2657
for (int i = 0; i < 3; i++) {
2658
if (lastMsgStore.getRecord(i + 1) != null) {
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);
2668
sendMsgLabel.setText("No number to send SMS... Please go to settings and enter a phone number");
2670
sendMsgLabel.setText("Message Sent Successfully. You can go back and edit or exit the application now.");
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();
2689
private void saveDataToRMS(final String monthStr, final String freqString) {
2690
new Thread(new Runnable() {
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
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());
2730
lastMsgStore.setRecord(4, "true".getBytes(), 0, "true".getBytes().length); //record for edit or not edit option (on load page)
2732
} catch (RecordStoreException ex) {
2733
ex.printStackTrace();
2734
} catch (NullPointerException npe) {
2735
npe.printStackTrace();
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
2748
public String getRecordValue (int recordNumber){
2750
if (editingLastReport) {
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
2759
} catch (RecordStoreException rsex) {
2760
rsex.printStackTrace();
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
2772
private boolean isIntNumber(String num){
2774
Integer.parseInt(num);
2775
} catch(NumberFormatException nfe) {
b'\\ No newline at end of file'