We have a requirement to record patient insurer during patient registration. So we may need to add two fields
boolean insured; // true if patient is insured
Insurer insurer; // patient insurer
During patient registration, we have a checkbox insured and if it’s checked we select an insurer from a dropdown of insurers in the system. Now I’m trying to figure out how we’ll save this information together with the other recorded patient data.
@ssmusoke Unfortunately I’m not sure I can use this approach. The registration page(gsp page) already has too many customizations(not done by me) and I’m not sure how modifying this will affect that page considering it was only used to add an app icon on the home screen.
Just like I commented on @ssmusoke response, the registration page already has too many customizations and I’m assuming your suggestion says I should try out the xforms patient registration module.
What I have currently is this,
jq.getJSON("/openmrs/ws/rest/v1/insurer", function (response) {
var html = "<select name='insurer'><option>Select Insurer</option>";
jq.each(response.results, function () {
html += '<option value="' + this.uuid + '">' + this.display + "</option>";
});
html += "</select>";
jq("#paycatgs").html(html);
});
So my thought is that when this form will be submitted, we’ll have two parameters,
insured=true&insurer={insurerUuid}
And I can retrieve a the selected insurer in the controller via
@dkayiwa sorry if I’m not understanding what you are trying to pass across. Maybe you are wrongly assuming my knowledge of something or maybe my approach is wrong and we are talking of two different things.
When my form is submitted, I retrieved the insurer inside my java controller using
Insurer insurer = insurerService.getInsurer(insurerUuid); // insurerUuid was submitted as a request param
I can create a person attribute type from the UI and use a setting to retrieve it as you earlier suggested on irc.
Now what I’m not sure is what to do with my insurer object so I can save it with the patient record. The system already has a list of insurers added via an insurancemanagement module. What I am doing now is referencing these insurers when saving a patient record.
How do I make use of the person attribute type I created earlier here?