Personalizing patient registration fields

Yes, it may very well be RA-982 that is the problem, and coded (or in this case boolean) person attribute types are not yet supported… :frowning:

1 Like

I also have the same problem - I need a dropDown or radio buttons for answers of a question. I’ve tried with this JSON code (It is present on the test folder of the reference app):

It always fail with: “org.openmrs.ui.framework.AttributeExpressionException: Failed checks: [options] (the following passed: []) at org.openmrs.ui.framework.fragment.FragmentConfiguration.require(FragmentConfiguration.java:68) (…)”

Can someone help?

Dear @nostalgicamigo and @frodriguezm17 . You could vote for the ticket, which might move it up on the priority list to get it fixed.

@darius, could someone from the ThoughtWorks hackathon work on this ticket?

1 Like

I would like to add a new field to patient registration form as Father Name which will be a simple text field. How can i do this?

Hi hpardess, you can easily add a new field to the patient registration form, for the Father Name. See… https://wiki.openmrs.org/display/docs/Registration+App+Configuration#RegistrationAppConfiguration-AddPersonAttributes

Thank you @arbaughj. also thanks @mksd for sharing the the example

I have added 5 new fields in Patient Registration Form here they are,

  1. Status (It is a concept)
  2. Birth Place (It is text field)
  3. Father’s Name (It is text field)
  4. Father’s Occupation (It is text field of size 60)
  5. Mother’s Name (It is text field)

the status should be dropdown. how should be the value of (“fragmentId”: “field/text”)?

here is the Registration App Configuration:

{
	"id": "referenceapplication.registrationapp.myRegisterPat",
	"instanceOf": "registrationapp.registerPatient",
	"label": "Register Patient",
	"description": "Create a new Patient Record",
	"extensions": [{
		"id": "referenceapplication.registrationapp.myRegisterPat.homepageLink",
		"extensionPointId": "org.openmrs.referenceapplication.homepageLink",
		"type": "link",
		"label": "referenceapplication.app.registerPatient.label",
		"url": "registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegisterPat",
		"icon": "icon-user",
		"order": 1,
		"requiredPrivilege": "App: registrationapp.registerPatient"
	}],
	"config": {
		"afterCreatedUrl": "/coreapps/clinicianfacing/patient.page?patientId={{patientId}}",
		"sections": [{
			"id": "personalInfo",
			"label": "Personal Info",
			"questions": [{
				"legend": "Status",
				"fields": [{
					"type": "personAttribute",
					"label": "Status",
					"formFieldName": "status",
					"uuid": "8d871f2a-c2cc-11de-8d13-0010c6dffd0f",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text"
					},
					"cssClasses": ["required"]
				}]
			}, {
				"legend": "Birth Place",
				"fields": [{
					"type": "personAttribute",
					"label": "Birth Place",
					"formFieldName": "birthPlace",
					"uuid": "8d8718c2-c2cc-11de-8d13-0010c6dffd0f",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text",
						"config": {
							"size": 60
						}
					}
				}]
			}]
		}, {
			"id": "contactInfo",
			"label": "registrationapp.patient.contactInfo.label",
			"questions": [{
				"legend": "Person.address",
				"fields": [{
					"type": "personAddress",
					"label": "registrationapp.patient.address.question",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/personAddress"
					}
				}]
			}, {
				"legend": "registrationapp.patient.phone.label",
				"id": "phoneNumberLabel",
				"fields": [{
					"type": "personAttribute",
					"label": "registrationapp.patient.phone.question",
					"formFieldName": "phoneNumber",
					"uuid": "14d4f066-15f5-102d-96e4-000c29c2a5d7",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text"
					},
					"cssClasses": ["phone"]
				}]
			}]
		}, {
			"id": "nextOfKin",
			"label": "Next of Kin",
			"questions": [{
				"legend": "Father",
				"fields": [{
					"type": "personAttribute",
					"label": "Father's Name",
					"formFieldName": "fatherName",
					"uuid": "46f276cd-3c23-4f31-b251-1944ee5cf042",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text"
					},
					"cssClasses": ["required"]
				}, {
					"type": "personAttribute",
					"label": "Father's Occupation",
					"formFieldName": "fatherOccupation",
					"uuid": "7ff7dfa1-3020-4bc2-b64c-fc3a3df50dc5",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text",
						"config": {
							"size": 60
						}
					}
				}]
			}, {
				"legend": "Mother",
				"fields": [{
					"type": "personAttribute",
					"label": "Mother's Name",
					"formFieldName": "motherName",
					"uuid": "8d871d18-c2cc-11de-8d13-0010c6dffd0f",
					"widget": {
						"providerName": "uicommons",
						"fragmentId": "field/text"
					}
				}]
			}]
		}]
	}
}

