@Controller public class ShortPatientFormController extends Object
PatientFormController
Constructor and Description |
---|
ShortPatientFormController() |
Modifier and Type | Method and Description |
---|---|
Location |
getDefaultLocation() |
boolean |
getIdentifierLocationUsed() |
List<PatientIdentifierType> |
getIdentifierTypes() |
List<Location> |
getLocations() |
ShortPatientModel |
getPatientModel(Integer patientId,
org.springframework.ui.ModelMap model,
org.springframework.web.context.request.WebRequest request) |
static 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
|
String |
saveShortPatient(org.springframework.web.context.request.WebRequest request,
PersonName personNameCache,
PersonAddress personAddressCache,
Map<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) Integer patientId, org.springframework.ui.ModelMap model, org.springframework.web.context.request.WebRequest request)
@ModelAttribute(value="defaultLocation") public Location getDefaultLocation()
@ModelAttribute(value="identifierTypes") public List<PatientIdentifierType> getIdentifierTypes()
@ModelAttribute(value="identifierLocationUsed") public boolean getIdentifierLocationUsed()
@RequestMapping(method=POST, value="/admin/patients/shortPatientForm") public String saveShortPatient(org.springframework.web.context.request.WebRequest request, @ModelAttribute(value="personNameCache") PersonName personNameCache, @ModelAttribute(value="personAddressCache") PersonAddress personAddressCache, @ModelAttribute(value="relationshipsMap") Map<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
- public static String getPersonNameString(PersonName name)
name
- the person name to transformCopyright © 2015 OpenMRS Inc.. All rights reserved.