Personalizing patient registration fields

Hi,

I was testing the patient registration page in OpenMRS. I need to customize this product to give solution to a clinic. I need to add some fields. These fields are:

  • Health Integral Insurance, SIS (Seguro Integral de Salud): It means if the patient belongs to a health insurer Peruvian government (SIS).
  • Clinic history number: It means the number of clinic history of the patient, this is used as an identifier of the patient in the clinic.
  • National Identification Document, DNI (Documento Nacional de Identificacion): It means the patient identifier in the country (Peru).

Type of data: SIS: Boolean (True or False) Clinic history number: Numeric (10 digits) DNI: Numeric (8 digits)

I need to add those fields, on page patient registration, modification of the patient, the patient search. To this followed the guide OpenMRS on the link: https://wiki.openmrs.org/display/docs/Registration+App+Configuration. I did the following:

I add the SIS field, but this is not represented as Boolean field.

Then I changed the widget option in the fragmentId property to “field/java.lang.Boolean” and now this is displayed in the view, with options yes or no.

But this leads an error, the SIS tab does not work good. Being in the SIS tab, if I click the next tab (Confirm), does not recognize the SIS field.

I know I’m not doing well. I need your help to get personalized OpenMRS the need for the clinic. I hope you can help me.

Thanks.

1 Like

I’ve never customized the RefApp registration page, but your use case seems pretty simple. Maybe either @arbaughj or @darius can help us understand what’s going on?

Hi @frodriguezm17. Looks like a similar bug that I ran into, when trying to add coded person attributes.

@mogoodrich replied to my cry for help, and might have some feedback on this.

I would consider using identifiers for the “Clinic history number” and “DNI” rather than using person attributes. I haven’t yet mastered adding additional identifiers to the registration app. If you decide to try it, and can master it, please update the documentation wiki page.

Thanks @pascal for tagging me on this.

1 Like

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.