Search in sources :

Example 26 with Question

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

the class SectionsPeru method getCellphoneNumberQuestion.

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

Example 27 with Question

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

the class SectionsPeru method getDNIdocument.

private Question getDNIdocument() {
    Question q = new Question();
    q.setId("national-id");
    q.setLegend("zl.registration.patient.documenttype.dni.label");
    q.setHeader("zl.registration.patient.documenttype.dni.label");
    Field f = new Field();
    f.setFormFieldName("patientIdentifier" + SesConfigConstants.PATIENTIDENTIFIERTYPE_DNI_UUID);
    f.setUuid(SesConfigConstants.PATIENTIDENTIFIERTYPE_DNI_UUID);
    f.setType("patientIdentifier");
    f.setWidget(getTextFieldWidget(8));
    q.addField(f);
    return q;
}
Also used : Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question)

Example 28 with Question

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

the class PatientRegistrationApp method getContactAddress.

public Question getContactAddress(Config config, boolean required) {
    Question q = new Question();
    q.setId("contactQuestionLabel");
    q.setHeader("zl.registration.patient.contactPerson.address.question");
    q.setLegend("zl.registration.patient.contactPerson.address.label");
    if (config.getCountry().equals(ConfigDescriptor.Country.HAITI)) {
        Field f = new Field();
        // f.setFormFieldName("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:ADDRESS OF PATIENT CONTACT");
        f.setLabel("zl.registration.patient.contactPerson.address.label");
        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, getContactAddressFieldMappings(config), true));
        } else {
            Map<String, String> m = new HashMap<String, String>();
            m.put("providerName", "uicommons");
            m.put("fragmentId", "field/personAddress");
            f.setWidget(toObjectNode(m));
            if (required) {
                f.setCssClasses(Arrays.asList("required"));
            }
        }
        q.addField(f);
    } else {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:ADDRESS OF PATIENT CONTACT");
        f.setLabel("zl.registration.patient.contactPerson.address.label");
        f.setType("obsgroup");
        f.setWidget(getTextAreaWidget(250));
        if (required) {
            f.setCssClasses(Arrays.asList("required"));
        }
        q.addField(f);
    }
    return q;
}
Also used : AddressField(org.openmrs.module.addresshierarchy.AddressField) 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 29 with Question

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

the class PatientRegistrationApp method getHivDossierNumber.

public Question getHivDossierNumber() {
    Question q = new Question();
    q.setId("hivemr-dossier-id");
    q.setLegend("HIV Dossier");
    q.setHeader("ui.i18n.PatientIdentifierType.name." + PihHaitiPatientIdentifierTypes.HIV_DOSSIER_NUMBER.uuid());
    Field f = new Field();
    f.setFormFieldName("patientIdentifier" + PihHaitiPatientIdentifierTypes.HIV_DOSSIER_NUMBER.uuid());
    f.setUuid(PihHaitiPatientIdentifierTypes.HIV_DOSSIER_NUMBER.uuid());
    f.setType("patientIdentifier");
    f.setWidget(getTextFieldWidget(16));
    q.addField(f);
    return q;
}
Also used : AddressField(org.openmrs.module.addresshierarchy.AddressField) Field(org.openmrs.module.registrationapp.model.Field) Question(org.openmrs.module.registrationapp.model.Question)

Example 30 with Question

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

the class PatientRegistrationApp method getContactNameAndRelationship.

public Question getContactNameAndRelationship(Config config, boolean required) {
    Question q = new Question();
    q.setId("contactNameLabel");
    q.setLegend("zl.registration.patient.contactPerson.name.label");
    q.setHeader("zl.registration.patient.contactPerson.name.question");
    {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:NAMES AND FIRSTNAMES OF CONTACT");
        f.setLabel("zl.registration.patient.contactPerson.contactName.question");
        f.setType("obsgroup");
        if (required) {
            f.setCssClasses(Arrays.asList("required"));
        }
        f.setWidget(getTextFieldWidget(30));
        q.addField(f);
    }
    {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:RELATIONSHIPS OF CONTACT");
        f.setLabel("zl.registration.patient.contactPerson.relationships.label");
        f.setType("obsgroup");
        if (required) {
            f.setCssClasses(Arrays.asList("required"));
        }
        f.setWidget(getTextFieldWidget(30));
        q.addField(f);
    }
    return q;
}
Also used : AddressField(org.openmrs.module.addresshierarchy.AddressField) 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