@Controller
public class ShortPatientFormController
extends java.lang.Object
PatientFormController
Constructor and Description |
---|
ShortPatientFormController() |
Modifier and Type | Method and Description |
---|---|
Location |
getDefaultLocation() |
boolean |
getIdentifierLocationUsed() |
java.util.List<PatientIdentifierType> |
getIdentifierTypes() |
java.util.List<Location> |
getLocations() |
ShortPatientModel |
getPatientModel(java.lang.Integer patientId,
org.springframework.ui.ModelMap model,
org.springframework.web.context.request.WebRequest request) |
static java.lang.String |
getPersonNameString(PersonName name)
Convenience method that transforms a person name to a string while ignoring null and blank
values, the returned string only contains the givenName, middleName and familyName
|
java.lang.String |
saveShortPatient(org.springframework.web.context.request.WebRequest request,
PersonName personNameCache,
PersonAddress personAddressCache,
java.util.Map<java.lang.String,Relationship> relationshipsMap,
ShortPatientModel patientModel,
org.springframework.validation.BindingResult result)
Handles the form submission by validating the form fields and saving it to the DB
|
void |
showForm() |
@RequestMapping(method=GET, value="/admin/patients/shortPatientForm") public void showForm()
@ModelAttribute(value="patientModel") public ShortPatientModel getPatientModel(@RequestParam(value="patientId",required=false) java.lang.Integer patientId, org.springframework.ui.ModelMap model, org.springframework.web.context.request.WebRequest request)
@ModelAttribute(value="locations") public java.util.List<Location> getLocations()
@ModelAttribute(value="defaultLocation") public Location getDefaultLocation()
@ModelAttribute(value="identifierTypes") public java.util.List<PatientIdentifierType> getIdentifierTypes()
@ModelAttribute(value="identifierLocationUsed") public boolean getIdentifierLocationUsed()
@RequestMapping(method=POST, value="/admin/patients/shortPatientForm") public java.lang.String saveShortPatient(org.springframework.web.context.request.WebRequest request, @ModelAttribute(value="personNameCache") PersonName personNameCache, @ModelAttribute(value="personAddressCache") PersonAddress personAddressCache, @ModelAttribute(value="relationshipsMap") java.util.Map<java.lang.String,Relationship> relationshipsMap, @ModelAttribute(value="patientModel") ShortPatientModel patientModel, org.springframework.validation.BindingResult result)
request
- the webRequest objectrelationshipsMap
- patientModel
- the modelObject containing the patient info collected from the form
fieldsresult
- status
- public static java.lang.String getPersonNameString(PersonName name)
name
- the person name to transformCopyright © 2018 OpenMRS Inc.. All Rights Reserved.