Search in sources :

Example 41 with Field

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

the class SectionsMexico method getOccupationQuestion.

@Override
public Question getOccupationQuestion() {
    Question q = new Question();
    q.setId("occupationLabel");
    q.setLegend("zl.registration.patient.occupation.label");
    q.setHeader("zl.registration.patient.occupation.question");
    Field f = new Field();
    f.setFormFieldName("obs.PIH:Occupation");
    f.setType("obs");
    DropdownWidget w = new DropdownWidget();
    // ordered alphabetically in Spanish, with Unemployed and Other last
    // Agricultur
    w.getConfig().addOption("PIH:FARMER", "zl.registration.patient.occupation.farmer.label");
    // Ama de casa
    w.getConfig().addOption("PIH:HOUSEWORK/FIELDWORK", "zl.registration.patient.occupation.houseworkFieldwork.label");
    // Carpintero
    w.getConfig().addOption("PIH:MANUAL LABORER", "zl.registration.patient.occupation.manualLaborer.label");
    // Chofeur
    w.getConfig().addOption("PIH:DRIVER", "zl.registration.patient.occupation.driver.label");
    // Commercial
    w.getConfig().addOption("PIH:COMMERCE", "zl.registration.patient.occupation.commerce.label");
    // Estudiante
    w.getConfig().addOption("PIH:STUDENT", "zl.registration.patient.occupation.student.label");
    // Maestro
    w.getConfig().addOption("PIH:Teacher", "zl.registration.patient.occupation.teacher.label");
    // Militar
    w.getConfig().addOption("PIH:Military", "zl.registration.patient.occupation.military.label");
    // Obrero
    w.getConfig().addOption("PIH:FACTORY WORKER", "zl.registration.patient.occupation.factoryWorker.label");
    // Pescador
    w.getConfig().addOption("CIEL:159674", "zl.registration.patient.occupation.fisherman.label");
    // Policia
    w.getConfig().addOption("PIH:Police", "zl.registration.patient.occupation.police.label");
    // Profesional
    w.getConfig().addOption("PIH:PROFESSIONAL", "zl.registration.patient.occupation.professional.label");
    // Profesional...
    w.getConfig().addOption("PIH:HEALTH CARE WORKER", "zl.registration.patient.occupation.healthCareWorker.label");
    // Vaquero
    w.getConfig().addOption("PIH:Cowherd", "zl.registration.patient.occupation.cowherd.label");
    w.getConfig().addOption("PIH:RETIRED", "zl.registration.patient.occupation.retired.label");
    w.getConfig().addOption("PIH:OTHER NON-CODED", "zl.registration.patient.occupation.other.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 42 with Field

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

the class SectionsMexico method getRelationshipsSection.

private Section getRelationshipsSection() {
    Section s = new Section();
    s.setId("relationshipsInfo");
    s.setLabel("registrationapp.person.relationship");
    Question q = new Question();
    q.setId("relationshipsInfoQuestion");
    q.setLegend("registrationapp.person.relationship.label");
    q.setHeader("registrationapp.person.relationship.question");
    Field f = new Field();
    f.setType("personRelationships");
    Map<String, String> m = new HashMap<String, String>();
    m.put("providerName", "registrationapp");
    m.put("fragmentId", "field/personRelationship");
    f.setWidget(toObjectNode(m));
    q.addField(f);
    s.addQuestion(q);
    return s;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) HashMap(java.util.HashMap) Question(org.openmrs.module.registrationapp.model.Question) Section(org.openmrs.module.registrationapp.model.Section)

Example 43 with Field

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

the class SectionsSierraLeone method getOccupationQuestion.

@Override
public Question getOccupationQuestion() {
    Question q = new Question();
    q.setId("occupationLabel");
    q.setLegend("zl.registration.patient.occupation.label");
    q.setHeader("zl.registration.patient.occupation.question");
    Field f = new Field();
    f.setFormFieldName("obs.PIH:Occupation");
    f.setType("obs");
    DropdownWidget w = new DropdownWidget();
    // ordered alphabetically with Unemployed and Other last
    w.getConfig().addOption("CIEL:162944", "zl.registration.patient.occupation.civilServant.label");
    w.getConfig().addOption("PIH:COMMERCE", "zl.registration.patient.occupation.commerce.label");
    w.getConfig().addOption("PIH:Commercial bike rider", "zl.registration.patient.occupation.motorcycletaxi");
    w.getConfig().addOption("PIH:Cowherd", "zl.registration.patient.occupation.cowherd.label");
    w.getConfig().addOption("PIH:DRIVER", "zl.registration.patient.occupation.driver.label");
    w.getConfig().addOption("PIH:FACTORY WORKER", "zl.registration.patient.occupation.factoryWorker.label");
    w.getConfig().addOption("PIH:FARMER", "zl.registration.patient.occupation.farmer.label");
    w.getConfig().addOption("CIEL:159674", "zl.registration.patient.occupation.fisherman.label");
    w.getConfig().addOption("PIH:FRUIT OR VEGETABLE SELLER", "zl.registration.patient.occupation.fruitOrVegetableVendor.label");
    w.getConfig().addOption("PIH:HEALTH CARE WORKER", "zl.registration.patient.occupation.healthCareWorker.label");
    w.getConfig().addOption("PIH:1404", "zl.registration.patient.occupation.housework.label");
    w.getConfig().addOption("PIH:HOUSEWORK/FIELDWORK", "zl.registration.patient.occupation.houseworkFieldwork.label");
    w.getConfig().addOption("PIH:MANUAL LABORER", "zl.registration.patient.occupation.manualLaborer.label");
    w.getConfig().addOption("CIEL:162945", "zl.registration.patient.occupation.marketVendor.label");
    w.getConfig().addOption("PIH:Military", "zl.registration.patient.occupation.military.label");
    w.getConfig().addOption("PIH:MINER", "zl.registration.patient.occupation.miner.label");
    w.getConfig().addOption("PIH:Police", "zl.registration.patient.occupation.police.label");
    w.getConfig().addOption("PIH:PROFESSIONAL", "zl.registration.patient.occupation.professional.label");
    w.getConfig().addOption("PIH:RETIRED", "zl.registration.patient.occupation.retired.label");
    w.getConfig().addOption("PIH:SHOP OWNER", "zl.registration.patient.occupation.shopOwner.label");
    w.getConfig().addOption("PIH:STUDENT", "zl.registration.patient.occupation.student.label");
    w.getConfig().addOption("PIH:Teacher", "zl.registration.patient.occupation.teacher.label");
    w.getConfig().addOption("PIH:UNEMPLOYED", "zl.registration.patient.occupation.unemployed.label");
    w.getConfig().addOption("PIH:OTHER NON-CODED", "zl.registration.patient.occupation.other.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 44 with Field

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

the class SectionsDefault method getBiometricsFingerprintsQuestion.

public Question getBiometricsFingerprintsQuestion() {
    Question q = new Question();
    q.setId("biometrics-fieldset");
    q.setCssClasses(Collections.singletonList("no-confirmation"));
    q.setLegend("zl.registration.patient.biometrics.fingerprints.label");
    q.setHeader("zl.registration.patient.biometrics.fingerprints.question");
    Field f = new Field();
    f.setType("fingerprint");
    f.setUuid(Metadata.getBiometricsReferenceNumberIdentifierType().getUuid());
    f.setWidget(getFingerprintWidget());
    q.addField(f);
    return q;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question)

Example 45 with Field

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

the class SectionsDefault method getActiveCasefindingQuestion.

public Question getActiveCasefindingQuestion() {
    Question q = new Question();
    q.setId("activeCasefindingLabel");
    q.setLegend("zl.registration.patient.activeCasefinding.label");
    q.setHeader("zl.registration.patient.activeCasefinding.question");
    Field f = new Field();
    f.setFormFieldName("obs.PIH:Found through active casefinding");
    f.setType("obs");
    f.setWidget(getYesNoDropdownWidget());
    if (config.getRegistrationConfig().getSocial().getActiveCasefinding().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

Field (org.openmrs.module.registrationapp.model.Field)60 Question (org.openmrs.module.registrationapp.model.Question)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