Problem with running test case - [FM 64]

Hello everyone,

I’m adding test case for searchConditionsByPatient(). It requires a dataset which has patient and condition resource. I found one at openmrs-module-emrapi - conditionListDataSet.xml (https://github.com/openmrs/openmrs-module-emrapi/blob/master/condition-list/src/test/resources/conditionListDataSet.xml). I copied conditionListDataSet.xml to fhir module test/resources folder, on executing it throws an exception:

org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: “FK_4PIDXMF32TQRMFERVDL0MGJ9C: PUBLIC.PATIENT_IDENTIFIER FOREIGN KEY(IDENTIFIER_TYPE) REFERENCES PUBLIC.PATIENT_IDENTIFIER_TYPE(PATIENT_IDENTIFIER_TYPE_ID) (3)”; SQL statement: update PATIENT_IDENTIFIER set DATE_CREATED = ?, PATIENT_ID = ?, IDENTIFIER = ?, IDENTIFIER_TYPE = ?, CREATOR = ?, UUID = ?, PREFERRED = ?, VOIDED = ? where PATIENT_IDENTIFIER_ID = ? [23506-187]

Is there a way to use orignal conditionListDataSet.xml from openmrs-module-emrapi module? @harsha89

Did you try using an identifier type id that already exists in the standardTestDataset.xml file?