How to remove relationship section from registration form

I want to remove relationship section from registration form. How can i remove it ??

Unfortunately, You can not.

@angshuonline How can i add new section called “Important Contacts” there ? i tried to add a section by editing app.json file in registration folder from backend. But it is not working at all.

Please help me to find the solution

Firstly recommend you to use relationship. If really needed to hide relationship from registration page then you have to retire Person relationship types. in openMRS go to Administration-> Person → Manage Relationship Types & retire all relationship types.

Then you should see that the relationship section will be hidden from the registration page.

1 Like

Hello @rajeebrasak , can you please share your app.json file?

@rakib.hasan

 {
        "id": "bahmni.registration",
        "instanceOf":"bahmni.template.registration",
        "description": "Bahmni Patient Registration App",
        "extensionPoints": [
            {
                "id": "org.bahmni.registration.patient.search.result.action",
                "description": "Bahmni Patient Search Result Action"
            },
            {
                "id": "org.bahmni.registration.patient.next",
                "description": "After Bahmni Patient Registration, forward url configuration"
            }
        ],
        "contextModel": [
            "patientUuid",
            "activeVisitUuid"
        ],
        "config" : {
            "patientInformation": {
                "additionalPatientInformation": {
                    "title": "Additional Patient Information",
                    "attributes": [
                        "country",
                        "email",
                        "telephone"
                    ]
                },

                 "additionalPatientInformations": {
                    "title": "Additional Patient Informations",
                    "attributes": [
                        "country",
                        "email",
                        "telephone"
                    ]
                },

                "emergencyContactInformation": {
                    "title": "Emergency Contact  Information",
                    "attributes": [
                        "class"
                    ]
                },

                "hidden": {
                    "attributes": [
                        "primaryContact",
                        "debt",
                        "isUrban",
                        "distanceFromCenter",
                        "cluster",
                        "RationCard",
                        "familyIncome",
                        "cluster"
                    ]
                },
                "defaults":  {
                    "class": "General",
                    "landHolding": 2
                }
            },


            "addressHierarchy": {
                "showAddressFieldsTopDown": false,
                "strictAutocompleteFromLevel": "stateProvince"
            },

            "relationshipTypeMap": {
                "Doctor":"provider",
                "Parent":"patient"
            },

 
            "autoCompleteFields":[],
            "defaultIdentifierPrefix": "BWH",
            "defaultVisitType": "GENERAL PRACTITIONER",
            "searchByIdForwardUrl": "/patient/{{patientUuid}}",
            "showMiddleName": true,
            "showLastName": true,
            "isLastNameMandatory": true,
            "showSaveConfirmDialog": false,
            "showBirthTime": true,
            "showCasteSameAsLastNameCheckbox": false,
            "printOptions": [
                {
                    "translationKey": "REGISTRATION_PRINT_REG_CARD_LOCAL_KEY",
                    "templateUrl": "/bahmni_config/openmrs/apps/registration/registrationCardLayout/print_local.html",
                    "shortcutKey": "l"
                },
                {
                    "translationKey": "REGISTRATION_PRINT_REG_CARD_KEY",
                    "templateUrl": "/bahmni_config/openmrs/apps/registration/registrationCardLayout/print.html",
                    "shortcutKey": "p"
                },
                {
                    "translationKey": "REGISTRATION_PRINT_SUPPLEMENTAL_PAPER",
                    "templateUrl": "/bahmni_config/openmrs/apps/registration/supplementalPaperLayout/print.html",
                    "shortcutKey": "r"
                },
                {
                    "translationKey": "REGISTRATION_PRINT_WITH_BARCODE",
                    "templateUrl": "/bahmni_config/openmrs/apps/registration/registrationCardLayout/printWithBarcode.html",
                    "shortcutKey": "c"
                }
            ],
            "conceptSetUI": {
                "REGISTRATION FEES": {
                    "required": true,
                    "label": "Fee"
                },
                "FHS": {
                    "buttonSelect": true
                },
                "defaults":{
                    "FHS": "Present"
                }
            },
            "fieldValidation" : {
                   "primaryContact" : {"pattern" : "[0-9]{8,10}", "errorMessage" : "Should be 12 characters starting with 91 (country code)"},
                "landHolding" : {"pattern" : "[0-9]{0,3}", "errorMessage" : "Should be between 1 to 999 acres"},
                "familyName" : {"pattern" : "[a-zA-Z]{0,}", "errorMessage" : "Should contain characters"},
                "givenName" : {"pattern" : "[a-zA-Z]{0,}", "errorMessage" : "Should contain characters"},
                "middleName" : {"pattern" : "[a-zA-Z]{0,}", "errorMessage" : "Should contain characters"},
                "address1" : {"pattern" : "[a-zA-Z0-9\\s]{2,}", "errorMessage" : "Should contain at least 2 characters"}
            }
        }
}

Hello @rajeebrasak , create Person Attribute Type in openmrs. Go to openmrs → Administration → Manage Person Attribute Types → create person Attributes what you needed. for example if you add contactName & ContactNumber for “Important Contact” section like bellow:

Then you need to add the following code in the “patientInformation” section under “config” section in /var/www/bahmni_config/openmrs/apps/registration/app.json file

 "importantContact": {
            "title": "Important Contact",
            "translationKey": "Important Contact",
            "attributes": [
                    "contactName",
                    "contactPhoneNumber"
                    ],
            "order" : 1
         }

Note: Please ensure translationKey in the above code.

1 Like

@rakib.hasan Thanks for the reply. It works for me. One more thing i want to know. Can we make these person attributes as mandatory ??

Please see this threads: How to make a person attribute mandatory?

1 Like