omoponfhir / omoponfhir-main

Main OMOPonFHIR Settings
Apache License 2.0
45 stars 15 forks source link

Issues with POST Encounter|MedicationRequest|Observation|Condition #18

Open navndn opened 2 years ago

navndn commented 2 years ago

This issue is identical to the issue #15 (closed w/o resolution?)

I've setup the omop-on-fhir server and am able to POST new Patients. But I'm getting the following error response while POSTing Encounter, MedicationRequest, Condition etc. I'm referencing an existing/valid Patient as subject.

500 Response

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Failed to call access method: org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: could not execute batch; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Failed to call access method: org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: could not execute batch; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch"
    }
  ]
}

Request

{
  "resourceType": "MedicationRequest",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"
    ]
  },
  "status": "active",
  "intent": "plan",
  "reportedBoolean": true,
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "1187314",
        "display": "Tylenol PM Pill"
      }
    ],
    "text": "Tylenol PM Pill"
  },
  "subject": {
    "reference": "Patient/8",
    "display": "Amy V. Shaw"
  },
  "authoredOn": "2019-06-24",
  "dosageInstruction": [
    {
      "text": "Takes 1-2 tablets once daily at bedtime as needed for restless legs"
    }
  ]
}

Have anyone else faced this issue? Any help would be much appreciated.

Thanks

@myungchoi @hms1