Yes, the BinaryDataHandler sets the ComplexData.title to the filename and the ComeplexData.data to the actual data. It is a matter of the ComplexObsServlet and/or the Web UI knowing what to do/how to render a particular file type.
Mark From: [email protected] [mailto:[email protected]] On Behalf Of Darius Jazayeri Sent: Monday, September 12, 2011 6:04 PM To: [email protected] Subject: Re: [OPENMRS-DEV] [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Moving this discussion to the developers list. Presumably what those handlers should be doing is, in addition to storing the bytes of the file, they should be storing the filename (or at least extension) and content-type if possible. (Maybe they're doing this already...) -Darius On Mon, Sep 12, 2011 at 1:49 PM, Mark Goodrich <[email protected]<mailto:[email protected]>> wrote: Thanks Suranga- I updated applicationContext-service.xml to register the two binary handlers (added this to trunk and backported it to 1.8.x as well). We now can successfully upload files through the web interface using those handlers. However, rendering in the web interface is still an issue... I added my suggestions here: https://tickets.openmrs.org/browse/TRUNK-2656<https://tickets.openmrs.org/browse/TRUNK-2656?jwupdated=54375#linkingmodule> but it looks like you guys have already given it some thought here: https://tickets.openmrs.org/browse/TRUNK-2563 Take care, Mark From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Suranga Kasthurirathne Sent: Friday, September 09, 2011 3:46 PM To: [email protected]<mailto:[email protected]> Subject: Re: [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Hi everyone, Sorry, only just got here due to time zone differences. To register a handler, you need to refer to it in the spring file, as Darius said. you will need something like, <entry> <key><value>ImageHandler</value></key> <bean class="org.openmrs.obs.handler.ImageHandler"/> </entry> For this to work, your handler class needs getObs() and saveObs() methods. We've changed this pattern during my work on a branch, but right now you can go along with whats in the trunk. At the moment you may create complex concepts using a texthandler or Imagehandler. I had a conversation regarding the use of BinaryDataHandler and Binary StreamHandler - see here<https://tickets.openmrs.org/browse/TRUNK-2563>. But these two handlers will work fine once they are registered. Please let us know If you run into any problems. On Sat, Sep 10, 2011 at 12:04 AM, Mark Goodrich <[email protected]<mailto:[email protected]>> wrote: Okay, I will take a look... Mark From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Darius Jazayeri Sent: Friday, September 09, 2011 2:04 PM To: [email protected]<mailto:[email protected]> Subject: Re: [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Looks like you have to manually set these in applicationContextService.xml on the obsServiceTarget bean. -Darius On Fri, Sep 9, 2011 at 10:58 AM, Mark Goodrich <[email protected]<mailto:[email protected]>> wrote: Probably an oversight. I just added the class... do we need to register it somewhere? Or it just a matter of adding the option to the UI? Mark From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Darius Jazayeri Sent: Friday, September 09, 2011 1:31 PM To: [email protected]<mailto:[email protected]> Subject: Re: [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Mark, On demo.openmrs.org<http://demo.openmrs.org> (running 1.8.2) the only choices in the Edit Concept page are Image and Text handlers. Are the binary handlers only available under-the-hood, for module writers? Or is this an oversight? -Darius On Fri, Sep 9, 2011 at 10:13 AM, Mark Goodrich <[email protected]<mailto:[email protected]>> wrote: Actually, as of 1.8.x there is a Binary Data Handler and a Binary Stream Handler in core. (I forget what the significance is between the difference in the two). We use the Binary Data Handler in the MDR-TB module to allow uploading of PDFs... Mark From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Darius Jazayeri Sent: Friday, September 09, 2011 12:32 PM To: [email protected]<mailto:[email protected]> Subject: Re: [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Shaun, This is indeed what complex obs are for. In the core distribution we only have handlers for Image and for Plain Text, but a module could easily add PDF. (And that seems like something we'd want to bundle in the standard distribution too.) If you look at this enounter on the demo server today (since its db resets nightly) you'll see that I've added a png image as one of the obs whose concept is Darius Test Complex Obs or something like that: http://demo.openmrs.org/openmrs/admin/encounters/encounter.form?encounterId=44345 -Darius On Fri, Sep 9, 2011 at 8:57 AM, Bill Lober <[email protected]<mailto:[email protected]>> wrote: Shaun, others? Could one use complex obs to store an URI, and possibly credentials, to an external repository. That's the model used by the Cross Document Sharing profiles (XDS) of IHE. One could reference either a document store in a "Document Store Module" (to be written, I think), an external light-weight document store, a query string into an existing object store, or a document reference in a commercial document management system. It would be a very flexible approach. I came across Complex Obs not too long ago - is anyone using them? Is this an appropriate use? Thanks, Bill -----Original Message----- From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Shaun Grannis Sent: Friday, September 09, 2011 8:38 AM To: [email protected]<mailto:[email protected]> Subject: [OPENMRS-IMPLEMENTERS] attaching files to a patient encounter Has a workflow to attach external files been deployed in OpenMRS? For example, consider the following scenario: 1) A patient receives care at an OpenMRS site. 2) An encounter is created, a referral to a specialist is ordered. 3) Patient leaves. 4) Days later, the specialist's dictated paper note is sent to the clinic. It is scanned and the electronic note must be "attached" to the previous encounter. Given the above, a desirable workflow would be: 1) User selects the patient. 2) User selects "Encounters". 3) User selects "Edit" to edit the previous encounter. 4) User selects "Add Observation". Steps 1-4 exist today, here's the new, hypothetical workflow: 5) Select an observation that indicates the result is an external file (e.g., an observation like, "PDF Referral note" -- let's not focus on the observation name yet, it may not be quite the right model; it's just a concept to trigger the next steps in the workflow): 6) Selecting "PDF Referral note" surfaces an "attach PDF file" option. 7) User selects "Select file" 8) User finds file and clicks "Upload" (this is much like an email attachment workflow) 9) File is uploaded. 10) The observation "PDF Referral note" is added to the encounter. 11) When user clicks on "PDF Referral note" in the appropriate encounter, the PDF file is displayed in an external viewer (again, much like an email attachment is handled by an external application) My question: Has a workflow similar to this been implemented in OpenMRS? Is it in core and I'm missing it? In a module? Thanks for your feedback! Shaun -- Shaun J. Grannis, MD MS FAAFP Research Scientist, Regenstrief Center for Biomedical Informatics Director, Indiana Center of Excellence for Public Health Informatics Associate Professor, Dept of Family Medicine Indiana University School of Medicine 410 West 10th Street, Suite 2000 Indianapolis, IN 46202 Voice 317.423.5523<tel:317.423.5523> / Fax 317.423.5695<tel:317.423.5695> _________________________________________ To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [email protected]<mailto:[email protected]> with "SIGNOFF openmrs-implement-l" in the body (not the subject) of your e-mail. [mailto:[email protected]<mailto:[email protected]>?body=SIGNOFF%20openmrs-implement-l] _________________________________________ To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [email protected]<mailto:[email protected]> with "SIGNOFF openmrs-implement-l" in the body (not the subject) of your e-mail. [mailto:[email protected]<mailto:[email protected]>?body=SIGNOFF%20openmrs-implement-l] ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list -- Best Regards, Suranga ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

