Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5147

Show
Ignore:
Timestamp:
08/03/08 22:10:35 (5 months ago)
Author:
sunbiz
Message:

registration: Register patient successful

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/registration/web/module/registerPatientForm.jsp

    r5131 r5147  
    22<openmrs:require privilege="Add Patients" otherwise="/login.htm" redirect="/module/registration/registration.form" /> 
    33<%@ include file="/WEB-INF/template/header.jsp"%> 
    4  
     4<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 
    55<script type="text/javascript" src="/openmrs/moduleResources/registration/scripts/jquery-1.2.6.js"></script> 
    66<script type="text/javascript" src="/openmrs/moduleResources/registration/scripts/registerPatient.js"></script> 
     
    1515<h2><spring:message code="registration.msg.newPatientWelcome"/></h2> 
    1616<openmrs:globalProperty key="registration.allowIDEntry" defaultValue="false" var="allowIDEntry"/> 
    17 <form method="post" commandName="patient" > 
     17<form:form commandName="patient" > 
    1818  <table cellspacing="0" cellpadding="7"> 
    1919    <tr> 
     
    4747              <tbody id="identifiersTbody"> 
    4848                <tr> 
    49                   <td id="loadedID">1MUM-6</td> 
     49                  <td id="loadedID"></td> 
    5050                </tr> 
    5151              </tbody> 
     
    6363                <tr> 
    6464                  <td> <input type="text" name="identifier" size="30"/> </td> 
    65                   <td> <select name="identifierType"> <option value="2"> Old Identification Number </option> <option value="1"> OpenMRS Identification Number </option> </select> </td> 
    66                   <td> <select name="location"> <option value=""/>  <option value="1"> Unknown Location </option> </select> </td> 
     65                  <td> <select name="identifierType"> <option value="2"> Old Identification Number </option> <option 
     66                    value="1"> OpenMRS Identification Number </option> </select> </td> 
     67                  <td> <select name="location"> <option value=""/>  <option value="1"> Unknown Location </option> 
     68                  </select> </td> 
    6769                  <td align="center" valign="middle"> <input type="radio" value="" name="preferred"/> </td> 
    68                   <td align="center" valign="middle"> <input class="closeButton" type="button" value="Remove" name="closeButton"/> </td> 
     70                  <td align="center" valign="middle"> <input class="closeButton" type="button" value="Remove" 
     71                                                             name="closeButton"/> </td> 
    6972                </tr> 
    7073              </tbody> 
     
    7780      <th class="headerCell"><spring:message code="registration.labels.demographics"/></th> 
    7881      <td class="inputCell"> 
    79         <table> 
    80           <thead> 
    81             <th><spring:message code="registration.labels.gender"/></th> 
    82             <th><spring:message code="registration.labels.age"/></th> 
    83             <th><spring:message code="registration.labels.birthdate"/> <i style="font-weight: normal; font-size: 0.8em;">(Format: mm/dd/yyyy)</i> </th> 
    84             <th><spring:message code="registration.labels.tribe"/></th> 
    85           </thead> 
    86           <tbody> 
    87             <tr> 
    88               <td style="padding-right: 3em;"> 
    89                 <c:choose> 
    90                   <c:when test="${patient.gender == 'M'}"> 
    91                     <input id="M" type="radio" checked="" value="M" name="gender"/> <label for="M"> Male </label> 
    92                     <input id="F" type="radio" value="F" name="gender"/> <label for="F"> Female </label> 
    93                   </c:when> 
    94                   <c:otherwise> 
    95                     <input id="M" type="radio" value="M" name="gender"/> <label for="M"> Male </label> 
    96                     <input id="F" type="radio" checked="" value="F" name="gender"/> <label for="F"> Female </label> 
    97                   </c:otherwise> 
    98                 </c:choose> 
    99               </td> 
    100               <td style="padding-right: 3em;"> 
    101                 <span id="age"></span> 
    102               </td> 
    103               <td style="padding-right: 3em;"> 
    104                 <input id="i18n" type="text" value="${patient.birthdateString}" size="10" name="birthdate" autocomplete="off" onchange="changeAge()" /> 
    105                 <span id="birthdateEstimatedCheckbox" class="" style="padding: 5px;"> 
    106                   <label for="birthdateEstimatedInput">Estimated</label> 
    107                   <input type="hidden" name="_birthdateEstimated"/> 
    108                   <input id="birthdateEstimatedInput" type="checkbox" onclick="if (!this.checked) updateEstimated()" value="true" name="birthdateEstimated"/> 
    109                 </span> 
    110               </td> 
    111               <td> <select name="tribe"> <option value=""/> <option value="1"> Unknown </option> </select> </td> 
    112             </tr> 
    113           </tbody> 
    114         </table> 
    115       </td> 
     82      <table> 
     83        <thead> 
     84          <th><spring:message code="registration.labels.gender"/></th> 
     85          <th><spring:message code="registration.labels.age"/></th> 
     86          <th><spring:message code="registration.labels.birthdate"/> <i style="font-weight: normal; font-size: 
     87          0.8em;">(Format: mm/dd/yyyy)</i> </th> 
     88          <th><spring:message code="registration.labels.tribe"/></th> 
     89        </thead> 
     90        <tbody> 
     91          <tr> 
     92          <td style="padding-right: 3em;"> 
     93            <c:choose> 
     94              <c:when test="${patient.gender == 'M'}"> 
     95                <input id="M" type="radio" checked="" value="M" name="gender"/> <label for="M"> Male </label> 
     96                <input id="F" type="radio" value="F" name="gender"/> <label for="F"> Female </label> 
     97              </c:when> 
     98              <c:when test="${patient.gender == 'F'}"> 
     99                <input id="M" type="radio" value="M" name="gender"/> <label for="M"> Male </label> 
     100                <input id="F" type="radio" checked="" value="F" name="gender"/> <label for="F"> Female </label> 
     101              </c:when> 
     102            </c:choose> 
     103          </td> 
     104          <td style="padding-right: 3em;"> 
     105            <span id="age"> </span> 
     106          </td> 
     107          <td> 
     108            <input id="i18n" type="text" value="${patient.birthdateString}" size="10" name="birthdateString" 
     109                   autocomplete="off" onchange="changeAge()" /> 
     110            <span id="birthdateEstimatedCheckbox" class="" style="padding: 5px;"> 
     111              <label for="birthdateEstimatedInput">Estimated</label> 
     112              <input type="hidden" name="_birthdateEstimated"/> 
     113              <input id="birthdateEstimatedInput" type="checkbox" onclick="if (!this.checked) updateEstimated()" 
     114                     value="true" name="birthdateEstimated"/> 
     115            </span> 
     116          </td> 
     117          <td> <select name="group"> <option value=""/> <option value="1"> Unknown </option> </select> </td> 
     118        </tbody> 
     119      </table> 
    116120    </tr> 
    117121    <tr> 
     
    122126            <tr> 
    123127              <td><spring:message code="registration.labels.address"/></td> 
    124               <td colspan="7"> <input type="text" size="40" value="" name="address.address1"/> </td> 
     128              <td colspan="7"> <input type="text" size="40" value="${patient.address.address1}" name="address.address1"/> </td> 
    125129            </tr> 
    126130            <tr> 
    127131              <td><spring:message code="registration.labels.address2"/></td> 
    128               <td colspan="7"> <input type="text" size="40" value="" name="address.address2"/> </td> 
     132              <td colspan="7"> <input type="text" size="40" value="${patient.address.address2}" name="address.address2"/> </td> 
    129133            </tr> 
    130134            <tr> 
    131135              <td><spring:message code="registration.labels.cityVillage"/></td> 
    132               <td> <input type="text" size="10" value="" name="address.cityVillage"/> </td> 
     136              <td> <input type="text" size="10" value="${patient.address.cityVillage}" name="address.cityVillage"/> </td> 
    133137              <td><spring:message code="registration.labels.stateProvince"/></td> 
    134               <td> <input type="text" size="10" value="" name="address.stateProvince"/> </td> 
     138              <td> <input type="text" size="10" value="${patient.address.stateProvince}" name="address.stateProvince"/> </td> 
    135139              <td><spring:message code="registration.labels.country"/></td> 
    136               <td> <input type="text" size="10" value="" name="address.country"/> </td> 
     140              <td> <input type="text" size="10" value="${patient.address.country}" name="address.country"/> </td> 
    137141              <td><spring:message code="registration.labels.postalCode" /></td> 
    138               <td colspan="1"> <input type="text" size="10" value="" name="address.postalCode"/> </td> 
     142              <td colspan="1"> <input type="text" size="10" value="${patient.address.postalCode}" name="address.postalCode"/> </td> 
    139143            </tr> 
    140144            <tr> 
    141145              <td><spring:message code="registration.labels.latitude" /></td> 
    142               <td> <input type="text" size="10" value="" name="address.latitude"/> </td> 
     146              <td> <input type="text" size="10" value="${patient.address.latitude}" name="address.latitude"/> </td> 
    143147              <td><spring:message code="registration.labels.longitude" /></td> 
    144               <td colspan="5"> <input type="text" size="10" value="" name="address.longitude"/> </td> 
     148              <td colspan="5"> <input type="text" size="10" value="${patient.address.longitude}" name="address.longitude"/> </td> 
    145149            </tr> 
    146150          </tbody> 
     
    156160        <div id="deathInformation" style=""> 
    157161          <b><spring:message code="registration.labels.deathDate" /></b> 
    158           <input id="i18n" type="text" value="" size="10" name="deathDate" autocomplete="off"/> 
     162          <input id="deathPicker" type="text" value="${patient.deathdate}" size="10" name="deathDate" autocomplete="off"/> 
    159163          <i style="font-weight: normal; font-size: 0.8em;">(Format: mm/dd/yyyy)</i> 
    160164          <spring:message code="registration.msg.causeMessage" /><span id="causeOfDeath_selection"> </span> 
     
    164168    <tr><td>&nbsp;</td></tr> 
    165169    <tr> 
    166       <td><input type="submit" value="<spring:message code="registration.labels.saveButton" /> " /></td><td><input type="reset" value="<spring:message code="registration.labels.resetButton" />" ></td> 
     170      <td><input type="submit" value="<spring:message code="registration.labels.saveButton"/>"/></td><td><input type="reset" value="<spring:message code="registration.labels.resetButton" />" ></td> 
    167171    </tr> 
    168172  </table> 
    169 </form
     173</form:form
    170174<%@ include file="/WEB-INF/template/footer.jsp"%> 
  • openmrs-modules/registration/web/module/resources/scripts/registerPatient.js

    r5116 r5147  
    22    $("#deathInformation").hide(); 
    33    $("#i18n").datepicker($.extend({}, 
     4        $.datepicker.regional[''], { 
     5            showStatus: true, 
     6            showOn: "both", 
     7            buttonImage: "/openmrs/moduleResources/registration/images/calendar.gif", 
     8            buttonImageOnly: true 
     9        })); 
     10    $("#deathPicker").datepicker($.extend({}, 
    411        $.datepicker.regional[''], { 
    512            showStatus: true, 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/model/RegisterPatientModel.java

    r5131 r5147  
    1515 
    1616import java.util.Date; 
    17 import java.util.HashMap; 
    18 import java.util.Map; 
    19 import org.openmrs.Concept; 
    20 import org.openmrs.Patient; 
    2117import org.openmrs.PatientIdentifier; 
    2218import org.openmrs.PersonAddress; 
    23 import org.openmrs.PersonAttribute; 
    2419import org.openmrs.PersonName; 
     20import org.openmrs.Tribe; 
    2521 
     22 
     23//<editor-fold defaultstate="collapsed"> 
    2624public class RegisterPatientModel { 
    2725 
    28     private Integer patientId; 
    29     private String identifier = ""; 
    30     private String otherIdentifiers = ""; 
    3126    private PersonName name = new PersonName(); 
    32     private String otherNames = ""; 
    33     private String gender=""; 
    34     private String tribe = ""; 
    35     private Date birthdate=null; 
     27    private PatientIdentifier identifier = new PatientIdentifier(); 
     28    private String gender = ""; 
     29    private Tribe tribe = null; 
     30    private Date birthdate = new Date(); 
     31    private Date deathdate = new Date(); 
    3632    private String birthdateString = ""; 
    3733    private Boolean birthdateEstimated = false; 
    3834    private PersonAddress address = new PersonAddress(); 
    39     private Boolean voided = false; 
    40     private Boolean dead = false; 
    41     private Concept causeOfDeath = null; 
    42     private Date deathDate = null; 
    43     private Map<String, PersonAttribute> attributeMap = null; 
    4435 
    4536    public RegisterPatientModel() { 
     37        super(); 
    4638        System.out.println("Inside Default Constructor"); 
    4739    } 
    4840 
    49     public RegisterPatientModel(Patient patient) { 
    50         this(); 
    51         if (patient != null) { 
    52             patientId = patient.getPatientId(); 
    53  
    54             // get patient's identifiers 
    55             boolean first = true; 
    56             for (PatientIdentifier pi : patient.getIdentifiers()) { 
    57                 if (first) { 
    58                     identifier = pi.getIdentifier(); 
    59                     first = false; 
    60                 } else { 
    61                     if (otherIdentifiers.equals("")) { 
    62                         otherIdentifiers += ","; 
    63                     } 
    64                     otherIdentifiers += " " + pi.getIdentifier(); 
    65                 } 
    66             } 
    67             first = true; 
    68             for (PersonName pn : patient.getNames()) { 
    69                 if (first) { 
    70                     setName(pn); 
    71                     first = false; 
    72                 } else { 
    73                     if (otherNames.equals("")) { 
    74                         otherNames += ","; 
    75                     } 
    76                     otherNames += " " + pn.getGivenName() + " " + pn.getMiddleName() + " " + pn.getFamilyName(); 
    77                 } 
    78             } 
    79  
    80             gender = patient.getGender(); 
    81             if (patient.getTribe() != null) { 
    82                 tribe = patient.getTribe().getName(); 
    83             } 
    84  
    85             birthdate = patient.getBirthdate(); 
    86             birthdateEstimated = patient.isBirthdateEstimated(); 
    87             voided = patient.isVoided(); 
    88             dead = patient.isDead(); 
    89             causeOfDeath = patient.getCauseOfDeath(); 
    90             deathDate = patient.getDeathDate(); 
    91             address = patient.getPersonAddress(); 
    92             attributeMap = new HashMap<String, PersonAttribute>(); 
    93             for (PersonAttribute attribute : patient.getActiveAttributes()) { 
    94                 attributeMap.put(attribute.getAttributeType().getName(), attribute); 
    95             } 
    96         } 
     41    public PersonName getName() { 
     42        return this.name; 
    9743    } 
    9844 
    99     /** 
    100      * @return the patientId 
    101      */ 
    102     public Integer getPatientId() { 
    103         return patientId; 
    104     } 
    105  
    106     /** 
    107      * @param patientId the patientId to set 
    108      */ 
    109     public void setPatientId(Integer patientId) { 
    110         this.patientId = patientId; 
    111     } 
    112  
    113     /** 
    114      * @return the identifier 
    115      */ 
    116     public String getIdentifier() { 
    117         return identifier; 
    118     } 
    119  
    120     /** 
    121      * @param identifier the identifier to set 
    122      */ 
    123     public void setIdentifier(String identifier) { 
    124         this.identifier = identifier; 
    125     } 
    126  
    127     /** 
    128      * @return the otherIdentifiers 
    129      */ 
    130     public String getOtherIdentifiers() { 
    131         return otherIdentifiers; 
    132     } 
    133  
    134     /** 
    135      * @param otherIdentifiers the otherIdentifiers to set 
    136      */ 
    137     public void setOtherIdentifiers(String otherIdentifiers) { 
    138         this.otherIdentifiers = otherIdentifiers; 
    139     } 
    140  
    141     /** 
    142      * @return the name 
    143      */ 
    144     public PersonName getName() { 
    145         return name; 
    146     } 
    147  
    148     /** 
    149      * @param name the name to set 
    150      */ 
    15145    public void setName(PersonName name) { 
    15246        this.name = name; 
    15347    } 
    15448 
    155     /** 
    156      * @return the otherNames 
    157      */ 
    158     public String getOtherNames() { 
    159         return otherNames; 
     49    public PatientIdentifier getIdentifier() { 
     50        return this.identifier; 
    16051    } 
    16152 
    162     /** 
    163      * @param otherNames the otherNames to set 
    164      */ 
    165     public void setOtherNames(String otherNames) { 
    166         this.otherNames = otherNames; 
     53    public void setIdentifier(PatientIdentifier identifier) { 
     54        this.identifier = identifier; 
    16755    } 
    16856 
    169     /** 
    170      * @return the gender 
    171      */ 
    172     public String getGender() { 
    173         return gender; 
    174     } 
    175  
    176     /** 
    177      * @param gender the gender to set 
    178      */ 
    17957    public void setGender(String gender) { 
    18058        this.gender = gender; 
    18159    } 
    18260 
    183     /** 
    184      * @return the tribe 
    185      */ 
    186     public String getTribe() { 
    187         return tribe; 
     61    public String getGender() { 
     62        return this.gender; 
    18863    } 
    18964 
    190     /** 
    191      * @param tribe the tribe to set 
    192      */ 
    193     public void setTribe(String tribe) { 
     65    public void setTribe(Tribe tribe) { 
    19466        this.tribe = tribe; 
    19567    } 
    19668 
    197     /** 
    198      * @return the birthdate 
    199      */ 
    200     public Date getBirthdate() { 
    201         return birthdate; 
     69    public Tribe getTribe() { 
     70        return this.tribe; 
    20271    } 
    20372 
    204     /** 
    205      * @param birthdate the birthdate to set 
    206      */ 
    20773    public void setBirthdate(Date birthdate) { 
    20874        this.birthdate = birthdate; 
    20975    } 
    21076 
    211     /** 
    212      * @return the birthdateString 
    213      */ 
    214     public String getBirthdateString() { 
    215         return birthdateString; 
     77    public Date getBirthdate() { 
     78        return this.birthdate; 
    21679    } 
    21780 
    218     /** 
    219      * @param birthdateString the birthdateString to set 
    220      */ 
    22181    public void setBirthdateString(String birthdateString) { 
    22282        this.birthdateString = birthdateString; 
    22383    } 
    22484 
    225     /** 
    226      * @return the birthdateEstimated 
    227      */ 
    228     public Boolean getBirthdateEstimated() { 
    229         return birthdateEstimated; 
     85    public String getBirthdateString() { 
     86        return this.birthdateString; 
    23087    } 
    23188 
    232     /** 
    233      * @param birthdateEstimated the birthdateEstimated to set 
    234      */ 
    23589    public void setBirthdateEstimated(Boolean birthdateEstimated) { 
    23690        this.birthdateEstimated = birthdateEstimated; 
    23791    } 
    23892 
    239     /** 
    240      * @return the address 
    241      */ 
    242     public PersonAddress getAddress() { 
    243         return address; 
     93    public Boolean getBirthdateEstimated() { 
     94        return this.birthdateEstimated; 
    24495    } 
    24596 
    246     /** 
    247      * @param address the address to set 
    248      */ 
    24997    public void setAddress(PersonAddress address) { 
    25098        this.address = address; 
    25199    } 
    252100 
    253     /** 
    254      * @return the voided 
    255      */ 
    256     public Boolean getVoided() { 
    257         return voided; 
     101    public PersonAddress getAddress() { 
     102        return this.address; 
    258103    } 
    259104 
    260     /** 
    261      * @param voided the voided to set 
    262      */ 
    263     public void setVoided(Boolean voided) { 
    264         this.voided = voided; 
     105    public Date getDeathdate() { 
     106        return deathdate; 
    265107    } 
    266108 
    267     /** 
    268      * @return the dead 
    269      */ 
    270     public Boolean getDead() { 
    271         return dead; 
    272     } 
    273  
    274     /** 
    275      * @param dead the dead to set 
    276      */ 
    277     public void setDead(Boolean dead) { 
    278         this.dead = dead; 
    279     } 
    280  
    281     /** 
    282      * @return the causeOfDeath 
    283      */ 
    284     public Concept getCauseOfDeath() { 
    285         return causeOfDeath; 
    286     } 
    287  
    288     /** 
    289      * @param causeOfDeath the causeOfDeath to set 
    290      */ 
    291     public void setCauseOfDeath(Concept causeOfDeath) { 
    292         this.causeOfDeath = causeOfDeath; 
    293     } 
    294  
    295     /** 
    296      * @return the deathDate 
    297      */ 
    298     public Date getDeathDate() { 
    299         return deathDate; 
    300     } 
    301  
    302     /** 
    303      * @param deathDate the deathDate to set 
    304      */ 
    305     public void setDeathDate(Date deathDate) { 
    306         this.deathDate = deathDate; 
    307     } 
    308  
    309     /** 
    310      * @return the attributeMap 
    311      */ 
    312     public Map<String, PersonAttribute> getAttributeMap() { 
    313         return attributeMap; 
    314     } 
    315  
    316     /** 
    317      * @param attributeMap the attributeMap to set 
    318      */ 
    319     public void setAttributeMap(Map<String, PersonAttribute> attributeMap) { 
    320         this.attributeMap = attributeMap; 
     109    public void setDeathdate(Date deathdate) { 
     110        this.deathdate = deathdate; 
    321111    } 
    322112} 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/RegisterPatientFormController.java

    r5131 r5147  
    1414package org.openmrs.module.registration.web.controller; 
    1515 
     16import java.text.SimpleDateFormat; 
    1617import java.util.Date; 
    1718import java.util.HashMap; 
     
    2021import javax.servlet.http.HttpServletRequest; 
    2122 
    22 import javax.servlet.http.HttpServletResponse; 
    2323import org.apache.commons.logging.Log; 
    2424import org.apache.commons.logging.LogFactory; 
     25import org.openmrs.Location; 
     26import org.openmrs.PatientIdentifier; 
     27import org.openmrs.PatientIdentifierType; 
     28import org.openmrs.PersonAddress; 
    2529import org.openmrs.PersonName; 
     30import org.openmrs.api.EncounterService; 
     31import org.openmrs.api.PatientService; 
     32import org.openmrs.api.PersonService; 
     33import org.openmrs.api.context.Context; 
    2634import org.openmrs.module.registration.model.RegisterPatientModel; 
    27 import org.springframework.validation.BindException; 
    2835import org.springframework.validation.Errors; 
    2936import org.springframework.web.servlet.ModelAndView; 
     
    5360    } 
    5461 
    55     /** 
    56      * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException) 
    57      */ 
    5862    @Override 
    59     protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { 
     63    protected ModelAndView onSubmit(Object command) throws Exception { 
    6064        System.out.println("===>>>Inside onSubmit"); 
    61         RegisterPatientModel patient = (RegisterPatientModel) command; 
    62         if (patient.getPatientId() != null) { 
    63             System.out.println("PatientID = " + patient.getPatientId()); 
    64         } 
    65         if (patient.getIdentifier() != null) { 
    66             System.out.println("Identifer = " + patient.getIdentifier()); 
    67         } 
    68         if (patient.getOtherIdentifiers() != null) { 
    69             System.out.println("Other IDs = " + patient.getOtherIdentifiers()); 
    70         } 
    71         if (patient.getName() != null) { 
    72             System.out.println("PersonName = " + patient.getName()); 
    73         } 
    74         if (patient.getGender() != null) { 
    75             System.out.println("Gender = " + patient.getGender()); 
    76         } 
     65 
     66        PersonService personService = Context.getPersonService(); 
     67        EncounterService encounterService = Context.getEncounterService(); 
     68        PatientService patientService = Context.getPatientService(); 
     69        org.openmrs.Patient openmrsPatient = new org.openmrs.Patient(); 
     70        RegisterPatientModel patientModel = ((RegisterPatientModel) command); 
     71        Location location = new Location(1); 
     72        PatientIdentifierType identType = patientService.getPatientIdentifierType(1); 
     73        PatientIdentifier patientIdentifier = new PatientIdentifier("18MUM-7", identType, location); 
     74        openmrsPatient.addIdentifier(patientIdentifier); 
     75 
     76        openmrsPatient.addName(patientModel.getName()); 
     77        openmrsPatient.setGender(patientModel.getGender()); 
     78        openmrsPatient.setTribe(patientModel.getTribe()); 
     79        openmrsPatient.setBirthdate(patientModel.getBirthdate()); 
     80        openmrsPatient.addAddress(patientModel.getAddress()); 
     81        openmrsPatient.setDeathDate(patientModel.getDeathdate()); 
     82        System.out.println("Tribe = " + patientModel.getTribe()); 
     83        System.out.println("deathDate = " + patientModel.getDeathdate()); 
     84        System.out.println("deathDate = " + openmrsPatient.getDeathDate()); 
     85        patientService.savePatient(openmrsPatient); 
    7786        return new ModelAndView(new RedirectView(getSuccessView())); 
    7887    } 
    7988 
    80     /** 
    81      * This class returns the form backing object.  This can be a string, a boolean, or a normal 
    82      * java pojo. 
    83      *  
    84      * The type can be set in the /config/moduleApplicationContext.xml file or it can be just 
    85      * defined by the return type of this method 
    86      *  
    87      * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
    88      */ 
    8989    @Override 
    9090    protected Object formBackingObject(HttpServletRequest request) throws Exception { 
     
    9292        RegisterPatientModel registerPatientModel = new RegisterPatientModel(); 
    9393        String name = request.getParameter("addName"); 
    94         String patientIdentifier = request.getParameter("identifier"); 
     94        //String patientIdentifier = request.getParameter("identifier"); 
    9595        if (name != null) { 
    9696            if (!name.equals("")) { 
     
    116116                registerPatientModel.setBirthdateString(birthDate); 
    117117                registerPatientModel.setBirthdate(new Date(birthDate)); 
     118            //registerPatientModel.setIdentifier(new PatientIdentifier("1MUM-6",new PatientIdentifierType(),new Location())); 
     119            //new PatientIdentifier().setIdentifier("1MUM-6"); 
     120            //String identifier = "1MUM-=6"; 
     121            //registerPatientModel.setIdentifier(identifier); 
    118122            } 
    119         } else if (patientIdentifier != null) { 
    120             if (!patientIdentifier.equals("")) { 
    121            
    122        
     123        } //else if (patientIdentifier != null) { 
     124        //if (!patientIdentifier.equals("")) { 
     125        //
     126        //
    123127        return registerPatientModel; 
    124128    } 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/RegistrationFormController.java

    r4904 r5147  
    5757    @Override 
    5858    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object object, BindException exceptions) throws Exception { 
    59         //HttpSession httpSession = request.getSession(); 
    60  
    6159        return new ModelAndView(new RedirectView(getSuccessView())); 
    6260    }