getodk / clinic

0 stars 3 forks source link

clinic crashes on patient select #6

Open mitchellsundt opened 9 years ago

mitchellsundt commented 9 years ago

Originally reported on Google Code with ID 248

> 2: ODKclinic: This product is used for data delivery from OpenMRS to a
> mobile phone. http://code.google.com/p/opendatakit/wiki/ODKClinic “To
> this end, Clinic provides patient demographic and encounter history
> download.”. There is nothing written about uploading forms. We
> downloaded ver 1.0.software and installed on Androids and Google
> emulator. Appears as version 0.0.1. Linked to pre-installed url/pw/
> user - downloaded 2 cohorts 30s and Pregnant. Selcted Pregnant and
> downloaded patients. When we try to access ANY patient with Android or
> emulator, program crashes with message, "Application ODK Clinic
> (process org.odk.clinic.android) has stopped unexpectedly. Please try
> again.We have not been able to get past this point.

Reported by yanokwa on 2011-07-02 15:05:42

mitchellsundt commented 9 years ago
I have had this problem as well. It seems to be an issue with the format of the file
that OpenMRS's XForms module puts out. It doesn't have a "head" element, so it throws
an exception. Here is where you throw the error:

in org.odk.collect.android.provider.FormsStorage line 283:
Element cur = doc.getRootElement().getElement(html, "head");

The OpenMRS XForms module doesn't output a file with a "head" element, so it crashes
here. I think that their XForms look weird personally, but this program should be able
to read whatever it spits out. Here's what the beginning of an OpenMRS XForms output
looks like for reference...

<xf:xforms xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jr="http://openrosa.org/javarosa">
  <xf:model id="openmrs_model">
    <xf:instance id="openmrs_model_instance">
      <form xmlns:openmrs="/moduleServlet/formentry/forms/schema/17-13" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
id="17" name="AMPATH Pediatric Return Visit Form" version="3.1">
        <header>
          <enterer/>
          <date_entered/>
          <session/>
          <uid/>
        </header>
        <patient>
          <patient.patient_id openmrs_table="patient" openmrs_attribute="patient_id"/>
          <patient.family_name openmrs_table="patient_name" openmrs_attribute="family_name"/>
          <patient.given_name openmrs_table="patient_name" openmrs_attribute="given_name"/>
          <patient.middle_name openmrs_table="patient" openmrs_attribute="middle_name"/>
          <patient.medical_record_number openmrs_table="patient_identifier" openmrs_attribute="identifier"/>

Reported by nwilkie on 2011-09-09 04:56:49

mitchellsundt commented 9 years ago

Reported by yanokwa on 2011-10-21 20:00:49

mitchellsundt commented 9 years ago
Found a solution btw... Set the xforms property from purc forms to javarosa and it works
fine. 

Reported by nwilkie on 2011-10-21 22:14:39

mitchellsundt commented 9 years ago

Reported by yanokwa on 2012-05-25 20:07:03

mitchellsundt commented 9 years ago
hi 
I am unable to change the xforms property. Whenever I try to edit it, it is not saved.
Can you please suggest how to change the same.
Thanks 

Reported by Talhaahmad12111@iiitd.ac.in on 2014-05-27 09:33:02