Details
-
Bug
-
Status: Closed
-
TBD
-
Resolution: Duplicate
-
None
-
None
Description
Background
In the Reference Application, if you use a complex Obs on an HTML Form to store an image (ImageHandler) or binary file (BinaryDataHandler), the file isn't uploaded. There is also no way to view images/files in the Reference Application UI that were uploaded through the legacy UI. When viewing the encounter contents in the Refereance Application UI it says...
Uploaded imagejpg image
However everything works properly in the legacy UI.
How to Reproduce the error
A. To reproduce this, you must first create a complex Obs concept. This can be done in OpenMRS 2.3.1 like this...
- Go to System Administration --> Advanced Administration (to get to the legacy Admin page).
- Click View Concept Dictionary
- Click Add new Concept
- Give it a Name like "Image"
- Give it a Class of "Misc"
- Give it a Datatype of "Complex"
- Give it a Handler of "ImageHandler"
- Save the concept. Notice the Id at the top.
Note: For more info see the Workflow section at https://wiki.openmrs.org/display/docs/Complex+Obs+Support.
B. Then you can add the obs to an HTML form like this...
- Click on Administration
- Click Manage HTML Forms
- Click New HTML Form
- Give it the Name "Image"
- Give it Version "1"
- Give it the Encounter Type of "Check In"
- Add "<obs conceptId="163099" />" to the form directly above the "<submit/>" tag. Substitute 163099 for the Id of the concept you created.
- Click Save.
C. Then you can test the form by selecting a patient in the legacy UI
- Click "Find/Create Patient"
- Search for a patient; "pat" usually gives results.
- Click on the patient name and the legacy dashboard loads.
- Click the "Form Entry" tab.
- Click to open the "Image" form.
- Choose a Location.
- Choose a Provider.
- Click Choose File to browse for the image file you want to upload.
- Click "Enter Form".
- Click the "View" button beside the "Check In" encounter (Image form) you just created.
- Notice the preview of the image, and the button to download. It is possible to download by clicking on the link too.
D. Then you can add this form to the Reference App, to appear on the patient dashboard...
- Click Home.
- Click Configure Metadata.
- Click Manage Forms.
- Click "Add" beside the Image form.
- Leave the standard settings and click "Save".
E. Then you can test the form in the Reference Application...
- Click the Home button.
- Click Find Patient Record.
- Search for a patient; "pat" and choose the same patient as before.
- Under General Actions, click "Image".
- Click the arrow to edit recent visits.
- Find the "Check In" encounter in the list that you just entered.
- Click "Show Details" beside the encounter.
- Notice it displays an empty grey box. It should show a preview of the uploaded image.
F. View the encounter in the legacy UI...
- Click "Find/Create Patient"
- Search for the same patient; "pat".
- Click on the patient name (for the same patient) and the legacy dashboard loads.
- Click the "Form Entry" tab.
- Click the "View" button beside the "Check In" encounter (Image form) you just created in the Reference Application.
- Notice it does not show the preview of the image, or the button to download. The image was not uploaded in the Reference Application.
Dev Notes
One possibile cause of this is that in the Reference Application the form is submitted via AJAX, rather than a regular form post, and thus the file upload is lost.
Gliffy Diagrams
Attachments
Issue Links
- duplicates
-
HTML-717 Error while dowloading the image which saved in complex concept
-
- Closed
-