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

Closed
jamesagnew opened this Issue Sep 29, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@jamesagnew
Owner

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="http://hl7.org/fhir">
    <id value="7af48133-4c47-47d7-8d94-6a07abc18bf9"/>
    <identifier>
        <value value="urn:uuid:7af48133-4c47-47d7-8d94-6a07abc18bf9"/>
    </identifier>
    <dateWritten value="2015-09-22T17:04:40.000+05:30"/>
    <status value="active"/>
    <patient>
        <reference value="http://www.mci.com/patients/98104750156"/>
        <display value="98104750156"/>
    </patient>
    <prescriber>
        <reference value="http://www.pr.com/providers/812.json"/>
    </prescriber>
    <encounter>
        <reference value="urn:uuid:445be5c3-d373-422a-b46d-d0ec5862b52f"/>
    </encounter>
    <medicationCodeableConcept>
        <coding>
            <system value="/openmrs/ws/rest/v1/tr/drugs/104"/>
            <code value="104"/>
            <display value="Lactic Acid"/>
        </coding>
    </medicationCodeableConcept>
    <dosageInstruction>
        <timing>
            <repeat>
                <boundsDuration>
                    <value value="10"/>
                    <system value="http://unitsofmeasure.org"/>
                    <code value="wk"/>
                </boundsDuration>
                <frequency value="2"/>
                <period value="1"/>
                <periodUnits value="wk"/>
            </repeat>
        </timing>
        <asNeededBoolean value="true"/>
        <route>
            <coding>
                <system value="http://localhost:9080/openmrs/concepts/1011" />
                <code value="1011" />
                <display value="Oral"/>
            </coding>
        </route>
        <doseQuantity>
            <system value="http://localhost:9080/openmrs/ws/rest/v1/tr/vs/Quantity-Units" />
            <code value="mg" />
            <value value="10"/>
        </doseQuantity>
    </dosageInstruction>
</MedicationOrder>

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

@jamesagnew

This comment has been minimized.

Owner

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