Search in sources :

Example 51 with Question

use of org.openmrs.module.registrationapp.model.Question in project openmrs-module-pihcore by PIH.

the class SectionsPeru method getEmailQuestion.

public Question getEmailQuestion() {
    Question q = new Question();
    q.setId("emailLabel");
    q.setLegend("zl.registration.patient.email.label");
    q.setHeader("zl.registration.patient.email.question");
    Field f = new Field();
    f.setFormFieldName("personAttributeType" + SesConfigConstants.PERSONATTRIBUTETYPE_ELECTRONIC_EMAIL_UUID);
    f.setUuid(SesConfigConstants.PERSONATTRIBUTETYPE_ELECTRONIC_EMAIL_UUID);
    f.setType("personAttribute");
    f.setWidget(getTextFieldWidget(254));
    q.addField(f);
    return q;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question)

Example 52 with Question

use of org.openmrs.module.registrationapp.model.Question 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;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question) DropdownWidget(org.openmrs.module.registrationapp.model.DropdownWidget)

Example 53 with Question

use of org.openmrs.module.registrationapp.model.Question 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;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question) DropdownWidget(org.openmrs.module.registrationapp.model.DropdownWidget)

Example 54 with Question

use of org.openmrs.module.registrationapp.model.Question 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;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) HashMap(java.util.HashMap) Question(org.openmrs.module.registrationapp.model.Question) AddressHierarchyLevel(org.openmrs.module.addresshierarchy.AddressHierarchyLevel) AddressHierarchyService(org.openmrs.module.addresshierarchy.service.AddressHierarchyService)

Example 55 with Question

use of org.openmrs.module.registrationapp.model.Question 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;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question)

Aggregations

Question (org.openmrs.module.registrationapp.model.Question)61 Field (org.openmrs.module.registrationapp.model.Field)60 AddressField (org.openmrs.module.addresshierarchy.AddressField)27 DropdownWidget (org.openmrs.module.registrationapp.model.DropdownWidget)16 HashMap (java.util.HashMap)9 AddressHierarchyLevel (org.openmrs.module.addresshierarchy.AddressHierarchyLevel)7 AddressHierarchyService (org.openmrs.module.addresshierarchy.service.AddressHierarchyService)7 ContactInfoConfigDescriptor (org.openmrs.module.pihcore.config.registration.ContactInfoConfigDescriptor)2 Section (org.openmrs.module.registrationapp.model.Section)2 ContactPersonConfigDescriptor (org.openmrs.module.pihcore.config.registration.ContactPersonConfigDescriptor)1