pre-populate form

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

pre-populate form

kotharv
Hello,

in my form discharge summary, patient details are auto populated with below xpath expression
concat(instance('patient')/givenname,' ',instance('patient')/familyname,', DOB: ',instance('patient')/dob/day, '/', instance('patient')/dob/month, '/', instance('patient')/dob/year,', UR: ',instance('patient')/external_ids/id,', ',instance('patient')/addline1,' ',instance('patient')/addline2,', ',instance('patient')/city,', ',instance('patient')/postcode,', Home: ',instance('patient')/info1)

and in the xml I didn't see any thing other than

 <xforms:instance id="patient">
                <patient/>
            </xforms:instance>

I am not able to re-engineer to know how the details are fetched to form.
it would be very help to if some describe how to trace these instances and where are they defined?
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

Alessandro  Vernet
Administrator
I can't say without looking at the form logic. Is this a form created with Form Builder, or was the XForms written "by hand"? If the latter, can you see an `xf:submission` in the source of the form that could be used to load/save the patient data?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

kotharv
Hi Alex, its and 3.9 version which we are source_xml.xmlusing so its a mix some of form builder and own code.

I attached the xml.
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

Alessandro  Vernet
Administrator
Got it about this being with Orbeon Forms 3.9. I don't see anything in that source that would load something into the `patient` instance. So I'm not surprised nothing is ;). Can you check with the person who did this initially how it was supposed to work?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

kotharv
Hello Alex,

some how I got the information that there are model instances defined for patient, when you do xpath, it will bring data.

My worry is to understand how this can be defined and referred.
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

Alessandro  Vernet
Administrator
Yes, this is correct: an "instance" contains XML, and in your case you seem to have an instance expected to contain patient data. Once the data is there, you can refer to it in your form with XPath. But I can't answer your original question of how the data gets there, as I can't see anything in the source you attached that loads the data. So again, I think you'll need to check with whoever created this form.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: pre-populate form

kotharv
Thanks Alex, will check.