Permalink
Browse files

RAXAJSS-70 made unified registration form & fixed dateFormat

  • Loading branch information...
1 parent 543a076 commit 2231f3d2a9e6d67523855241d8422c3b20b7d4c5 @chughgaurav committed Apr 21, 2012
@@ -5,7 +5,7 @@ Ext.Loader.setConfig({
Ext.application({
name: 'RaxaEmr.Registration',
controllers: ['Main'],
- views: ['Home', 'Register', 'Search', 'Bmi', 'PatientScreen1', 'PatientScreen2', 'Viewport'],
+ views: ['Bmi','Home', 'Register', 'Search','Viewport'],
models: ['Patient'],
launch: function() {
@@ -55,7 +55,6 @@ Ext.define('RaxaEmr.Registration.controller.Main', {
},
init: function () {
- console.log('Main controller init');
this.initializePatientStore();
this.printPatientStore();
@@ -70,7 +69,6 @@ Ext.define('RaxaEmr.Registration.controller.Main', {
},
initializePatientStore: function () {
- console.log('initializePatientStore');
//our Store automatically picks up the LocalStorageProxy defined on the
//Patient model
patientStore = Ext.create('Ext.data.Store', {
@@ -79,18 +77,10 @@ Ext.define('RaxaEmr.Registration.controller.Main', {
},
addPatientToStore: function () {
- console.log("add patient to patientStore");
-
var form = this.getCreatePatientForm();
var values = form.getValues();
-
- console.log("form values:");
- console.log(values);
patientStore.add(values);
patientStore.sync();
-
- console.log("patient object:");
- console.log(patientStore.last());
},
printPatientStore: function () {
@@ -107,7 +97,6 @@ Ext.define('RaxaEmr.Registration.controller.Main', {
* Takes input from Registration Form and creates a patient in LocalStorage
*/
createPatient: function () {
- console.log("createPatient");
this.addPatientToStore();
},
@@ -31,25 +31,58 @@ Ext.define('RaxaEmr.Registration.model.Patient', {
},
{
name: 'dateOfBirth',
- type: 'date'
+ type: 'date',
+ dateFormat:'m/d/Y'
},
- {
+ /*{
// TODO: remove age? Shouldnt need age and dateOfBirth
name: 'age',
type: 'int'
- },
+ },*/
{
name: 'education',
type: 'string'
},
{
name: 'caste',
type: 'string'
+ },
+ {
+ name: 'block#',
+ type: 'string'
+ },
+ {
+ name: 'street',
+ type: 'string'
+ },
+ {
+ name: 'town',
+ type: 'string'
+ },
+ {
+ name: 'postOffice',
+ type: 'string'
+ },
+ {
+ name: 'tehsil',
+ type: 'string'
+ },
+ {
+ name: 'district',
+ type: 'string'
+ },
+ {
+ name: 'contactViaPhone',
+ type: 'string'
+ },
+ {
+ name: 'primaryPhone',
+ type: 'string'
+ },
+ {
+ name: 'secondaryPhone',
+ type: 'string'
}
- //{
- // name: 'occupation',
- // type: 'string'
- //}
]
}
});
@@ -1,130 +0,0 @@
-Ext.define('RaxaEmr.Registration.view.PatientScreen1', {
- extend: 'Ext.form.Panel',
- id: 'createPatientForm',
-
- config: {
- title: 'Patient Profile Information',
- styleHtmlContent: true,
- xtype: 'patientScreen1',
- autoscroll: true,
-
- // List takes a store and a template
- items: [{
- xtype: 'fieldset',
- title: 'Patient Basic Information',
- align: 'center',
- centered: true,
- items: [{
- xtype: 'textfield',
- label: 'First Name',
- name: 'firstName',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Last Name',
- name: 'lastName',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Father/Husband First Name',
- name: 'guardianFirstName',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Father/Husband Last Name:',
- name: 'guardianLastName',
- required: true,
- clearIcon: true
- },
- {
- xtype: 'selectfield',
- label: 'Sex',
- name: 'gender',
- options: [{
- text: 'Male',
- value: 'male'
- },
- {
- text: 'Female',
- value: 'female'
- },
- {
- text: 'Other',
- value: 'other'
- }]
- },
- {
- xtype: 'selectfield',
- label: 'Education',
- name: 'education',
- options: [{
- text: 'Not educated',
- value: 'notEducated'
- },
- {
- text: '5th Pass or less',
- value: 'lessThanOrEqualTo5'
- },
- {
- text: '6th - 9th Standard',
- value: '6To9'
- },
- {
- text: '10th Standard and above',
- value: '10AndAbove'
- },
- {
- text: 'Graduate and above',
- value: 'graduate'
- }]
- },
- {
- xtype: 'datepickerfield',
- label: 'Date of Birth:',
- name: 'dateOfBirth',
- value: new Date(),
- picker: {
- yearFrom: 1930
- },
- clearIcon: true
- },
- {
- xtype: 'selectfield',
- name: 'caste',
- label: 'Caste',
- placeHolder: 'Select Caste',
- displayField: 'desc',
- options: [{
- desc: 'First',
- value: 'first'
- },
- {
- desc: 'Second',
- value: 'second'
- },
- {
- desc: 'Third',
- value: 'third'
- },
- {
- desc: 'Fourth',
- value: 'fourth'
- },
- {
- desc: 'Fifth',
- value: 'fifth'
- }]
- },
- {
- // TODO: temporary submit button
- xtype: 'button',
- text: '(Temp Button) create Patient',
- action: 'createPatient'
- }]
- }]
- }
-});
-
@@ -1,68 +0,0 @@
-Ext.define('RaxaEmr.Registration.view.PatientScreen2', {
- extend: 'Ext.Container',
-
- config: {
- title: 'Patient Communication Information',
- styleHtmlContent: true,
- xtype: 'patientScreen2',
- autoscroll: true,
-
- items: [{
- xtype: 'fieldset',
- title: 'Patient Communication Information',
- align: 'center',
- centered: true,
- items: [{
- xtype: 'textfield',
- label: 'Block/House/Door #',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Street/Area/Locality/Mohalla/Road',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Town/Village/City',
- required: true
- },
- {
- xtype: 'textfield',
- label: 'Post Office',
- required: false
- },
- {
- xtype: 'textfield',
- label: 'Tehsil/Taluka/Mandal/Thana',
- required: false
- },
- {
- xtype: 'textfield',
- label: 'District',
- required: false
- },
- {
- xtype: 'selectfield',
- label: 'Contact me via phone',
- options: [{
- text: 'Yes',
- value: 'yes'
- },
- {
- text: 'No',
- value: 'no'
- }]
- },
- {
- xtype: 'textfield',
- label: 'Primary Phone'
- },
- {
- xtype: 'textfield',
- label: 'Secondary Phone'
- }]
- }]
- }
-});
-
Oops, something went wrong.

0 comments on commit 2231f3d

Please sign in to comment.