Search in sources :

Example 11 with Question

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

the class SectionsPeru method getPassportdocument.

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

Example 12 with Question

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

the class SectionsHaiti method getMothersNameQuestion.

@Override
public Question getMothersNameQuestion() {
    Question q = super.getMothersNameQuestion();
    // we use a simplified registration in "tablet entry" locations
    q.setRequire(RequireUtil.sessionLocationDoesNotHaveTag("Tablet Entry Location"));
    return q;
}
Also used : Question(org.openmrs.module.registrationapp.model.Question)

Example 13 with Question

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

the class SectionsHaiti method getInsuranceNameAndNumber.

private Question getInsuranceNameAndNumber() {
    Question q = new Question();
    q.setId("insuranceNameLabel");
    q.setLegend("zl.registration.patient.insurance.insuranceName.question");
    q.setHeader("zl.registration.patient.insurance.insuranceName.label");
    {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:Insurance CONSTRUCT.obs.PIH:Haiti insurance company name");
        f.setLabel("zl.registration.patient.insurance.insuranceName.question");
        f.setType("obsgroup");
        f.setWidget(getTextFieldWidget(30));
        DropdownWidget w = new DropdownWidget();
        w.getConfig().setExpanded(true);
        w.getConfig().addOption("PIH:NONE", "zl.registration.patient.insurance.none.label");
        w.getConfig().addOption("PIH:AIC", "zl.registration.patient.insurance.aic.label");
        w.getConfig().addOption("PIH:INASSA", "zl.registration.patient.insurance.inassa.label");
        w.getConfig().addOption("PIH:CAH", "zl.registration.patient.insurance.cah.label");
        w.getConfig().addOption("PIH:CONAM", "zl.registration.patient.insurance.conam.label");
        w.getConfig().addOption("PIH:Sogebank Assurance", "zl.registration.patient.insurance.sogebank.label");
        w.getConfig().addOption("PIH:UniAssurances", "zl.registration.patient.insurance.uniAssurances.label");
        w.getConfig().addOption("PIH:GMC Henner", "zl.registration.patient.insurance.gmcHenner.label");
        w.getConfig().addOption("PIH:CIGNA (Vanbreda)", "zl.registration.patient.insurance.cigna.label");
        w.getConfig().addOption("PIH:UNKNOWN", "zl.registration.patient.insurance.unknown.label");
        w.getConfig().addOption("PIH:OTHER", "zl.registration.patient.insurance.other.label");
        f.setWidget(toObjectNode(w));
        q.addField(f);
    }
    {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:Insurance CONSTRUCT.obs.PIH:Insurance policy number");
        f.setLabel("zl.registration.patient.insurance.insuranceNumber.label");
        f.setType("obsgroup");
        f.setWidget(getTextFieldWidget(30));
        q.addField(f);
    }
    {
        Field f = new Field();
        f.setFormFieldName("obsgroup.PIH:Insurance CONSTRUCT.obs.PIH:Insurance company name (text)");
        f.setLabel("zl.registration.patient.insurance.insuranceNameOther.label");
        f.setType("obsgroup");
        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) DropdownWidget(org.openmrs.module.registrationapp.model.DropdownWidget)

Example 14 with Question

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

the class SectionsHaiti method getBirthplaceQuestion.

@Override
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("obsgroup.PIH:PATIENT CONTACTS CONSTRUCT.obs.PIH:ADDRESS OF PATIENT CONTACT");
    f.setLabel("zl.registration.patient.birthplace.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, getPlaceOfBirthAddressFieldMappings(), 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 : 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 15 with Question

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

the class SectionsHaiti method getCarteDIdentificationNationale.

private Question getCarteDIdentificationNationale() {
    String cinUuid = Metadata.getCinIdentifierType().getUuid();
    Question q = new Question();
    q.setId("carte-d-identification-nationale");
    q.setLegend("CIN");
    q.setHeader("ui.i18n.PatientIdentifierType.name." + cinUuid);
    Field f = new Field();
    f.setFormFieldName("patientIdentifier" + cinUuid);
    // f.setLabel(HaitiPatientIdentifierTypes.CIN_ID.name());
    f.setUuid(cinUuid);
    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)

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