New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DurationDt incorrectly encoded #233

jamesagnew opened this Issue Sep 29, 2015 · 1 comment


None yet
1 participant

jamesagnew commented Sep 29, 2015

Per email from Nehashri P L

I have been working with MedicationOrder resource using HAPI - DSTU2. There are a few problems that I am facing while parsing the resources. I see that the Duration resource which is a part of the Timing.repeat is not parsed consistently. It sometimes seems to be able parse it and sometimes fails to parse it. There are no errors thrown but the same resource is not parsed properly sometimes. Here is an example resource we are using:

<MedicationOrder xmlns="">
    <id value="7af48133-4c47-47d7-8d94-6a07abc18bf9"/>
        <value value="urn:uuid:7af48133-4c47-47d7-8d94-6a07abc18bf9"/>
    <dateWritten value="2015-09-22T17:04:40.000+05:30"/>
    <status value="active"/>
        <reference value=""/>
        <display value="98104750156"/>
        <reference value=""/>
        <reference value="urn:uuid:445be5c3-d373-422a-b46d-d0ec5862b52f"/>
            <system value="/openmrs/ws/rest/v1/tr/drugs/104"/>
            <code value="104"/>
            <display value="Lactic Acid"/>
                    <value value="10"/>
                    <system value=""/>
                    <code value="wk"/>
                <frequency value="2"/>
                <period value="1"/>
                <periodUnits value="wk"/>
        <asNeededBoolean value="true"/>
                <system value="http://localhost:9080/openmrs/concepts/1011" />
                <code value="1011" />
                <display value="Oral"/>
            <system value="http://localhost:9080/openmrs/ws/rest/v1/tr/vs/Quantity-Units" />
            <code value="mg" />
            <value value="10"/>

This appears to be an HAPI encoding issue. The resource should be encoding boundsDuration as boundsQuantity, since duration is a profile on quantity.


This comment has been minimized.


jamesagnew commented Sep 29, 2015

This turned out to be real after all. I have committed a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment