Search in sources :

Example 6 with Field

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

the class PatientRegistrationApp method getIdCardPrintQuestion.

public Question getIdCardPrintQuestion() {
    Question q = new Question();
    q.setId("idcardLabel");
    q.setLegend("zl.registration.patient.idcard.label");
    q.setHeader("zl.registration.patient.idcard.question");
    Field f = new Field();
    f.setFormFieldName("obs.PIH:ID Card Printing Requested");
    f.setType("obs");
    DropdownWidget w = new DropdownWidget();
    w.getConfig().setExpanded(true);
    w.getConfig().setHideEmptyLabel(true);
    w.getConfig().setInitialValue("PIH:YES");
    w.getConfig().addOption("PIH:YES", "emr.yes");
    w.getConfig().addOption("PIH:NO", "emr.no");
    f.setWidget(toObjectNode(w));
    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) DropdownWidget(org.openmrs.module.registrationapp.model.DropdownWidget)

Example 7 with Field

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

the class PatientRegistrationApp method getHivEmrId.

public Question getHivEmrId() {
    Question q = new Question();
    q.setId("hivemr-v1-id");
    q.setLegend("HIVEMR-V1");
    q.setHeader("ui.i18n.PatientIdentifierType.name." + PihHaitiPatientIdentifierTypes.HIVEMR_V1.uuid());
    Field f = new Field();
    f.setFormFieldName("patientIdentifier" + PihHaitiPatientIdentifierTypes.HIVEMR_V1.uuid());
    f.setUuid(PihHaitiPatientIdentifierTypes.HIVEMR_V1.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 8 with Field

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

the class PatientRegistrationApp method getContactPhoneNumber.

public Question getContactPhoneNumber(Config config, Boolean required) {
    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");
        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)

Example 9 with Field

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

the class PatientRegistrationApp method getBiometricsFingerprintsQuestion.

public Question getBiometricsFingerprintsQuestion(Config config) {
    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(HaitiPatientIdentifierTypes.BIOMETRIC_REF_NUMBER.uuid());
    f.setWidget(getFingerprintWidget(config, featureToggles));
    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 10 with Field

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

the class PatientRegistrationApp method getMothersNameQuestion.

public Question getMothersNameQuestion(Config config) {
    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(HaitiPersonAttributeTypes.MOTHERS_FIRST_NAME.uuid());
    f.setWidget(getTextFieldWidget());
    if (config.getRegistrationConfig().getDemographics().getMothersName().getRequired()) {
        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) 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