use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsDefault method getMothersNameQuestion.
public Question getMothersNameQuestion() {
Question q = new Question();
q.setId("mothersFirstNameLabel");
q.setLegend("zl.registration.patient.mothersFirstName.label");
q.setHeader("zl.registration.patient.mothersFirstName.question");
Field f = new Field();
f.setFormFieldName("mothersFirstName");
f.setType("personAttribute");
f.setUuid(PihEmrConfigConstants.PERSONATTRIBUTETYPE_MOTHERS_FIRST_NAME_UUID);
f.setWidget(getTextFieldWidget());
if (config.getRegistrationConfig().getDemographics().getMothersName().getRequired()) {
f.setCssClasses(Arrays.asList("required"));
}
q.addField(f);
return q;
}
use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsDefault method getTelephoneNumberQuestion.
public Question getTelephoneNumberQuestion() {
Question q = new Question();
q.setId("phoneNumberLabel");
q.setLegend("registrationapp.patient.phone.label");
q.setHeader("registrationapp.patient.phone.question");
Field f = new Field();
f.setFormFieldName("phoneNumber");
f.setType("personAttribute");
f.setUuid(Metadata.getPhoneNumberAttributeType().getUuid());
ContactInfoConfigDescriptor contactInfoConfig = config.getRegistrationConfig().getContactInfo();
if (contactInfoConfig != null && contactInfoConfig.getPhoneNumber() != null && StringUtils.isNotBlank(contactInfoConfig.getPhoneNumber().getRegex())) {
f.setCssClasses(Arrays.asList("regex"));
f.setWidget(getTextFieldWidget(null, contactInfoConfig.getPhoneNumber().getRegex()));
} else {
f.setWidget(getTextFieldWidget());
}
q.addField(f);
return q;
}
use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsDefault method getContactPhoneNumber.
public Question getContactPhoneNumber() {
Question q = new Question();
q.setId("contactPhoneNumberQuestionLabel");
q.setHeader("zl.registration.patient.contactPerson.phonenumber.question");
q.setLegend("zl.registration.patient.contactPerson.phonenumber.label");
{
Field f = new Field();
f.setFormFieldName("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:TELEPHONE NUMBER OF CONTACT");
f.setLabel("registrationapp.patient.phone.label");
f.setType("obsgroup");
ContactPersonConfigDescriptor contactPersonConfig = config.getRegistrationConfig().getContactPerson();
if (contactPersonConfig != null && contactPersonConfig.getRequired() == true) {
f.setCssClasses(Arrays.asList("required"));
}
if (contactPersonConfig != null && contactPersonConfig.getPhoneNumber() != null && StringUtils.isNotBlank(contactPersonConfig.getPhoneNumber().getRegex())) {
f.setCssClasses(Arrays.asList("regex"));
f.setWidget(getTextFieldWidget(30, contactPersonConfig.getPhoneNumber().getRegex()));
} else {
f.setWidget(getTextFieldWidget(30));
}
q.addField(f);
}
return q;
}
use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsPeru method getAddressQuestion.
public Question getAddressQuestion() {
Question q = new Question();
q.setId("personAddressQuestion");
q.setLegend("registrationapp.patient.address");
q.setHeader("registrationapp.patient.address.question");
Field f = new Field();
f.setType("personAddress");
// If there are address hierarchy levels configured, use the address hierarchy widget, otherwise use the standard address widget
List<AddressHierarchyLevel> levels = Context.getService(AddressHierarchyService.class).getAddressHierarchyLevels();
if (levels != null && levels.size() > 0) {
q.setDisplayTemplate(getAddressHierarchyDisplayTemplate(levels));
f.setWidget(getAddressHierarchyWidget(levels, null, true));
} else {
Map<String, String> m = new HashMap<String, String>();
m.put("providerName", "uicommons");
m.put("fragmentId", "field/personAddress");
f.setWidget(toObjectNode(m));
}
q.addField(f);
return q;
}
use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsPeru method getTelephoneNumberQuestion.
public Question getTelephoneNumberQuestion() {
Question q = new Question();
q.setId("phoneNumberLabel");
q.setLegend("registrationapp.patient.phone.label");
q.setHeader("registrationapp.patient.phone.question");
Field f = new Field();
f.setFormFieldName("phoneNumber");
f.setType("personAttribute");
f.setUuid(Metadata.getPhoneNumberAttributeType().getUuid());
ContactInfoConfigDescriptor contactInfoConfig = config.getRegistrationConfig().getContactInfo();
if (contactInfoConfig != null && contactInfoConfig.getPhoneNumber() != null && StringUtils.isNotBlank(contactInfoConfig.getPhoneNumber().getRegex())) {
f.setCssClasses(Arrays.asList("regex"));
f.setWidget(getTextFieldWidget(null, contactInfoConfig.getPhoneNumber().getRegex()));
} else {
f.setWidget(getTextFieldWidget());
}
q.addField(f);
return q;
}
Aggregations