@Controller public class ShortPatientFormController extends Object
PatientFormController
Constructor and Description |
---|
ShortPatientFormController() |
Modifier and Type | Method and Description |
---|---|
Location |
getDefaultLocation() |
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,
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()
@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="patientModel") ShortPatientModel patientModel, org.springframework.validation.BindingResult result)
request
- the webRequest objectpatientModel
- the modelObject containing the patient info collected from the form
fieldsresult
- status
- public static String getPersonNameString(PersonName name)
name
- the person name to transformCopyright © 2018 OpenMRS LLC.. All Rights Reserved.