use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsPeru method getLevelOfStudyQuestion.
public Question getLevelOfStudyQuestion() {
Question q = new Question();
q.setId("levelOfStudyLabel");
q.setLegend("zl.registration.patient.levelOfStudy.label");
q.setHeader("zl.registration.patient.levelOfStudy.question");
Field f = new Field();
f.setFormFieldName("obs.PIH:HIGHEST LEVEL OF SCHOOL COMPLETED");
f.setType("obs");
DropdownWidget w = new DropdownWidget();
w.getConfig().addOption("PIH:NONE", "pihcore.none.label");
w.getConfig().addOption("PIH:PRIMARY EDUCATION COMPLETE", "zl.registration.patient.levelOfStudy.primary.label");
w.getConfig().addOption("PIH:SECONDARY EDUCATION COMPLETE", "zl.registration.patient.levelOfStudy.secondary.label");
w.getConfig().addOption("PIH:PROFESSIONAL", "zl.registration.patient.levelOfStudy.tertiary.label");
// Superior
w.getConfig().addOption("CIEL:159785", "zl.registration.patient.levelOfStudy.superior.label");
w.getConfig().setExpanded(true);
f.setWidget(toObjectNode(w));
q.addField(f);
return q;
}
use of org.openmrs.module.registrationapp.model.Field in project openmrs-module-pihcore by PIH.
the class SectionsPeru method getIdentityGender.
public Question getIdentityGender() {
Question q = new Question();
q.setId("IdentityGender");
q.setLegend("zl.registration.patient.IdentityGender.label");
q.setHeader("zl.registration.patient.IdentityGender.question");
{
Field f = new Field();
f.setFormFieldName("obs.PIH:Gender identity");
f.setType("obs");
DropdownWidget w = new DropdownWidget();
w.getConfig().addOption("PIH:2843", "zl.registration.patient.IdentityGender.Male");
w.getConfig().addOption("PIH:2844", "zl.registration.patient.IdentityGender.Female");
w.getConfig().addOption("PIH:13683", "zl.registration.patient.IdentityGender.TransMan");
w.getConfig().addOption("PIH:13684", "zl.registration.patient.IdentityGender.TransWoman");
w.getConfig().addOption("PIH:13685", "zl.registration.patient.IdentityGender.GenderNon");
w.getConfig().addOption("PIH:OTHER NON-CODED", "zl.registration.patient.occupation.other.label");
w.getConfig().setExpanded(true);
f.setWidget(toObjectNode(w));
q.addField(f);
}
{
Field f = new Field();
f.setFormFieldName("obs.PIH:13700");
f.setLabel("zl.ifOtherSpecify");
f.setType("obs");
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 SectionsDefault 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 SectionsDefault method getIsIndigenousQuestion.
public Question getIsIndigenousQuestion() {
Question q = new Question();
q.setId("isIndigenousLabel");
q.setLegend("zl.registration.patient.isIndigenous.label");
q.setHeader("zl.registration.patient.isIndigenous.question");
Field f = new Field();
f.setFormFieldName("obs.PIH:Indigenous");
f.setType("obs");
f.setWidget(getYesNoDropdownWidget());
if (config.getRegistrationConfig().getSocial().getIsIndigenous().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 getBirthplaceQuestion.
public Question getBirthplaceQuestion() {
Question q = new Question();
q.setId("birthplaceLabel");
q.setHeader("zl.registration.patient.birthplace.question");
q.setLegend("zl.registration.patient.birthplace.label");
Field f = new Field();
f.setFormFieldName("obs.PIH:PLACE OF BIRTH");
f.setType("obs");
f.setWidget(getTextFieldWidget(50));
q.addField(f);
return q;
}
Aggregations