@ssmusoke @wyclif, when i click on edit button in patient dashboard, same form is not opened. Only demographic section is editable and visible.

Also how can i show the father name of a patient in patient dashboard just next to patient name?

That is something that we have improved… but on our own fork of Core Apps only. Despite the version number that you see there on our fork, it is in fact a variation of Core Apps 1.7. It is unfortunately not compatible with Ref App versions higher than 2.3. We are overdue to port that whole ‘edit registration’ feature to the community repo, but we don’t have the time or the resources to do so. Is that something you could do?

See, from back in the days: ‘How to use the Address Hierarchy Module with the Reference Application’.

Have you looked at this: ‘How set a field to dropdown in Registration App Configuration’?

I used CIVIL STATUS concept which is already defined and which has following answers:

  • SEPARATED (1056)
  • NEVER MARRIED (1057)
  • DIVORCED (1058)
  • WIDOWED (1059)
  • LIVING WITH PARTNER (1060)
  • MARRIED (5555)
  • Lives Alone (135704)
  • Other (5622)

I refered to the provided link but I lost the track. Could you please make the json for me for above concept as dropdown?

I cannot make the JSON for you but I can help you if you were to provide more details as to what you meant by

What did you do exactly, what is it that did not work?

here is my Status field in Registration App:

{
	"id": "personalInfo",
	"label": "Personal Info",
	"questions": [{
		"legend": "Status",
		"fields": [{
			"type": "personAttribute",
			"label": "Status",
			"formFieldName": "status",
			"uuid": "8d871f2a-c2cc-11de-8d13-0010c6dffd0f",
			"widget": {
				"providerName": "uicommons",
				"fragmentId": "field/text"
			},
			"cssClasses": ["required"]
		}]
	}
}

I want this to be dropdown. Also the values for dropdown should be taken from CIVIL STATUS concept which is already exits.

1 Like

Could you please identify me the exact files that handles ‘edit registration’ feature and I will test it locally. then i will commit it to community repo.

here I have created a ticket for this : https://issues.openmrs.org/browse/RA-1350

I replied on the issue, but after a quick look I think this commit is essentially is what you are looking for.

How to add the new relatives section into my personalized patient registration form which is added recently in patient registration form of RefAp 2.6?

here is the json of my designed patient registration form

Hi, @hpardess, I am going through exactly the same problem, perhaps does any OpenMRS EXPERT as a solution to that. the documentation on adding additional attributes to the registrationApp is not correct, it does not work. after creating manually the attributes and adding them to the code in the registrationApp, the information entered vanishes, no where to be found. it is not even displayed in the patient dashboard.

Is out there any OpenMRS Expert that can help us with this issue.

Regards

@kimkuere which documentation for adding additional attributes having you been using? I would like to take a look at it.

Hi @dkayiwa,

here is the link to document: https://wiki.openmrs.org/display/docs/Registration+App+Configuration

regards

@hpardess, @kimkuere I’ve been struggling with the same thing, i had a personAttribute with a foreign key to a concept but couldn’t get it as a dropdown that retrieves concepts the personattribute is related to. Finally i’ve just decided to extend the registrationapp on my own and add there personAttributeWithConcept field. I hope this is what you looking for here it is https://github.com/salta-kozbagarova/openmrs-module-registrationapp .

@saltanat if this is functionality which did not exist, did you consider raising a pull request? That way, you do not have to go through the pain of maintaining your own module. :slight_smile: